fw4spl
IFrameSrv.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
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_IFRAMESRV_HPP__
8 #define __FWGUI_IFRAMESRV_HPP__
9 
10 #include "fwGui/builder/IMenuBarBuilder.hpp"
11 #include "fwGui/builder/IToolBarBuilder.hpp"
12 #include "fwGui/config.hpp"
13 #include "fwGui/container/fwContainer.hpp"
14 #include "fwGui/layoutManager/IFrameLayoutManager.hpp"
15 #include "fwGui/registrar/ViewRegistrar.hpp"
16 
17 #include <fwCom/Signal.hpp>
18 #include <fwCom/Signals.hpp>
19 
20 #include <fwServices/IService.hpp>
21 
22 namespace fwGui
23 {
24 
68 class FWGUI_CLASS_API IFrameSrv : public ::fwServices::IService
69 {
70 
71 public:
72 
74 
76  FWGUI_API static ::fwGui::container::fwContainer::sptr getProgressWidget();
77 
82  static const ::fwCom::Signals::SignalKeyType s_CLOSED_SIG;
84  typedef ::fwCom::Signal< void ()> ClosedSignalType;
94  static const ::fwCom::Slots::SlotKeyType s_SET_VISIBLE_SLOT;
96 
98  static const ::fwCom::Slots::SlotKeyType s_SHOW_SLOT;
99 
101  static const ::fwCom::Slots::SlotKeyType s_HIDE_SLOT;
106 protected:
107 
108  FWGUI_API IFrameSrv();
109 
110  FWGUI_API virtual ~IFrameSrv();
111 
112  typedef ::fwRuntime::ConfigurationElement::sptr ConfigurationType;
119  FWGUI_API void initialize();
120 
122  FWGUI_API void create();
123 
125  FWGUI_API void destroy();
126 
127  FWGUI_API static const std::string CLOSE_POLICY_EXIT;
128  FWGUI_API static const std::string CLOSE_POLICY_NOTIFY;
129  FWGUI_API static const std::string CLOSE_POLICY_MESSAGE;
130 
132  FWGUI_API static ::fwGui::container::fwContainer::wptr m_progressWidget;
133 
134 private:
135 
137  void setVisible(bool isVisible);
139  void show();
141  void hide();
142 
143  void onCloseExit();
144  void onCloseNotify();
145  void onCloseMessage();
146  void initializeLayoutManager( ::fwRuntime::ConfigurationElement::sptr layoutConfig );
147  void initializeMenuBarBuilder( ::fwRuntime::ConfigurationElement::sptr menuBarConfig );
148  void initializeToolBarBuilder( ::fwRuntime::ConfigurationElement::sptr toolBarConfig );
149 
150  ::fwGui::layoutManager::IFrameLayoutManager::sptr m_frameLayoutManager;
151  ::fwGui::registrar::ViewRegistrar::sptr m_viewRegistrar;
152  ::fwGui::builder::IMenuBarBuilder::sptr m_menuBarBuilder;
153  ::fwGui::builder::IToolBarBuilder::sptr m_toolBarBuilder;
154 
155  ConfigurationType m_registrarConfig;
156  ConfigurationType m_frameConfig;
157  ConfigurationType m_menuBarConfig;
158  ConfigurationType m_toolBarConfig;
159 
160  bool m_hasMenuBar;
161  bool m_hasToolBar;
162 
163  std::string m_closePolicy;
164 
166  ClosedSignalType::sptr m_sigClosed;
167 };
168 
169 } // namespace fwGui
170 
171 #endif /*__FWGUI_IFRAMESRV_HPP__*/
172 
Base class for all services.
Definition: IService.hpp:61
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
static const ::fwCom::Slots::SlotKeyType s_SHOW_SLOT
Slot to show the container.
Definition: IFrameSrv.hpp:98
Defines the service interface managing a frame.
Definition: IFrameSrv.hpp:68
static const ::fwCom::Slots::SlotKeyType s_HIDE_SLOT
Slot to hide the container.
Definition: IFrameSrv.hpp:101
::fwCom::Signal< void()> ClosedSignalType
Signal emitted when frame is closed and onclose policy is notify.
Definition: IFrameSrv.hpp:84
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
static FWGUI_API::fwGui::container::fwContainer::wptr m_progressWidget
Static reference on a widget defined for progress bar installation.
Definition: IFrameSrv.hpp:132