fw4spl
fwGui::registrar::MenuBarRegistrar Class Reference

Defines the menuBar registrar for IHM. More...

#include <MenuBarRegistrar.hpp>

+ Inheritance diagram for fwGui::registrar::MenuBarRegistrar:
+ Collaboration diagram for fwGui::registrar::MenuBarRegistrar:

Public Member Functions

virtual bool isA (const std::string &type) const override
 
FWGUI_API MenuBarRegistrar (const std::string &sid)
 Constructor.
 
virtual FWGUI_API ~MenuBarRegistrar ()
 Destructor. Do nothing.
 
virtual FWGUI_API::fwGui::container::fwMenuBar::sptr getParent ()
 Return the parent container.
 
virtual FWGUI_API::fwGui::container::fwMenu::sptr getFwMenu (std::string menuSid, std::vector< ::fwGui::container::fwMenu::sptr > menus)
 Return the fwMenu associated with the menuSid. More...
 
virtual FWGUI_API void initialize (::fwRuntime::ConfigurationElement::sptr configuration)
 Initialize registry managers. More...
 
virtual FWGUI_API void manage (std::vector< ::fwGui::container::fwMenu::sptr > menus)
 Starting menu bar registrar. All services managed in local menus and with start="yes" in configuration will be started. More...
 
virtual FWGUI_API void unmanage ()
 Stopping view manager. All services managed in local menus will be stopped.
 
- Public Member Functions inherited from fwGui::GuiBaseObject
- Public Member Functions inherited from fwCore::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
 

Protected Types

typedef ::fwRuntime::ConfigurationElement::sptr ConfigurationType
 
typedef std::map< std::string, std::pair< unsigned int, bool > > SIDMenuMapType
 

Protected Attributes

SIDMenuMapType m_menuSids
 All menu services ID managed and associated with pair containing: menu's index vector and boolean describing if is started by the manager.
 
std::string m_sid
 Main service ID associate with this MenuBarRegistrar.
 

Friends

template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Demangling methods

virtual const std::string & getLeafClassname () const override
 return object's classname without its namespace, i.e. BaseObject
 
virtual const std::string & getClassname () const override
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
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
 

Additional Inherited Members

- Public Types inherited from fwGui::GuiBaseObject
typedef ::fwGui::factory::Key Key
 
- Protected Member Functions inherited from fwGui::GuiBaseObject
 GuiBaseObject ()
 
virtual ~GuiBaseObject ()
 

Detailed Description

Defines the menuBar registrar for IHM.

Date
2009-2010.

Definition at line 29 of file MenuBarRegistrar.hpp.

Member Function Documentation

fwGui::container::fwMenu::sptr fwGui::registrar::MenuBarRegistrar::getFwMenu ( std::string  menuSid,
std::vector< ::fwGui::container::fwMenu::sptr >  menus 
)
virtual

Return the fwMenu associated with the menuSid.

Parameters
menuSidsid of the menu service
menusvector containing the fwMenu manages by this registrar.

Definition at line 45 of file MenuBarRegistrar.cpp.

References m_menuSids, and SLM_ASSERT.

void fwGui::registrar::MenuBarRegistrar::initialize ( ::fwRuntime::ConfigurationElement::sptr  configuration)
virtual

Initialize registry managers.

Example of configuration

1 <service uid="menuBar" type="::fwGui::IMenuBarSrv" impl="::gui::aspect::SDefaultMenuBar" autoConnect="no" >
2  <gui>
3  <layout>
4  <menu name="My Menu"/>
5  <menu name="My Menu 2"/>
6  </layout>
7  </gui>
8  <registry>
9  <menu sid="myMenu" start="yes" />
10  <menu sid="myMenu2" start="yes" />
11  </registry>
12 </service>

This method analyzes the registry section of the configuration.

  • <menu sid="myMenu" start="yes" /> : define the service of the menu to add in the menu bar.
    • sid (mandatory): the service identifier.
    • start = {yes| no} (default value no): indicate if the service must be started by the menu bar service.

Definition at line 55 of file MenuBarRegistrar.cpp.

References m_menuSids, OSLM_ASSERT, and SLM_ASSERT.

void fwGui::registrar::MenuBarRegistrar::manage ( std::vector< ::fwGui::container::fwMenu::sptr >  menus)
virtual

Starting menu bar registrar. All services managed in local menus and with start="yes" in configuration will be started.

Precondition
MenuBarRegistrar must be initialized before.
sub menus must be instanced before.

Definition at line 87 of file MenuBarRegistrar.cpp.

References fwGui::GuiRegistry::actionServiceStopping(), fwTools::fwID::exist(), fwServices::get(), m_menuSids, OSLM_ASSERT, and fwGui::GuiRegistry::registerSIDMenu().

+ Here is the call graph for this function:


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