fw4spl
fwGui::layoutManager::IMenuLayoutManager Class Referenceabstract

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

#include <IMenuLayoutManager.hpp>

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

Classes

class  ActionInfo
 

Public Types

enum  ActionType {
  DEFAULT, QUIT, ABOUT, HELP,
  NEW, SEPARATOR
}
 
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 IMenuLayoutManager ()
 Constructor. Do nothing.
 
virtual FWGUI_API ~IMenuLayoutManager ()
 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 void initialize (ConfigurationType configuration)
 Initialize layout managers. More...
 
virtual FWGUI_API void createLayout (::fwGui::container::fwMenu::sptr parent)=0
 Instantiate actions with parent menu.
 
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 menu 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::MenuLayoutManager"
 

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< ActionInfom_actionInfo
 Save action informations from configuration.
 
CallbacksType m_callbacks
 Callbacks associate with menu 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 menu layout manager for IHM.

Definition at line 33 of file IMenuLayoutManager.hpp.

Member Function Documentation

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

Destroy local actions.

Precondition
services using this actions must be stopped before.

Implemented in fwGui::layoutManager::MenuLayoutManager.

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

Initialize layout managers.

Example of configuration

1 <service uid="myMenu" type="::fwGui::IMenuSrv" impl="::gui::aspect::SDefaultMenu" autoConnect="no" >
2  <gui>
3  <layout>
4  <menuItem name="My item 1" shortcut="1" style="check" icon="TutoGui-0.1/icons/system.png" />
5  <separator />
6  <menuItem name="My item 2" shortcut="2" style="radio" />
7  <menuItem name="My item 3" shortcut="3" style="radio" />
8  <separator />
9  <menu name="My menu" />
10  <separator />
11  <menuItem name="Quit" shortcut="Ctrl+Q" specialAction="QUIT" />
12  </layout>
13  </gui>
14  <registry>
15  <menuItem sid="item1" start="yes" />
16  <menuItem sid="item2" start="no" />
17  <menuItem sid="item3" start="no" />
18  <menu sid="mymenu" start="yes" />
19  <menuItem sid="actionQuit" start="no" />
20  </registry>
21 </service>

This method analyzes the gui section of the configuration.

  • <layout> (mandatory) : give the list of the menu item that will appear in the menu.
  • <menuItem name="My item 1" shortcut="1" style="check" specialAction="NEW" /> :
    • name (mandatory) : give the name of the menu item that will appear in the interface.
    • shortcut : give the shortcut for this menu item.
    • style {check|radio} : give the style of the menu item.
    • specialAction {DEFAULT | QUIT | NEW | ABOUT | HELP}: specify a pre define action. If it isn't define the value is DEFAULT.
      • icon : give the path of the icon file
  • <menu name="My menu" /> :
    • name (mandatory) : give the name of the menu that will appear in the interface.
  • <separator/> : allow to divide the menu by part (draw a line).

Definition at line 32 of file IMenuLayoutManager.cpp.

References m_actionInfo, OSLM_ASSERT, OSLM_FATAL, and SLM_ASSERT.


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