ACF $AcfVersion:0$
CExtComposedParamsSetGuiComp.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// Qt includes
6#include <QtCore/QString>
7#include <QtCore/QSet>
8
9// ACF includes
11#include <iprm/IParamsSet.h>
14#include <iqt2d/IViewExtender.h>
15#include <iqtprm/iqtprm.h>
16
17
18namespace iqtprm
19{
20
21
27 iqtgui::CComposedGuiComp, imod::TSingleModelObserverBase<iprm::IParamsSet> >,
29{
30public:
33
34 I_BEGIN_COMPONENT(CExtComposedParamsSetGuiComp);
35 I_REGISTER_INTERFACE(iqt2d::IViewExtender);
36 I_REGISTER_INTERFACE(imod::IModelEditor);
37 I_ASSIGN_MULTI_0(m_editorsCompPtr, "Editors", "List of GUI's for parameters edition", true);
38 I_ASSIGN_TO(m_observersCompPtr, m_editorsCompPtr, true);
39 I_ASSIGN_TO(m_extendersCompPtr, m_editorsCompPtr, false);
40 I_ASSIGN_MULTI_0(m_idsAttrPtr, "Ids", "List of parameter ID's according to defined editors, if ID equals '*' then the observed parameter set will be used, if it is empty than only GUI will be shown, but no parameter will be connected", true);
41 I_ASSIGN(m_showAllShapesAttrPtr, "ShowAllShapes", "If true all shapes, also generated by inactive GUI, will be shown", true, false);
42 I_END_COMPONENT;
43
44 // reimplemented (imod::IModelEditor)
45 virtual void UpdateEditor(const istd::IChangeable::ChangeSet& changeSet) override;
46 virtual void SetReadOnly(bool state) override;
47
48 // reimplemented (iqtgui::CGuiComponentBase)
49 virtual void OnGuiCreated() override;
50 virtual void OnGuiDestroyed() override;
51
52 // reimplemented (iqt2d::IViewExtender)
53 virtual void AddItemsToScene(iqt2d::IViewProvider* providerPtr, int flags) override;
54 virtual void RemoveItemsFromScene(iqt2d::IViewProvider* providerPtr) override;
55
56protected:
57 void AttachToScene(iqt2d::IViewProvider* providerPtr, int flags);
59
60 // reimplemented (iqtgui::CMultiPageGuiCompBase)
61 virtual void CreatePages() override;
62 virtual void OnPageChanged(int widgetIndex) override;
63
64 // reimplemented (iqtgui::TGuiObserverWrap)
65 virtual void OnGuiModelAttached() override;
66 virtual void OnGuiModelDetached() override;
67 virtual void UpdateModel() const override;
68
69private:
70 I_MULTIREF(imod::IModelEditor, m_editorsCompPtr);
71 I_MULTIREF(imod::IObserver, m_observersCompPtr);
72 I_MULTIREF(iqt2d::IViewExtender, m_extendersCompPtr);
73 I_MULTIATTR(QByteArray, m_idsAttrPtr);
74 I_MULTITEXTATTR(m_namesAttrPtr);
75 I_ATTR(bool, m_showAllShapesAttrPtr);
76
77 typedef QMap<imod::IModelEditor*, bool> ConnectedEditorsMap;
78 ConnectedEditorsMap m_connectedEditorsMap;
79
80 typedef QMap<iqt2d::IViewProvider*, int> ConnectedSceneFlags; // maps connected scene provider to connection flags
81 ConnectedSceneFlags m_connectedSceneFlags;
82};
83
84
85} // namespace iqtprm
86
87
88
89
Common interface for an model editor.
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition IObserver.h:156
Basic implementation for a single model observer with binding to concrete data object interface.
Interface for GUI objects presenting its results using extern view objects.
Interface for GUI objects managing view.
Component for the layouting/grouping of the UI-subcomponents.
Join functionality of iqtgui::IGuiObject interface and imod::IObserver.
New version of parameter set UI based on standard multi page UI concept.
virtual void CreatePages() override
Create all container pages.
void AttachToScene(iqt2d::IViewProvider *providerPtr, int flags)
iqtgui::TGuiObserverWrap< iqtgui::CComposedGuiComp, imod::TSingleModelObserverBase< iprm::IParamsSet > > BaseClass
virtual void UpdateModel() const override
Do update of the model to reflect the current contents of GUI.
virtual void RemoveItemsFromScene(iqt2d::IViewProvider *providerPtr) override
Called when items should be removed from specified scene.
virtual void OnGuiDestroyed() override
Called just before GUI is released.
virtual void OnPageChanged(int widgetIndex) override
virtual void SetReadOnly(bool state) override
Set flag that the model data can be changed.
virtual void OnGuiModelAttached() override
Called when model is attached and GUI is created.
virtual void AddItemsToScene(iqt2d::IViewProvider *providerPtr, int flags) override
Called when items should be added to specified scene.
virtual void OnGuiCreated() override
Called just after GUI is initialized.
virtual void UpdateEditor(const istd::IChangeable::ChangeSet &changeSet) override
Updates editor with model data.
virtual void OnGuiModelDetached() override
Called when model is detached or GUI is destroyed.
void DetachFromScene(iqt2d::IViewProvider *providerPtr)
Set of change flags (its IDs).
Definition IChangeable.h:36
#define I_MULTITEXTATTR(member)
Declare translatable multiple text attribute member.
This package contains Qt based implementations of standard parameter components.