fw4spl
GuiRegistry.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWGUI_GUIREGISTRY_HPP__
8 #define __FWGUI_GUIREGISTRY_HPP__
9 
10 
11 #include "fwGui/GuiBaseObject.hpp"
12 #include "fwGui/config.hpp"
13 #include "fwGui/container/fwContainer.hpp"
14 #include "fwGui/container/fwMenu.hpp"
15 #include "fwGui/container/fwMenuBar.hpp"
16 #include "fwGui/container/fwMenuItem.hpp"
17 #include "fwGui/container/fwToolBar.hpp"
18 
19 namespace fwGui
20 {
21 
25 class FWGUI_CLASS_API GuiRegistry : public ::fwGui::GuiBaseObject
26 {
27 
28 public:
29 
30  typedef std::map< std::string, ::fwGui::container::fwContainer::sptr > ContainerMapType;
31  typedef std::map< std::string, ::fwGui::container::fwMenuBar::sptr > MenuBarMapType;
32  typedef std::map< std::string, ::fwGui::container::fwToolBar::sptr > ToolBarMapType;
33  typedef std::map< std::string, ::fwGui::container::fwMenu::sptr > MenuMapType;
34  typedef std::vector< std::string > ParentSidsType;
35  typedef std::map< std::string, ParentSidsType > ActionToParentMapType;
36 
38 
39 
42  FWGUI_API GuiRegistry();
43 
47  FWGUI_API virtual ~GuiRegistry();
48 
49  //-----------------------------------------------------------------------------
50 
54 
59  FWGUI_API static void registerSIDContainer(std::string sid, ::fwGui::container::fwContainer::sptr container);
60 
64  FWGUI_API static void unregisterSIDContainer(std::string sid);
65 
69  FWGUI_API static ::fwGui::container::fwContainer::sptr getSIDContainer(std::string sid);
70 
74  FWGUI_API static bool hasSIDContainer(std::string sid);
75 
77 
78  //-----------------------------------------------------------------------------
79 
83 
88  FWGUI_API static void registerWIDContainer(std::string wid, ::fwGui::container::fwContainer::sptr container);
89 
93  FWGUI_API static void unregisterWIDContainer(std::string wid);
94 
98  FWGUI_API static ::fwGui::container::fwContainer::sptr getWIDContainer(std::string wid);
99 
103  FWGUI_API static bool hasWIDContainer(std::string wid);
104 
106 
107  //-----------------------------------------------------------------------------
108 
112 
117  FWGUI_API static void registerSIDMenuBar(std::string sid, ::fwGui::container::fwMenuBar::sptr menuBar);
118 
122  FWGUI_API static void unregisterSIDMenuBar(std::string sid);
126  FWGUI_API static ::fwGui::container::fwMenuBar::sptr getSIDMenuBar(std::string sid);
128 
129 
130  //-----------------------------------------------------------------------------
131 
135 
140  FWGUI_API static void registerSIDToolBar(std::string sid, ::fwGui::container::fwToolBar::sptr toolBar);
141 
145  FWGUI_API static void unregisterSIDToolBar(std::string sid);
149  FWGUI_API static ::fwGui::container::fwToolBar::sptr getSIDToolBar(std::string sid);
151 
152  //-----------------------------------------------------------------------------
153 
157 
162  FWGUI_API static void registerSIDMenu(std::string sid, ::fwGui::container::fwMenu::sptr menu);
163 
167  FWGUI_API static void unregisterSIDMenu(std::string sid);
171  FWGUI_API static ::fwGui::container::fwMenu::sptr getSIDMenu(std::string sid);
173 
174  //-----------------------------------------------------------------------------
175 
179 
184  FWGUI_API static void registerActionSIDToParentSID(std::string actionSid, std::string parentSid);
185 
189  FWGUI_API static void unregisterActionSIDToParentSID(std::string actionSid, std::string parentSid);
190 
195  FWGUI_API static void actionServiceStopping(std::string actionSid);
196 
201  FWGUI_API static void actionServiceStarting(std::string actionSid);
202 
207  FWGUI_API static void actionServiceSetActive(std::string actionSid, bool isActive);
208 
213  FWGUI_API static void actionServiceSetExecutable(std::string actionSid, bool isExecutable);
214 
219  FWGUI_API static void actionServiceSetVisible(std::string actionSid, bool isVisible);
221 
222 protected:
223 
224  static ContainerMapType m_globalSIDToFwContainer;
225  static ContainerMapType m_globalWIDToFwContainer;
226  static MenuBarMapType m_globalSIDToFwMenuBar;
227  static ToolBarMapType m_globalSIDToFwToolBar;
228  static MenuMapType m_globalSIDToFwMenu;
229 
231  static ActionToParentMapType m_actionSIDToParentSID;
232 
233 };
234 
235 } // namespace fwGui
236 
237 #endif /*__FWGUI_GUIREGISTRY_HPP__*/
238 
239 
#define fwCoreNonInstanciableClassDefinitionsMacro(_classinfo_)
Generate common code for Non Instanciable classes (Interfaces, Abstract classes, ...)
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
STL namespace.
Base class for all fwGui&#39;s classes.
This class contains helpers to manage all fwContainer in the application.
Definition: GuiRegistry.hpp:25