fw4spl
fwGui::layoutManager::IToolBarLayoutManager Class Referenceabstract

Defines the toolBar layout manager for IHM. More...

#include <IToolBarLayoutManager.hpp>

+ Inheritance diagram for fwGui::layoutManager::IToolBarLayoutManager:
+ Collaboration diagram for fwGui::layoutManager::IToolBarLayoutManager:

Classes

class  ActionInfo
 

Public Types

typedef ::fwRuntime::ConfigurationElement::sptr ConfigurationType
 
typedef std::string RegistryKeyType
 
typedef std::vector< ::fwGui::IMenuItemCallback::sptr > CallbacksType
 
- Public Types inherited from fwGui::GuiBaseObject
typedef ::fwGui::factory::Key Key
 

Public Member Functions

virtual bool isA (const std::string &type) const override
 
FWGUI_API IToolBarLayoutManager ()
 Constructor. Do nothing.
 
virtual FWGUI_API ~IToolBarLayoutManager ()
 Destructor. Do nothing.
 
virtual FWGUI_API std::vector< ::fwGui::container::fwMenuItem::sptr > getMenuItems ()
 Returns the vector of fwMenuItem managed by this layout.
 
virtual FWGUI_API std::vector< ::fwGui::container::fwMenu::sptr > getMenus ()
 Returns the vector of fwMenu managed by this layout.
 
virtual FWGUI_API std::vector< ::fwGui::container::fwContainer::sptr > getContainers ()
 Returns the vector of fwContainer managed by this layout.
 
virtual FWGUI_API void initialize (ConfigurationType configuration)
 Initialize layout managers. More...
 
virtual FWGUI_API void createLayout (::fwGui::container::fwToolBar::sptr parent)=0
 Instantiate actions with parent toolBar.
 
virtual FWGUI_API void destroyLayout ()=0
 Destroy local actions. More...
 
virtual FWGUI_API void menuItemSetVisible (::fwGui::container::fwMenuItem::sptr, bool isVisible)=0
 Set the action visibility.
 
virtual FWGUI_API void menuItemSetEnabled (::fwGui::container::fwMenuItem::sptr, bool isEnabled)=0
 Set the action enable or not.
 
virtual FWGUI_API void menuItemSetChecked (::fwGui::container::fwMenuItem::sptr, bool isChecked)=0
 Set the action checked or not.
 
virtual void setCallbacks (CallbacksType callbacks)
 Sets callbacks associate with toolBar items.
 
- Public Member Functions inherited from fwGui::GuiBaseObject
- Public Member Functions inherited from fwCore::BaseObject
virtual const std::string & getLeafClassname () const
 return object's classname without its namespace, i.e. BaseObject
 

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
- Static Public Member Functions inherited from fwGui::GuiBaseObject
static bool isTypeOf (const std::string &type)
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
- Static Public Member Functions inherited from fwCore::BaseObject
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Static Public Attributes

FWGUI_API static const RegistryKeyType REGISTRY_KEY = "::fwGui::ToolBarLayoutManager"
 

Protected Member Functions

virtual FWGUI_API void destroyActions ()
 Helper to destroy local actions.
 
- Protected Member Functions inherited from fwGui::GuiBaseObject
 GuiBaseObject ()
 
virtual ~GuiBaseObject ()
 

Protected Attributes

std::vector< ::fwGui::container::fwMenuItem::sptr > m_menuItems
 All actions managed by this layout.
 
std::vector< ::fwGui::container::fwMenu::sptr > m_menus
 All menus managed by this layout.
 
std::vector< ::fwGui::container::fwContainer::sptr > m_containers
 All editors managed by this layout.
 
std::vector< ActionInfom_actionInfo
 Save action informations from configuration.
 
CallbacksType m_callbacks
 Callbacks associate with toolBar items.
 

Demangling methods

virtual const std::string & getClassname () const override
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 

Detailed Description

Defines the toolBar layout manager for IHM.

Definition at line 35 of file IToolBarLayoutManager.hpp.

Member Function Documentation

virtual FWGUI_API void fwGui::layoutManager::IToolBarLayoutManager::destroyLayout ( )
pure virtual

Destroy local actions.

Precondition
services using this actions must be stopped before.

Implemented in fwGui::layoutManager::ToolBarLayoutManager.

void fwGui::layoutManager::IToolBarLayoutManager::initialize ( ConfigurationType  configuration)
virtual

Initialize layout managers.

Example of configuration

1 <service uid="toolbar2" type="::fwGui::IToolBarSrv" impl="::gui::aspect::SDefaultToolBar" autoConnect="no" >
2  <gui>
3  <layout>
4  <menuItem name="My item 2" style="check" icon="TutoGui-0.1/icons/system.png"
5 icon2="TutoGui-0.1/icons/monkey.png" />
6  <menuItem name="My item 3" style="check" icon="TutoGui-0.1/icons/system.png"/>
7  <separator />
8  <menuItem name="My item A" style="radio" icon="TutoGui-0.1/icons/monkey.png"/>
9  <menuItem name="My item B" style="radio" icon="TutoGui-0.1/icons/monkey.png"/>
10  <separator />
11  <menu name="My menu" />
12  <separator />
13  <editor />
14  </layout>
15  </gui>
16  <registry>
17  <menuItem sid="item2" />
18  <menuItem sid="item3" />
19  <menuItem sid="item4" />
20  <menuItem sid="item5" />
21  <menu sid="menu" />
22  <editor sid="editor" />
23  </registry>
24 </service>

This method analyzes the gui section of the configuration.

  • <layout> (mandatory) : give the list of the menu item that will appear in the toolbar.
  • <menuItem name="My item 2" style="radio" icon="TutoGui-0.1/icons/system.png"/> :
    • name (mandatory) : give the name of the menu item that will appear in the interface.
    • style {check|radio} : give the style of the menu item.
    • icon : give the path of the icon file
    • icon2 : give the path of the icon file used when the item is checked
  • <menu name="My menu" /> :
    • name (mandatory) : give the name of the menu that will appear in the interface.
    • icon : give the path of the icon file
  • <editor> : to add an editor in the toolbar
  • <separator/> : allow to divide the toolbar by part (draw a line).

Definition at line 34 of file IToolBarLayoutManager.cpp.

References m_actionInfo, OSLM_ASSERT, and SLM_ASSERT.


The documentation for this class was generated from the following files: