ICF 3.1.1.10
Technical documentation of ICF Libraries
CCommandBasedSelectionControllerComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef iqtgui_CCommandBasedSelectionControllerComp_included
7#define iqtgui_CCommandBasedSelectionControllerComp_included
8
9
10// ICF includes
18
19
20namespace istdgui
21{
22
23
29 public QObject,
30 public ibase::TVisualChangesHandlerWrap<icomp::CComponentBase>,
31 protected imod::TSingleModelObserverBase<iprm::ISelectionParam>,
32 virtual public ibase::ICommandsProvider
33{
34 Q_OBJECT
35public:
38
39 I_BEGIN_COMPONENT(CCommandBasedSelectionControllerComp);
40 I_REGISTER_INTERFACE(ibase::ICommandsProvider);
41 I_ASSIGN(m_commandSelectionCompPtr, "CommandsSelection", "Commands selector and contstraints provider", true, "CommandsSelection");
42 I_ASSIGN_TO(m_commandSelectionModelCompPtr, m_commandSelectionCompPtr, true);
43 I_ASSIGN(m_actionIconsProviderCompPtr, "ActionIcons", "Icons for the region actions", false, "ActionIcons");
44 I_ASSIGN(m_noSelectionCommandAttrPtr, "UnselectActionName", "The name of the unselect action", false, "Deselect");
45 I_ASSIGN(m_menuNameAttrPtr, "MenuName", "Name of the menu for the action group", true, "Selection");
46 I_ASSIGN(m_menuDescriptionAttrPtr, "MenuDescription", "Description for the action group", true, "");
47 I_ASSIGN(m_rootMenuNameAttrPtr, "RootMenu", "Name of the root command", true, "");
48 I_ASSIGN(m_showInToolBarAttrPtr, "ShowInToolBar", "If enabled, the action will be shown in the application's tool bar", false, false);
49 I_ASSIGN(m_commandPriorityAttrPtr, "CommandPriority", "Defines the used command priority for the menu", true, 100);
50 I_END_COMPONENT;
51
53
54 // reimpemented (ibase::ICommandsProvider)
56
57protected:
58 // reimplemented (ibase::TVisualChangesHandlerWrap)
59 void OnLanguageChanged() override;
60
61 // reimpemented (imod::CSingleModelObserverBase)
62 void OnUpdate(const istd::IChangeable::ChangeSet& changeSet) override;
63
64 // reimpemented (icomp::IComponent)
65 void OnComponentCreated() override;
66 void OnComponentDestroyed() override;
67
68private Q_SLOTS:
69 void OnCommandActivated();
70
71private:
72 void BuildCommands();
73
74protected:
75 I_REF(iprm::ISelectionParam, m_commandSelectionCompPtr);
76 I_REF(imod::IModel, m_commandSelectionModelCompPtr);
77 I_REF(istdgui::IIconProvider, m_actionIconsProviderCompPtr);
78 I_TEXTATTR(m_noSelectionCommandAttrPtr);
79 I_TEXTATTR(m_menuNameAttrPtr);
80 I_TEXTATTR(m_menuDescriptionAttrPtr);
81 I_TEXTATTR(m_rootMenuNameAttrPtr);
82 I_ATTR(bool, m_showInToolBarAttrPtr);
83 I_ATTR(int, m_commandPriorityAttrPtr);
84
88};
89
90
91} // namespace istdgui
92
93
94#endif // !iqtgui_CCommandBasedSelectionControllerComp_included
95
96
Interface for a provider of the heriarchical commands.
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:29
Basic implementation for a single model observer with binding to concrete data object interface.
Interface allowing to select single option from list of options.
Set of change flags (its IDs).
Definition IChangeable.h:38
Common interface to define the hierarchical graph structures.
Command-based selection parameter (iprm::ISelectionParam) controller.
imod::TSingleModelObserverBase< iprm::ISelectionParam > BaseClass2
void OnUpdate(const istd::IChangeable::ChangeSet &changeSet) override
Called on update of observed model.
ibase::TVisualChangesHandlerWrap< icomp::CComponentBase > BaseClass
const ibase::IHierarchicalCommand * GetCommands() const override
Get list of menu commands.
Implementation of hierarchical command based on QAction from Qt.
This interface provides acces to an icon.
Standard GUI specific interfaces and components based on Qt.

© Witold Gantzke and Kirill Lepskiy