ACF $AcfVersion:0$
CCommandBasedSelectionControllerComp.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
14
15
16namespace iqtgui
17{
18
19
25 public QObject,
26 public iqtgui::TDesignSchemaHandlerWrap<ibase::TLocalizableWrap<icomp::CComponentBase>>,
27 protected imod::TSingleModelObserverBase<iprm::ISelectionParam>,
28 virtual public ibase::ICommandsProvider
29{
30 Q_OBJECT
31public:
34
35 I_BEGIN_COMPONENT(CCommandBasedSelectionControllerComp);
36 I_REGISTER_INTERFACE(ibase::ICommandsProvider);
37 I_ASSIGN(m_commandSelectionCompPtr, "CommandsSelection", "Commands selector and contstraints provider", true, "CommandsSelection");
38 I_ASSIGN_TO(m_commandSelectionModelCompPtr, m_commandSelectionCompPtr, true);
39 I_ASSIGN(m_actionIconsProviderCompPtr, "ActionIcons", "Icons for the region actions", false, "ActionIcons");
40 I_ASSIGN(m_noSelectionCommandAttrPtr, "UnselectActionName", "The name of the unselect action", false, "Deselect");
41 I_ASSIGN(m_menuNameAttrPtr, "MenuName", "Name of the menu for the action group", true, "Selection");
42 I_ASSIGN(m_menuDescriptionAttrPtr, "MenuDescription", "Description for the action group", true, "");
43 I_ASSIGN(m_rootMenuNameAttrPtr, "RootMenu", "Name of the root command", true, "");
44 I_ASSIGN(m_showInToolBarAttrPtr, "ShowInToolBar", "If enabled, the action will be shown in the application's tool bar", false, false);
45 I_ASSIGN(m_commandPriorityAttrPtr, "CommandPriority", "Defines the used command priority for the menu", true, 100);
46 I_END_COMPONENT;
47
49
50 // reimpemented (ibase::ICommandsProvider)
51 virtual const ibase::IHierarchicalCommand* GetCommands() const override;
52
53protected:
54 // reimplemented (iqtgui::TDesignSchemaHandlerWrap)
55 virtual void OnDesignSchemaChanged(const QByteArray& themeId) override;
56
57 // reimplemented (ibase::TLocalizableWrap)
58 virtual void OnLanguageChanged() override;
59
60 // reimpemented (imod::CSingleModelObserverBase)
61 virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet) override;
62
63 // reimpemented (icomp::IComponent)
64 virtual void OnComponentCreated() override;
65 virtual void OnComponentDestroyed() override;
66
67private Q_SLOTS:
68 void OnCommandActivated();
69
70private:
71 void BuildCommands();
72
73protected:
74 I_REF(iprm::ISelectionParam, m_commandSelectionCompPtr);
75 I_REF(imod::IModel, m_commandSelectionModelCompPtr);
76 I_REF(iqtgui::IIconProvider, m_actionIconsProviderCompPtr);
77 I_TEXTATTR(m_noSelectionCommandAttrPtr);
78 I_TEXTATTR(m_menuNameAttrPtr);
79 I_TEXTATTR(m_menuDescriptionAttrPtr);
80 I_TEXTATTR(m_rootMenuNameAttrPtr);
81 I_ATTR(bool, m_showInToolBarAttrPtr);
82 I_ATTR(int, m_commandPriorityAttrPtr);
83
87};
88
89
90} // namespace iqtgui
91
92
Interface for a provider of the heriarchical commands.
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:25
Basic implementation for a single model observer with binding to concrete data object interface.
Interface allowing to select single option from list of options.
Command-based selection parameter (iprm::ISelectionParam) controller.
virtual void OnComponentDestroyed() override
imod::TSingleModelObserverBase< iprm::ISelectionParam > BaseClass2
iqtgui::TDesignSchemaHandlerWrap< ibase::TLocalizableWrap< icomp::CComponentBase > > BaseClass
virtual const ibase::IHierarchicalCommand * GetCommands() const override
Get list of menu commands.
I_TEXTATTR(m_noSelectionCommandAttrPtr)
virtual void OnUpdate(const istd::IChangeable::ChangeSet &changeSet) override
Called on update of observed model.
virtual void OnDesignSchemaChanged(const QByteArray &themeId) override
Implementation of hierarchical command based on QAction from Qt.
This interface provides acces to an icon.
Set of change flags (its IDs).
Definition IChangeable.h:36
Common interface to define the hierarchical graph structures.
Standard GUI specific interfaces and components based on Qt.