ACF $AcfVersion:0$
CCommandsToolBarGuiComp.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
11
12
13namespace iqtgui
14{
15
16
22 virtual public ibase::ICommandsDisplayer,
23 protected imod::TSingleModelObserverBase<ibase::ICommandsProvider>
24{
25public:
27
28 I_BEGIN_COMPONENT(CCommandsToolBarGuiComp);
29 I_REGISTER_INTERFACE(iqtgui::IMainWindowComponent);
30 I_REGISTER_INTERFACE(ibase::ICommandsDisplayer);
31 I_ASSIGN(m_slaveCommandsDisplayerCompPtr, "SlaveCommandsDisplayer", "Commands will be forwarded here as well", false, "");
32 I_ASSIGN(m_commandsProviderCompPtr, "CommandsProvider", "Commands for the tool bar", false, "CommandsProvider");
33 I_ASSIGN_TO(m_commandsProviderModelCompPtr, m_commandsProviderCompPtr, false);
34 I_END_COMPONENT;
35
36 // reimplemented (ibase::ICommandsDisplayer)
37 virtual void ShowCommands(const ibase::ICommandsProvider* commandsProvider) override;
38
39protected:
40 // reimplemented (imod::TSingleModelObserverBase)
41 virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet) override;
42
43 // reimplemented (CGuiComponentBase)
44 virtual void OnGuiCreated() override;
45 virtual void OnGuiDestroyed() override;
46
47private:
48 void UpdateCommands();
49
50private:
51 I_REF(ibase::ICommandsDisplayer, m_slaveCommandsDisplayerCompPtr);
52 I_REF(ibase::ICommandsProvider, m_commandsProviderCompPtr);
53 I_REF(imod::IModel, m_commandsProviderModelCompPtr);
54
55 iqtgui::CHierarchicalCommand m_toolBarCommands;
56};
57
58
59} // namespace iqtgui
60
61
62
63
Interface for a displayer of the hierarchical commands.
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.
Component for construction of a tool bar for a given commands provider.
virtual void OnGuiCreated() override
Called just after GUI is initialized.
virtual void ShowCommands(const ibase::ICommandsProvider *commandsProvider) override
virtual void OnUpdate(const istd::IChangeable::ChangeSet &changeSet) override
Called on update of observed model.
virtual void OnGuiDestroyed() override
Called just before GUI is released.
Implementation of hierarchical command based on QAction from Qt.
Basic implementation of a tool bar component.
A common interface for main window component such as dock widget, tool bar and so on.
Set of change flags (its IDs).
Definition IChangeable.h:36
Standard GUI specific interfaces and components based on Qt.