fw4spl
ToolBarRegistrar.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_REGISTRAR_TOOLBARREGISTRAR_HPP__
8 #define __FWGUI_REGISTRAR_TOOLBARREGISTRAR_HPP__
9 
10 #include "fwGui/ActionCallbackBase.hpp"
11 #include "fwGui/config.hpp"
12 #include "fwGui/container/fwContainer.hpp"
13 #include "fwGui/container/fwMenu.hpp"
14 #include "fwGui/container/fwMenuItem.hpp"
15 #include "fwGui/container/fwToolBar.hpp"
16 #include "fwGui/GuiBaseObject.hpp"
17 
18 #include <fwRuntime/ConfigurationElement.hpp>
19 
20 namespace fwGui
21 {
22 namespace registrar
23 {
24 
28 class FWGUI_CLASS_API ToolBarRegistrar : public ::fwGui::GuiBaseObject
29 {
30 
31 public:
32 
35  typedef std::vector< ::fwGui::IMenuItemCallback::sptr > CallbacksType;
36 
38  FWGUI_API ToolBarRegistrar( const std::string& sid);
39 
41  FWGUI_API virtual ~ToolBarRegistrar();
42 
44  FWGUI_API virtual ::fwGui::container::fwToolBar::sptr getParent();
45 
51  FWGUI_API virtual ::fwGui::container::fwMenuItem::sptr getFwMenuItem(std::string actionSid,
52  std::vector< ::fwGui::container::fwMenuItem::sptr > menuItems);
53 
98  FWGUI_API virtual void initialize( ::fwRuntime::ConfigurationElement::sptr configuration);
99 
116  FWGUI_API virtual void manage(std::vector< ::fwGui::container::fwMenuItem::sptr > toolBarItems );
117 
126  FWGUI_API virtual void manage(std::vector< ::fwGui::container::fwMenu::sptr > toolBarItems );
127 
136  FWGUI_API virtual void manage(std::vector< ::fwGui::container::fwContainer::sptr > toolBarItems );
137 
142  FWGUI_API virtual void unmanage();
143 
147  FWGUI_API virtual void onItemAction();
148 
152  virtual CallbacksType getCallbacks()
153  {
154  return m_callbacks;
155  }
156 
157 protected:
158 
159  typedef ::fwRuntime::ConfigurationElement::sptr ConfigurationType;
160  typedef std::map< std::string, std::pair<unsigned int, bool> > SIDToolBarMapType;
161  typedef std::map< std::string, unsigned int > WIDToolBarMapType;
162 
167  SIDToolBarMapType m_actionSids;
168 
173  SIDToolBarMapType m_menuSids;
174 
179  SIDToolBarMapType m_editorSids;
180 
182  WIDToolBarMapType m_editorWids;
183 
185  std::string m_sid;
186 
188  CallbacksType m_callbacks;
189 };
190 
191 } // namespace registrar
192 } // namespace fwGui
193 
194 #endif /*__FWGUI_REGISTRAR_TOOLBARREGISTRAR_HPP__*/
195 
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
CallbacksType m_callbacks
Callback associate with toolBar items.
WIDToolBarMapType m_editorWids
All toolBar servicesID managed (and associated with subViews index vector).
SIDToolBarMapType m_menuSids
All toolBar services ID managed and associated with pair containing: menus index vector and boolean d...
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
virtual CallbacksType getCallbacks()
Returns callbacks associate with toolBar items.
SIDToolBarMapType m_editorSids
All toolBar services ID managed and associated with pair containing: editors index vector and boolean...
Base class for all fwGui&#39;s classes.
std::string m_sid
Main service ID associate with this ToolBarRegistrar.
SIDToolBarMapType m_actionSids
All toolBar services ID managed and associated with pair containing: action&#39;s index vector and boolea...
Defines the toolBar registrar for IHM.