fw4spl
fwGui::registrar::ViewRegistrar Class Reference

Defines the generic view manager for IHM. More...

#include <ViewRegistrar.hpp>

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

Public Member Functions

virtual bool isA (const std::string &type) const override
 
FWGUI_API ViewRegistrar (const std::string &sid)
 Constructor.
 
virtual FWGUI_API ~ViewRegistrar ()
 Destructor. Do nothing.
 
virtual FWGUI_API std::shared_ptr< ::fwGui::container::fwContainergetParent ()
 
virtual FWGUI_API void setParent (std::string wid)
 
virtual FWGUI_API void initialize (::fwRuntime::ConfigurationElement::sptr configuration)
 Initialize managers. More...
 
virtual FWGUI_API void manage (std::vector< std::shared_ptr< ::fwGui::container::fwContainer > > subViews)
 Starting view manager. All services managed in local subViews and with start="yes" in configuration will be started. More...
 
virtual FWGUI_API void manageMenuBar (std::shared_ptr< ::fwGui::container::fwMenuBar > menuBar)
 Register menu bar. If start="yes" in configuration the menu bar services will be started.
 
virtual FWGUI_API void manageToolBar (std::shared_ptr< ::fwGui::container::fwToolBar > toolBar)
 Register tool bar. If start="yes" in configuration the tool bar services will be started.
 
virtual FWGUI_API void unmanage ()
 Stopping view manager. All services managed in local subViews will be stopped.
 
virtual FWGUI_API void unmanageToolBar ()
 Stopping view manager. ToolBar service will be stopped.
 
virtual FWGUI_API void unmanageMenuBar ()
 Stopping view manager. MenuBar service 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 > > SIDContainerMapType
 
typedef std::map< std::string, unsigned int > WIDContainerMapType
 
typedef std::pair< std::string, bool > SIDMenuBarPairType
 
typedef std::pair< std::string, bool > SIDToolBarPairType
 

Protected Attributes

SIDContainerMapType m_sids
 All services ID managed and associated with pair containing: subViews index vector and boolean describing if is started by the manager.
 
WIDContainerMapType m_wids
 All windows containers ID managed (and associated with subViews index vector).
 
SIDMenuBarPairType m_menuBarSid
 Menu bar service ID associate with this ViewRegistrar.
 
SIDToolBarPairType m_toolBarSid
 Tool bar service ID associate with this ViewRegistrar.
 
std::string m_parentWid
 
std::shared_ptr< ::fwGui::container::fwContainerm_parentContainer
 
std::string m_sid
 Main service ID associate with this ViewRegistrar.
 

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 generic view manager for IHM.

Definition at line 33 of file ViewRegistrar.hpp.

Member Function Documentation

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

Initialize managers.

Example of configuration

1 <service uid="subView1" type="::gui::view::SDefaultView" autoConnect="no" >
2  <gui>
3  <layout type="::fwGui::LineLayoutManager" >
4  <orientation value="horizontal" />
5  <view caption="view3" />
6  <view caption="view4" />
7  <view caption="view5" />
8  </layout>
9  <toolBar />
10  <menuBar />
11  </gui>
12  <registry>
13  <parent wid="myView" />
14  <toolBar sid="toolbar" start="yes" />
15  <menuBar sid="menubar" start="yes" />
16  <view sid="subView3" start="yes" />
17  <view wid="subView4" />
18  <view wid="subView5" />
19  </registry>
20 </service>
  • <parent wid="myView" /> : This section isn't mandatory. When the parent section is present, the wid attribute is used to find its parent container. Otherwise, the service uid is used to find its parent container.
  • <toolBar sid="toolbar1" start="yes" /> : This section isn't mandatory.
    • sid (mandatory): the tool bar identifier.
    • start = {yes| no} (default value no): indicate if the tool bar service must be started by the service.
  • <menuBar sid="menubar1" start="yes" /> : This section isn't mandatory.
    • sid (mandatory): the menu bar identifier.
    • start = {yes| no} (default value no): indicate if the menu bar service must be started by the service.
  • <view sid="subView3" start="yes" /> : define the service of the view to add in the container.
    • sid (mandatory): the service identifier.
    • start = {yes| no} (default value no): indicate if the view service must be started by the service.
  • <view wid="subView4" /> : reserve a sub container for the view in the parent container with the name "subView4". The service which want to use this sub container will have define a parent with <parent wid="subView4" />.
    • wid (mandatory): the window identifier.
Warning
  • The number of view item in the gui section must be equal or greater than in the registry section.
  • The order of the view in each section (gui and registry) must be the same.
    For example: the view caption "view3" will be connected with the service which have the sid = "subView3" (It could also be a wid).

Definition at line 67 of file ViewRegistrar.cpp.

References m_menuBarSid, m_sids, m_toolBarSid, m_wids, OSLM_ASSERT, and SLM_ASSERT.

void fwGui::registrar::ViewRegistrar::manage ( std::vector< std::shared_ptr< ::fwGui::container::fwContainer > >  subViews)
virtual

Starting view manager. All services managed in local subViews and with start="yes" in configuration will be started.

Precondition
ViewRegistrar must be initialized before.
sub containers must be instanced before.

Definition at line 156 of file ViewRegistrar.cpp.

References fwTools::fwID::exist(), m_sids, m_wids, OSLM_ASSERT, fwGui::GuiRegistry::registerSIDContainer(), fwGui::GuiRegistry::registerWIDContainer(), and SLM_TRACE.

+ Here is the call graph for this function:


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