fw4spl
ViewRegistrar.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #include "fwGui/config.hpp"
10 #include "fwGui/container/fwContainer.hpp"
11 #include "fwGui/container/fwMenuBar.hpp"
12 #include "fwGui/container/fwToolBar.hpp"
13 #include "fwGui/GuiBaseObject.hpp"
14 
15 #include <fwRuntime/ConfigurationElement.hpp>
16 
17 namespace fwGui
18 {
19 namespace container
20 {
21 class fwContainer;
22 class fwMenuBar;
23 class fwToolBar;
24 }
25 
26 namespace registrar
27 {
28 
33 class FWGUI_CLASS_API ViewRegistrar : public ::fwGui::GuiBaseObject
34 {
35 
36 public:
37 
40 
42  FWGUI_API ViewRegistrar( const std::string& sid);
43 
45  FWGUI_API virtual ~ViewRegistrar();
46 
47  FWGUI_API virtual SPTR(::fwGui::container::fwContainer) getParent();
48 
49  FWGUI_API virtual void setParent(std::string wid);
50 
101  FWGUI_API virtual void initialize( ::fwRuntime::ConfigurationElement::sptr configuration);
102 
110  FWGUI_API virtual void manage(std::vector< SPTR(::fwGui::container::fwContainer) > subViews );
111 
116  FWGUI_API virtual void manageMenuBar(SPTR(::fwGui::container::fwMenuBar) menuBar );
117 
122  FWGUI_API virtual void manageToolBar(SPTR(::fwGui::container::fwToolBar) toolBar );
123 
128  FWGUI_API virtual void unmanage();
129 
134  FWGUI_API virtual void unmanageToolBar();
135 
140  FWGUI_API virtual void unmanageMenuBar();
141 
142 protected:
143 
144  typedef ::fwRuntime::ConfigurationElement::sptr ConfigurationType;
145  typedef std::map< std::string, std::pair<unsigned int, bool> > SIDContainerMapType;
146  typedef std::map< std::string, unsigned int > WIDContainerMapType;
147  typedef std::pair< std::string, bool > SIDMenuBarPairType;
148  typedef std::pair< std::string, bool > SIDToolBarPairType;
149 
154  SIDContainerMapType m_sids;
155 
157  WIDContainerMapType m_wids;
158 
160  SIDMenuBarPairType m_menuBarSid;
161 
163  SIDToolBarPairType m_toolBarSid;
164 
165  std::string m_parentWid;
166  SPTR(::fwGui::container::fwContainer) m_parentContainer;
167 
169  std::string m_sid;
170 };
171 
172 } // namespace registrar
173 } // namespace fwGui
#define SPTR(_cls_)
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
STL namespace.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Base class for all fwGui&#39;s classes.
Defines the generic view manager for IHM.
Defines the generic container for IHM.
Definition: fwContainer.hpp:21