CComposedParamsSetGuiComp.h
Go to the documentation of this file.
1 #ifndef iqtprm_CComposedParamsSetGuiComp_included
2 #define iqtprm_CComposedParamsSetGuiComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QString>
7 #include <QtCore/QSet>
8 
9 // ACF includes
10 #include <ifile/IFilePersistence.h>
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 
20 namespace 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 
31 public:
33 
35  {
39  };
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);
62 
63  // reimplemented (iqtgui::CGuiComponentBase)
64  virtual void OnGuiCreated();
65  virtual void OnGuiDestroyed();
66 
67  // reimplemented (iqt2d::IViewExtender)
68  virtual void AddItemsToScene(iqt2d::IViewProvider* providerPtr, int flags);
69  virtual void RemoveItemsFromScene(iqt2d::IViewProvider* providerPtr);
70 
71  // reimplemented (iview::IShapeFactory)
72  virtual iview::IShape* CreateShape(const istd::IChangeable* objectPtr, bool connectToModel = false) const;
73 
74 protected:
75  void AttachToScene(iqt2d::IViewProvider* providerPtr, int flags);
76  void DetachFromScene(iqt2d::IViewProvider* providerPtr);
77 
78  // reimplemented (iqtgui::TGuiObserverWrap)
79  virtual void OnGuiModelAttached();
80  virtual void OnGuiModelDetached();
81  virtual void UpdateModel() const;
82 
83 protected Q_SLOTS:
84  void OnEditorChanged(int index);
87 
88 private:
89  I_MULTIREF(imod::IModelEditor, m_editorsCompPtr);
90  I_MULTIREF(iqtgui::IGuiObject, m_guisCompPtr);
91  I_MULTIREF(imod::IObserver, m_observersCompPtr);
92  I_MULTIREF(iqt2d::IViewExtender, m_extendersCompPtr);
93  I_MULTIREF(iview::IShapeFactory, m_shapeFactoriesCompPtr);
94  I_REF(ifile::IFilePersistence, m_paramsLoaderCompPtr);
95  I_MULTIATTR(QByteArray, m_idsAttrPtr);
96  I_MULTITEXTATTR(m_namesAttrPtr);
97  I_ATTR(bool, m_useHorizontalLayoutAttrPtr);
98  I_ATTR(bool, m_useVerticalSpacerAttrPtr);
99  I_ATTR(bool, m_showAllShapesAttrPtr);
100  I_ATTR(int, m_designTypeAttrPtr);
101  I_ATTR(int, m_tabOrientationAttrPtr);
102  I_ATTR(bool, m_flatViewAttrPtr);
103 
104  typedef QMap<imod::IModelEditor*, bool> ConnectedEditorsMap;
105  ConnectedEditorsMap m_connectedEditorsMap;
106 
107  int m_currentGuiIndex;
108 
109  typedef QMap<iqt2d::IViewProvider*, int> ConnectedSceneFlags; // maps connected scene provider to connection flags
110  ConnectedSceneFlags m_connectedSceneFlags;
111 
115  QWidget* m_guiContainerPtr;
116  QMap<iqtgui::IGuiObject*, QString> m_guiNames;
117 };
118 
119 
120 } // namespace iqtprm
121 
122 
123 #endif // !iqtprm_CComposedParamsSetGuiComp_included
124 
125 
Interface for GUI objects presenting its results using extern view objects.
Definition: IViewExtender.h:19
virtual iview::IShape * CreateShape(const istd::IChangeable *objectPtr, bool connectToModel=false) const
Create a graphical representation of the given 2D-object object.
iqtgui::TDesignerGuiObserverCompBase< Ui::CComposedParamsSetGuiComp, iprm::IParamsSet > BaseClass
virtual void OnGuiDestroyed()
Called just before GUI is released.
Common interface for an model editor.
Definition: IModelEditor.h:19
virtual void RemoveItemsFromScene(iqt2d::IViewProvider *providerPtr)
Called when items should be removed from specified scene.
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
virtual void UpdateModel() const
Do update of the model to reflect the current contents of GUI.
virtual void OnGuiModelDetached()
Called when model is detached or GUI is destroyed.
Common interface for all display console shapes.
Definition: IShape.h:27
Base class for all Qt GUI components.
Common interface for GUI objects using in component context.
Definition: IGuiObject.h:25
void DetachFromScene(iqt2d::IViewProvider *providerPtr)
Interface for creation of visualization shapes of some geometrical object.
Definition: IShapeFactory.h:18
void AttachToScene(iqt2d::IViewProvider *providerPtr, int flags)
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition: IObserver.h:24
Set of change flags (its IDs).
Definition: IChangeable.h:30
virtual void OnGuiCreated()
Called just after GUI is initialized.
Interface providing loading and saving of data objects.
Interface for GUI objects managing view.
Definition: IViewProvider.h:24
virtual void AddItemsToScene(iqt2d::IViewProvider *providerPtr, int flags)
Called when items should be added to specified scene.
virtual void UpdateEditor(const istd::IChangeable::ChangeSet &changeSet)
Updates editor with model data.
virtual void OnGuiModelAttached()
Called when model is attached and GUI is created.

© 2007-2017 Witold Gantzke and Kirill Lepskiy