32 #include <wx/platform.h>
69 m_FileArtProvider(
NULL),
71 m_EventLogService(
NULL),
73 m_StatusBarService(
NULL),
74 m_WindowManagerService(
NULL),
75 m_AppTaskService(
NULL),
76 m_ViewManagerService(
NULL)
98 string msg =
"Service with name \"" + class_name +
99 "\" is already registered in Workbench";
125 string msg =
"Service with name \"" + class_name +
126 "\" is not registered in Workbench";
129 IService* service = it->second.GetPointer();
204 sb_srv->SetStatusMessage(
"Shutdown initiated.");
418 wxPoint def_pos(0, 0);
419 wxSize def_size(600, 500);
428 wxIcon icon = provider.GetIcon(
wxT(
"frame::icon"));
457 static wxEventType inEvent = wxEVT_NULL;
458 if (inEvent == event.GetEventType())
460 inEvent =
event.GetEventType();
465 wxEventType
type =
event.GetEventType();
468 wxCommandEvent* cmd_evt =
dynamic_cast<wxCommandEvent*
>(&event);
473 res = wxEvtHandler::ProcessEvent(event);
476 inEvent = wxEVT_NULL;
CAppTaskService - Application Task Service.
CEventLogService - the standard implementation of IEventLogService.
virtual void SetHintListener(IHintListener *listener)
virtual void SetRegistryPath(const string &path)
virtual void LoadSettings()
virtual void SaveSettings() const
CStatusBarService - the standard implementation of IStatusBarService interface.
static wxString ResolvePath(const wxString &path, const wxString &rel_name)
Utility function to hide the platform specifics of locating our standard directories and files.
CUICommandRegistry is a centralized registry where all application commands should be registered.
static CUICommandRegistry & GetInstance()
the main instance associated with the application
CViewManagerService - the standard implementation of IViewManagerService interface.
CWindowManagerService - standard implementation of IWindowManagerService interface built on CWindowMa...
CWorkbenchFrame Main Application Frame for Workbench-based applications.
CwxSplittingArtProvider - an adapter for old-style image aliases.
IEventLogService - records application events.
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
virtual void SetRegistryPath(const string &path)=0
IServiceLocator - an abstract mechanism for locating services.
IService – an abstraction that represents an application component providing specific functional capa...
IViewManagerService IViewManagerService manages views in Workbench.
IWindowManagerService Window Manager Service provides access to Window Manager functionality.
IWorkbenchAdvisor This is an interface that assists IWorkbench in carrying out its functions.
container_type::iterator iterator
const_iterator end() const
const_iterator find(const key_type &key) const
virtual void RegisterFileAlias(const wxArtID &anId, const wxArtClient &aClient, const wxSize &aSize, const wxString &aName, long aType=wxBITMAP_TYPE_ANY, int anIndex=-1)
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Info(CExceptionArgs_Base &args)
void Consumer_SetLocator(T *obj, IServiceLocator *locator)
virtual void SetEventDisplayTime(int sec)
virtual void HideHintMessage()
virtual IToolBarService * GetToolBarService()
CViewManagerService * m_ViewManagerService
CEventLogService * m_EventLogService
virtual CAppTaskService * GetAppTaskService()
virtual void x_ShutDownServices()
free resources associated with Extra Service Locator
virtual IViewManagerService * GetViewManagerService()
wxFileArtProvider * m_FileArtProvider
virtual wxFileArtProvider & GetFileArtProvider()
TNameToService m_NameToExtraService
a Map of Additional Services : Name -> Service
bool ProcessEvent(wxEvent &event)
filter events; forward command events to Window Manager in order to deliver commands to active window...
virtual wxFrame * GetMainWindow()
returns a pointer to the main application frame window
virtual void ShowCommandHint(const string &text)
virtual void PreShutDown()=0
called by Workbench before starting ShutDown
virtual CUICommandRegistry & GetUICommandRegistry()
returns an instance of Command Registry associated with the Workbench
virtual void x_InitMainFrame()
create application Main Frame
virtual IWindowManagerService * GetWindowManagerService()
virtual void SetWorkbench(IWorkbench *workbench)
virtual void SetRegistryPath(const string &path)
CWorkbenchFrame * m_MainFrame
pointers to the Standard Services
virtual CWorkbenchFrame * x_CreateMainFrame(const string &title)
virtual bool CanShutDown()
IWorkbenchAdvisor * m_Advisor
path to th Workbench section in the Registry
virtual void x_CreateFileArtProvider()
virtual CIRef< IService > GetService(const string &name)
retrieves the service
bool OnCommandEvent(wxCommandEvent &event)
virtual void PreDestroyWindow()=0
called by Workbench before destroying main app window
CMenuService * m_MenuService
virtual void HideCommandHint()
virtual bool HasService(const string &name)
returns true if the service exists within the scope of the locator
virtual void AddContributor(IMenuContributor *contributor)
the service does NOT assume ownership of the contributor
virtual void SetWorkbench(IWorkbench *workbench)
connect / disconnect to / from Workbench
virtual void x_DestroyMainFrame()
destroy application Main Frame
CWorkbench(IWorkbenchAdvisor *advisor)
TODO.
virtual void InitService()=0
virtual void SetMenuService(IMenuService *service)
virtual void PostInit()=0
called after Workbench initialization has been completed
virtual void PostCreateWindow()=0
called by Workbench after creating main app window
virtual void SetFrame(wxFrame *frame, CUICommandRegistry &cmd_reg)
virtual bool CanShutDown()=0
virtual string GetRegistrySectionPath(ERegistrySection section)
returns a path to CGuiRegistry section where resources of the specified type shall be located
virtual void RegisterService(const string &class_name, IService *service)
register extra i.e.
virtual void UnRegisterService(const string &class_name)
remove application-specific service
virtual void SaveSettings() const
virtual void SetFrame(wxFrame *frame)
virtual IMenuService * GetMenuService()
virtual void ShutDownService()=0
virtual IServiceLocator * GetServiceLocator()
get a Service Locator associated with the Workspace
CAppTaskService * m_AppTaskService
ERegistrySection
enumerates major Registry sections
virtual void LoadSettings()
virtual IStatusBarService * GetStatusBarService()
CStatusBarService * m_StatusBarService
virtual void ShowHintMessage(const string &msg)
virtual IEventLogService * GetEventLogService()
virtual string GetAppTitle()=0
get application title
virtual wxStatusBar * CreateStatusBar(wxFrame *frame)
CWindowManagerService * m_WindowManagerService
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static void text(MDB_val *v)
wxEVT_COMMAND_MENU_SELECTED
static const char * kMainFrameSection
void InitDefaultFileArtProvider(const wxString &dir)
wxFileArtProvider * GetDefaultFileArtProvider()
wxString ToWxString(const string &s)