fw4spl
IGuiContainerSrv.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 
11 #include <fwCom/Slot.hpp>
12 #include <fwCom/Slots.hpp>
13 
14 #include <fwServices/IService.hpp>
15 
16 namespace fwGui
17 {
18 // Forward declarations
19 namespace container
20 {
21 class fwContainer;
22 }
23 namespace layoutManager
24 {
25 class IViewLayoutManager;
26 }
27 namespace registrar
28 {
29 class ViewRegistrar;
30 }
31 namespace builder
32 {
33 class IToolBarBuilder;
34 class IContainerBuilder;
35 class ISlideViewBuilder;
36 }
37 
105 class FWGUI_CLASS_API IGuiContainerSrv : public ::fwServices::IService
106 {
107 
108 public:
109 
111 
112  FWGUI_API SPTR(::fwGui::container::fwContainer) getContainer();
113 
114  FWGUI_API void setParent(std::string wid);
115 
116 protected:
117 
118  FWGUI_API IGuiContainerSrv();
119 
120  FWGUI_API virtual ~IGuiContainerSrv();
121 
122  typedef ::fwRuntime::ConfigurationElement::sptr ConfigurationType;
123 
130  FWGUI_API void initialize();
131 
137  FWGUI_API void create();
138 
140  FWGUI_API void destroy();
141 
146  FWGUI_API static const ::fwCom::Slots::SlotKeyType s_SET_ENABLED_SLOT;
148 
150  FWGUI_API static const ::fwCom::Slots::SlotKeyType s_ENABLE_SLOT;
151 
153  FWGUI_API static const ::fwCom::Slots::SlotKeyType s_DISABLE_SLOT;
154 
156  FWGUI_API static const ::fwCom::Slots::SlotKeyType s_SET_VISIBLE_SLOT;
157 
159  FWGUI_API static const ::fwCom::Slots::SlotKeyType s_SHOW_SLOT;
160 
162  FWGUI_API static const ::fwCom::Slots::SlotKeyType s_HIDE_SLOT;
163 
165  FWGUI_API void setEnabled(bool isEnabled);
167  FWGUI_API void enable();
169  FWGUI_API void disable();
171  FWGUI_API void setVisible(bool isVisible);
173  FWGUI_API void show();
175  FWGUI_API void hide();
176 
181 private:
182 
183  typedef std::vector< SPTR(::fwGui::builder::ISlideViewBuilder) > SlideViewContainerType;
184 
185  void initializeLayoutManager( ::fwRuntime::ConfigurationElement::sptr layoutConfig );
186  void initializeToolBarBuilder( ::fwRuntime::ConfigurationElement::sptr toolBarConfig );
187  void initializeSlideViewBuilder( ::fwRuntime::ConfigurationElement::sptr slideViewConfig );
188 
189  bool m_viewLayoutManagerIsCreated;
190  SPTR( ::fwGui::layoutManager::IViewLayoutManager) m_viewLayoutManager;
191 
192  SPTR( ::fwGui::registrar::ViewRegistrar) m_viewRegistrar;
193  SPTR( ::fwGui::builder::IToolBarBuilder) m_toolBarBuilder;
194  SPTR( ::fwGui::builder::IContainerBuilder) m_containerBuilder;
195  SlideViewContainerType m_slideViewBuilders;
196 
197  ConfigurationType m_viewRegistrarConfig;
198  ConfigurationType m_viewLayoutConfig;
199  ConfigurationType m_toolBarConfig;
200  ConfigurationType m_slideViewConfig;
201 
202  bool m_hasToolBar;
203 };
204 
205 } // namespace fwGui
Base class for all services.
Definition: IService.hpp:61
#define SPTR(_cls_)
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
STL namespace.
Defines the generic layout manager for IHM.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
Defines the service interface managing the layout.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Defines the generic view manager for IHM.
Defines the generic container for IHM.
Definition: fwContainer.hpp:21