NCBI C++ ToolKit
window_manager_service_impl.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_FRAMEWORK___WINDOW_MANAGER_SERVICE_IMPL__HPP
2 #define GUI_FRAMEWORK___WINDOW_MANAGER_SERVICE_IMPL__HPP
3 
4 /* $Id: window_manager_service_impl.hpp 33163 2015-06-05 16:45:34Z katargir $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Andrey Yazhuk
30  *
31  * File Description:
32  * CWindowManagerService - standard implementation of IWindowManagerService.
33  */
34 
35 /** @addtogroup GUI_FRAMEWORK
36 *
37 * @{
38 */
39 
40 #include <corelib/ncbistd.hpp>
41 
42 #include <gui/gui_export.h>
43 
48 
51 
53 
54 class wxFrame;
55 class wxFileArtProvider;
56 class wxCommandEvent;
57 
58 #include <set>
59 
61 
62 ///////////////////////////////////////////////////////////////////////////////
63 /// CWindowManagerService - standard implementation of IWindowManagerService
64 /// interface built on CWindowManager class.
65 /// CWindowManagerService also implements IToolBarService.
66 ///
67 /// CWindowManagerService implements IMenuContributor in order to be compatible
68 /// with IMenuService. It also implements IWindowManagerMenuListener to allow
69 /// CWindowManager to change menu dynamically when needed.
71  public CObject,
72  public IWindowManagerService,
73  public IToolBarService,
74  public IService,
76  public IMenuContributor,
77  public IRegSettings
78 {
79 public:
81  virtual ~CWindowManagerService();
82 
83  virtual void SetFrame(wxFrame* frame);
84 
85  /// @name IService implementation
86  /// @{
87  virtual void InitService();
88  virtual void ShutDownService();
89  /// @}
90 
91  /// @name IWindowManagerService implementation
92  /// @
93  virtual CWindowManager* GetWindowManager() { return m_WindowManager; }
94 
95  virtual void SetAdvisor(IWindowManagerAdvisor* advisor);
96 
97  virtual void AddClient(IWMClient& client, bool bFloat);
98  virtual wxFrame* MoveToFloatingFrame(IWMClient& client);
99 
100  virtual void CloseClient(IWMClient& client);
101  virtual void CloseClients(const TClients& clients);
102  virtual void CloseAllClients();
103 
104  virtual void GetAllClients(TClients& clients);
105  virtual IWMClient* GetActiveClient();
106 
107  virtual void ActivateClient(IWMClient& client);
108  virtual void ActivateClients(TClients& clients);
109 
110  virtual void RegisterActiveClient(IWMClient& client);
111  virtual void UnRegisterActiveClient(IWMClient& client);
112 
113  virtual void RaiseFloatingWindowsInZOrder();
114  virtual void RaiseFloatingWindowsInZOrder(wxRect r);
115 
116  virtual bool IsDragging() const;
117 
118  virtual void RefreshClient(IWMClient& client);
119 
120  virtual void ApplyLayout(const objects::CUser_object& layout);
121  virtual objects::CUser_object* SaveLayout();
122  virtual void LoadLayout(const objects::CUser_object& layout,
123  IWMClientFactory& factory);
124  /// @}
125 
126  /// @name IToolBarService implementation
127  /// @{
128  virtual void AddToolBarFactory(IToolBarContributor* factory);
129  virtual void DeleteToolBarFactory(IToolBarContributor* factory);
132  /// @}
133 
134  /// @name IWindowManagerMenuListener implementation
135  /// @{
136  virtual void UpdateMenuBar();
137  /// @}
138 
139  /// @name IMenuContributor
140  /// @{
141  virtual const wxMenu* GetMenu();
142  //virtual void UpdateMenuBar(wxMenu& menu);
143  /// @}
144 
145  /// @name IRegSettings interface implementation
146  /// @{
147  virtual void SetRegistryPath(const string& path);
148  virtual void LoadSettings();
149  virtual void SaveSettings() const;
150  /// @}
151 
152  virtual void SetMenuService(IMenuService* service);
153 
154  bool OnCommandEvent(wxCommandEvent& event);
155 
156 protected:
157  virtual void x_ShowToolBar(const string& name, bool show);
158  virtual void x_ShutDownToolBars();
159 
160 protected:
162  typedef vector<IToolBarContributor*> TToolBarFactories;
164 
165  string m_RegPath;
166 
168 
169  wxFrame* m_Frame;
170 
171  // registered toolbar factories
173 
174  /// holds registered toolbar contexts
176 
177  /// holds a map of toolbar names declared by registered contexts
178  /// toolbar name -> context count
180 
182 };
183 
184 
186 
187 /* @} */
188 
189 #endif // GUI_FRAMEWORK___WINDOW_MANAGER_SERVICE_IMPL__HPP
190 
CObject –.
Definition: ncbiobj.hpp:180
CWindowManagerService - standard implementation of IWindowManagerService interface built on CWindowMa...
CWindowManager - component controlling windowing of client windows.
IMenuContributor - contributes menu to Menu Service.
Definition: ui_command.hpp:371
virtual const wxMenu * GetMenu()
returns a menu (must be deleted by the caller) menu injections should follow a separator named "Contr...
Definition: ui_command.hpp:375
IMenuService - Menu Service.
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
virtual void SaveSettings() const =0
virtual void LoadSettings()=0
virtual void SetRegistryPath(const string &path)=0
IService – an abstraction that represents an application component providing specific functional capa...
Definition: service.hpp:56
IToolBarContext - represent a UI object that requires toolbars.
IToolBarContributor - a factory that produces toolbars.
Definition: ui_command.hpp:395
IToolBarService.
IWMClientFactory - IWMClient factory.
Definition: wm_client.hpp:133
IWClient - abstract Window Manager client.
Definition: wm_client.hpp:50
IWindowManagerAdvisor.
virtual void UpdateMenuBar()=0
IWindowManagerService Window Manager Service provides access to Window Manager functionality.
Include a standard set of the NCBI C++ Toolkit most basic headers.
virtual void RaiseFloatingWindowsInZOrder()=0
Raise all floating windows to preserve/refresh z-order.
virtual void CloseClients(const TClients &clients)=0
virtual void AddClient(IWMClient &client, bool bFloat)=0
places the given IWMClient in the Main Tabbed Pane in Window Manager
vector< IToolBarContributor * > TToolBarFactories
virtual void RemoveToolBarContext(IToolBarContext *context)=0
unregister toolbar context
virtual void LoadLayout(const objects::CUser_object &layout, IWMClientFactory &factory)=0
creates a new window layout based on description in the given CUser_object creates clients using IWMC...
virtual void AddToolBarFactory(IToolBarContributor *factory)=0
the service assumes ownership of the given factory (will delete it)
virtual void DeleteToolBarFactory(IToolBarContributor *factory)=0
forces deleting of the factory
virtual void ActivateClients(TClients &clients)=0
makes clients visible, make the first client in the given container focused
set< IToolBarContext * > TToolBarContexts
virtual void AddToolBarContext(IToolBarContext *context)=0
register toolbar context the service does NOT assume ownership of the context
TTBNameToCount m_TBNameToCount
holds a map of toolbar names declared by registered contexts toolbar name -> context count
virtual void RefreshClient(IWMClient &client)=0
refresh client UI (title)
TToolBarContexts m_ToolBarContexts
holds registered toolbar contexts
virtual void GetAllClients(TClients &clients)=0
returns a list of all registered IWMClients
virtual void CloseClient(IWMClient &client)=0
remove client(s) from Window Manager these functions do not disconnect clients from other services
virtual bool IsDragging() const =0
Returns true if a drag operation is currently in progress.
virtual void InitService()=0
virtual void ApplyLayout(const objects::CUser_object &layout)=0
virtual IWMClient * GetActiveClient()=0
returns Active client (i.e. client that has focus)
virtual objects::CUser_object * SaveLayout()=0
saves current window layout to CUser_object
virtual void ActivateClient(IWMClient &client)=0
makes client visible and focused
virtual CWindowManager * GetWindowManager()
virtual void UnRegisterActiveClient(IWMClient &client)=0
virtual void ShutDownService()=0
virtual void RegisterActiveClient(IWMClient &client)=0
virtual void CloseAllClients()=0
virtual void SetAdvisor(IWindowManagerAdvisor *advisor)=0
the service does not assume ownership of the given object
virtual wxFrame * MoveToFloatingFrame(IWMClient &client)=0
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIFRAMEWORK_EXPORT
Definition: gui_export.h:509
Defines to provide correct exporting from DLLs in Windows.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static CNamedPipeClient * client
static CS_CONTEXT * context
Definition: will_convert.c:21
Modified on Fri Sep 20 14:58:02 2024 by modify_doxy.py rev. 669887