ACF $AcfVersion:0$
CComposedParamsSetGuiComp.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>
13#include <iqt2d/IViewExtender.h>
14#include <iview/IShapeFactory.h>
15
16
17#include <GeneratedFiles/iqtprm/ui_CComposedParamsSetGuiComp.h>
18
19
20namespace iqtprm
21{
22
23
25 public iqtgui::TDesignerGuiObserverCompBase<Ui::CComposedParamsSetGuiComp, iprm::IParamsSet>,
26 virtual public iqt2d::IViewExtender,
27 virtual public iview::IShapeFactory
28{
29 Q_OBJECT
30
31public:
33
40
41 I_BEGIN_COMPONENT(CComposedParamsSetGuiComp);
42 I_REGISTER_INTERFACE(iqt2d::IViewExtender);
43 I_ASSIGN_MULTI_0(m_editorsCompPtr, "Editors", "List of GUI's for parameters edition", true);
44 I_ASSIGN_TO(m_guisCompPtr, m_editorsCompPtr, true);
45 I_ASSIGN_TO(m_observersCompPtr, m_editorsCompPtr, true);
46 I_ASSIGN_TO(m_extendersCompPtr, m_editorsCompPtr, false);
47 I_ASSIGN_TO(m_shapeFactoriesCompPtr, m_editorsCompPtr, false);
48 I_ASSIGN(m_paramsLoaderCompPtr, "ParamsLoader", "Loader for the parameter set", false, "ParamsLoader");
49 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);
50 I_ASSIGN_MULTI_0(m_namesAttrPtr, "Names", "List of of gui names", false);
51 I_ASSIGN(m_useHorizontalLayoutAttrPtr, "UseHorizontalLayout", "Use horizontal layout", true, false);
52 I_ASSIGN(m_useVerticalSpacerAttrPtr, "UseVerticalSpacer", "Use vertical spacer to keep inserted objects in place", true, false);
53 I_ASSIGN(m_showAllShapesAttrPtr, "ShowAllShapes", "If true all shapes, also generated by inactive GUI, will be shown", true, false);
54 I_ASSIGN(m_designTypeAttrPtr, "DesignType", "Type of design:\n* 0 - simple\n* 1 - tool box\n* 2 - tab", true, DT_SIMPLE);
55 I_ASSIGN(m_tabOrientationAttrPtr, "TabBarOrientation", "Orientation of the tab bar for tab design\n 0 - North\n 1 - South\n 2 - West\n 3 - East", true, 0);
56 I_END_COMPONENT;
57
59
60 // reimplemented (imod::IModelEditor)
61 virtual void UpdateEditor(const istd::IChangeable::ChangeSet& changeSet) override;
62
63 // reimplemented (iqtgui::CGuiComponentBase)
64 virtual void OnGuiCreated() override;
65 virtual void OnGuiDestroyed() override;
66 virtual void OnGuiRetranslate() override;
67
68 // reimplemented (iqt2d::IViewExtender)
69 virtual void AddItemsToScene(iqt2d::IViewProvider* providerPtr, int flags) override;
70 virtual void RemoveItemsFromScene(iqt2d::IViewProvider* providerPtr) override;
71
72 // reimplemented (iview::IShapeFactory)
73 virtual iview::IShape* CreateShape(const istd::IChangeable* objectPtr, bool connectToModel = false) const override;
74
75protected:
76 void AttachToScene(iqt2d::IViewProvider* providerPtr, int flags);
78
79 // reimplemented (iqtgui::TGuiObserverWrap)
80 virtual void OnGuiModelAttached() override;
81 virtual void OnGuiModelDetached() override;
82 virtual void UpdateModel() const override;
83
84 QList<imod::IModelEditor*> GetModelEditors() const;
85 QList<QByteArray> GetIds() const;
86
87protected Q_SLOTS:
88 void OnEditorChanged(int index);
91
92private:
93 I_MULTIREF(imod::IModelEditor, m_editorsCompPtr);
94 I_MULTIREF(iqtgui::IGuiObject, m_guisCompPtr);
95 I_MULTIREF(imod::IObserver, m_observersCompPtr);
96 I_MULTIREF(iqt2d::IViewExtender, m_extendersCompPtr);
97 I_MULTIREF(iview::IShapeFactory, m_shapeFactoriesCompPtr);
98 I_REF(ifile::IFilePersistence, m_paramsLoaderCompPtr);
99 I_MULTIATTR(QByteArray, m_idsAttrPtr);
100 I_MULTITEXTATTR(m_namesAttrPtr);
101 I_ATTR(bool, m_useHorizontalLayoutAttrPtr);
102 I_ATTR(bool, m_useVerticalSpacerAttrPtr);
103 I_ATTR(bool, m_showAllShapesAttrPtr);
104 I_ATTR(int, m_designTypeAttrPtr);
105 I_ATTR(int, m_tabOrientationAttrPtr);
106 I_ATTR(bool, m_flatViewAttrPtr);
107
108 typedef QMap<imod::IModelEditor*, bool> ConnectedEditorsMap;
109 ConnectedEditorsMap m_connectedEditorsMap;
110
111 int m_currentGuiIndex;
112
113 typedef QMap<iqt2d::IViewProvider*, int> ConnectedSceneFlags; // maps connected scene provider to connection flags
114 ConnectedSceneFlags m_connectedSceneFlags;
115
119 QWidget* m_guiContainerPtr;
120 struct PanelData
121 {
122 PanelData()
123 {
124 pagePtr = NULL;
125 paramWidgetPtr = NULL;
126 }
127 QWidget* pagePtr;
128 QWidget* paramWidgetPtr;
129 };
130 QMap<iqtgui::IGuiObject*, PanelData> m_guiToWidgetMap;
131};
132
133
134} // namespace iqtprm
135
136
137
138
Interface providing loading and saving of data objects.
Common interface for an model editor.
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition IObserver.h:156
Interface for GUI objects presenting its results using extern view objects.
Interface for GUI objects managing view.
Common interface for GUI objects used in ACF component context.
Definition IGuiObject.h:133
Base class for all Qt GUI components.
virtual void UpdateModel() const override
QList< QByteArray > GetIds() const
virtual void OnGuiRetranslate() override
virtual iview::IShape * CreateShape(const istd::IChangeable *objectPtr, bool connectToModel=false) const override
Create a graphical representation of the given 2D-object object.
virtual void OnGuiDestroyed() override
virtual void AddItemsToScene(iqt2d::IViewProvider *providerPtr, int flags) override
Called when items should be added to specified scene.
virtual void OnGuiCreated() override
QList< imod::IModelEditor * > GetModelEditors() const
virtual void OnGuiModelDetached() override
void AttachToScene(iqt2d::IViewProvider *providerPtr, int flags)
virtual void OnGuiModelAttached() override
iqtgui::TDesignerGuiObserverCompBase< Ui::CComposedParamsSetGuiComp, iprm::IParamsSet > BaseClass
virtual void RemoveItemsFromScene(iqt2d::IViewProvider *providerPtr) override
Called when items should be removed from specified scene.
void DetachFromScene(iqt2d::IViewProvider *providerPtr)
virtual void UpdateEditor(const istd::IChangeable::ChangeSet &changeSet) override
Set of change flags (its IDs).
Definition IChangeable.h:36
Common interface for data model objects, which can be changed.
Definition IChangeable.h:28
Interface for creation of visualization shapes of some geometrical object.
Common interface for all display console shapes.
Definition IShape.h:32
#define I_MULTITEXTATTR(member)
Declare translatable multiple text attribute member.
#define NULL
Definition istd.h:74
This package contains Qt based implementations of standard parameter components.