fw4spl
|
Defines the menu registrar for IHM. More...
#include <MenuRegistrar.hpp>
Public Types | |
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 | MenuRegistrar (const std::string &sid) |
Constructor. | |
virtual FWGUI_API | ~MenuRegistrar () |
Destructor. Do nothing. | |
virtual FWGUI_API::fwGui::container::fwMenu::sptr | getParent () |
Return the parent container. | |
virtual FWGUI_API::fwGui::container::fwMenuItem::sptr | getFwMenuItem (std::string actionSid, std::vector< ::fwGui::container::fwMenuItem::sptr > menuItems) |
Return the fwMenuItem associated with the actionSid. More... | |
virtual FWGUI_API void | initialize (::fwRuntime::ConfigurationElement::sptr configuration) |
Initialize registry managers. More... | |
virtual FWGUI_API void | manage (std::vector< ::fwGui::container::fwMenuItem::sptr > menuItems) |
manages action service associated with menuItem of menu. More... | |
virtual FWGUI_API void | manage (std::vector< ::fwGui::container::fwMenu::sptr > menus) |
manages menu service associated with fwMenu of menu. More... | |
virtual FWGUI_API void | unmanage () |
Stopping menu items manager. All services managed in local menu items will be stopped. | |
virtual FWGUI_API void | onItemAction () |
This method is called when an action is clicked. | |
virtual CallbacksType | getCallbacks () |
Returns callbacks associate with menu items. | |
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_actionSids |
All menu services ID (sid) managed is associated with pair containing: an action's position in the menu and boolean describing if is started by the manager. | |
SIDMenuMapType | m_menuSids |
All toolBar 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 MenuRegistrar. | |
CallbacksType | m_callbacks |
Callback associate with menu items. | |
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 | |
Protected Member Functions inherited from fwGui::GuiBaseObject | |
GuiBaseObject () | |
virtual | ~GuiBaseObject () |
|
virtual |
Return the fwMenuItem associated with the actionSid.
actionSid | sid of the action service |
menuItems | vector containing the fwMenuItem manages by this registrar. |
Definition at line 46 of file MenuRegistrar.cpp.
References m_actionSids, and SLM_ASSERT.
|
virtual |
Initialize registry managers.
Example of configuration
This method analyzes the registry section of the configuration.
Definition at line 56 of file MenuRegistrar.cpp.
References m_actionSids, m_callbacks, m_menuSids, OSLM_ASSERT, and SLM_ASSERT.
|
virtual |
manages action service associated with menuItem of menu.
Register the menuItem containers for the associated services. Start the services if start=yes.
If a menuItem has attribut start="no", the associated action won't be started and the menuItem will be disabled. If a menuItem has attribut start="yes", two possibilities:
Definition at line 123 of file MenuRegistrar.cpp.
References fwGui::GuiRegistry::actionServiceStarting(), fwGui::GuiRegistry::actionServiceStopping(), fwTools::fwID::exist(), fwServices::get(), m_actionSids, m_sid, OSLM_ASSERT, and fwGui::GuiRegistry::registerActionSIDToParentSID().
|
virtual |
manages menu service associated with fwMenu of menu.
If a menuItem has attribut start="no", the associated menu won't be started. If a menuItem has attribut start="yes", the associated menu will be started
Definition at line 156 of file MenuRegistrar.cpp.
References fwTools::fwID::exist(), m_menuSids, OSLM_ASSERT, and fwGui::GuiRegistry::registerSIDMenu().