CCommandsMultiplexerComp.h
Go to the documentation of this file.
1 #ifndef iqtgui_CCommandsMultiplexerComp_included
2 #define iqtgui_CCommandsMultiplexerComp_included
3 
4 
5 // ACF includes
7 #include <icomp/CComponentBase.h>
9 #include <iprm/ISelectionParam.h>
10 
11 
12 namespace iqtgui
13 {
14 
15 
20  public QObject,
21  public icomp::CComponentBase,
22  protected imod::CModelUpdateBridge,
23  virtual public ibase::ICommandsProvider
24 {
25 public:
28 
29  I_BEGIN_COMPONENT(CCommandsMultiplexerComp);
30  I_REGISTER_INTERFACE(ibase::ICommandsProvider);
31  I_ASSIGN(m_commandSelectionCompPtr, "CommandSelector", "Commands selector", true, "CommandSelector");
32  I_ASSIGN_TO(m_commandSelectionModelCompPtr, m_commandSelectionCompPtr, true);
33  I_ASSIGN_MULTI_0(m_commandProvidersCompPtr, "CommandProviders", "List if underlaying command providers", true);
34  I_ASSIGN_TO(m_commandProviderModelsCompPtr, m_commandProvidersCompPtr, false);
35  I_END_COMPONENT;
36 
38 
39  // reimpemented (ibase::ICommandsProvider)
40  virtual const ibase::IHierarchicalCommand* GetCommands() const;
41 
42 protected:
43  // reimplemented (imod::IObserver)
44  virtual void BeforeUpdate(imod::IModel* modelPtr);
45  virtual void AfterUpdate(imod::IModel* modelPtr, const istd::IChangeable::ChangeSet& changeSet);
46 
47  // reimpemented (icomp::CComponentBase)
48  virtual void OnComponentCreated();
49  virtual void OnComponentDestroyed();
50 
51 private:
52  I_REF(iprm::ISelectionParam, m_commandSelectionCompPtr);
53  I_REF(imod::IModel, m_commandSelectionModelCompPtr);
54  I_MULTIREF(ibase::ICommandsProvider, m_commandProvidersCompPtr);
55  I_MULTIREF(imod::IModel, m_commandProviderModelsCompPtr);
56 };
57 
58 
59 } // namespace iqtgui
60 
61 
62 #endif // !iqtgui_CCommandsMultiplexerComp_included
63 
64 
virtual void BeforeUpdate(imod::IModel *modelPtr)
This function will be called before update of the observer contents occures.
virtual const ibase::IHierarchicalCommand * GetCommands() const
Get list of menu commands.
Base class for component implementation.
Interface for a provider of the heriarchical commands.
Common interface to define the hierarchical graph structures.
Reflects the changes of observed objects as changes of some other object (over istd::IChangeable), typically delegated to itself.
virtual void AfterUpdate(imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet)
This function will be called after update of the observer contents occures.
Common interface for model objects, that supports Model/Observer design pattern.
Definition: IModel.h:23
Set of change flags (its IDs).
Definition: IChangeable.h:30
Interface allowing to select single option from list of options.
Command multipling component.

© 2007-2017 Witold Gantzke and Kirill Lepskiy