CExtComposedParamsSetGuiComp.h
Go to the documentation of this file.
1 #ifndef iqtprm_CExtComposedParamsSetGuiComp_included
2 #define iqtprm_CExtComposedParamsSetGuiComp_included
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 
18 namespace iqtprm
19 {
20 
21 
27  iqtgui::CComposedGuiComp, imod::TSingleModelObserverBase<iprm::IParamsSet> >,
29 {
30 public:
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);
46  virtual void SetReadOnly(bool state);
47 
48  // reimplemented (iqtgui::CGuiComponentBase)
49  virtual void OnGuiCreated();
50  virtual void OnGuiDestroyed();
51 
52  // reimplemented (iqt2d::IViewExtender)
53  virtual void AddItemsToScene(iqt2d::IViewProvider* providerPtr, int flags);
54  virtual void RemoveItemsFromScene(iqt2d::IViewProvider* providerPtr);
55 
56 protected:
57  void AttachToScene(iqt2d::IViewProvider* providerPtr, int flags);
58  void DetachFromScene(iqt2d::IViewProvider* providerPtr);
59 
60  // reimplemented (iqtgui::CMultiPageGuiCompBase)
61  virtual void CreatePages();
62  virtual void OnPageChanged(int widgetIndex);
63 
64  // reimplemented (iqtgui::TGuiObserverWrap)
65  virtual void OnGuiModelAttached();
66  virtual void OnGuiModelDetached();
67  virtual void UpdateModel() const;
68 
69 private:
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 #endif // !iqtprm_CExtComposedParamsSetGuiComp_included
89 
90 
Interface for GUI objects presenting its results using extern view objects.
Definition: IViewExtender.h:19
Component for the layouting/grouping of the UI-subcomponents.
virtual void SetReadOnly(bool state)
Set flag that the model data can be changed.
Join functionality of iqtgui::IGuiObject interface and imod::IObserver.
virtual void AddItemsToScene(iqt2d::IViewProvider *providerPtr, int flags)
Called when items should be added to specified scene.
Common interface for an model editor.
Definition: IModelEditor.h:19
virtual void UpdateModel() const
Do update of the model to reflect the current contents of GUI.
void AttachToScene(iqt2d::IViewProvider *providerPtr, int flags)
virtual void CreatePages()
Create all container pages.
virtual void OnGuiDestroyed()
Called just before GUI is released.
iqtgui::TGuiObserverWrap< iqtgui::CComposedGuiComp, imod::TSingleModelObserverBase< iprm::IParamsSet > > BaseClass
virtual void OnGuiCreated()
Called just after GUI is initialized.
virtual void OnGuiModelAttached()
Called when model is attached and GUI is created.
virtual void UpdateEditor(const istd::IChangeable::ChangeSet &changeSet)
Updates editor with model data.
New version of parameter set UI based on standard multi page UI concept.
virtual void OnGuiModelDetached()
Called when model is detached or GUI is destroyed.
virtual void RemoveItemsFromScene(iqt2d::IViewProvider *providerPtr)
Called when items should be removed from specified scene.
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition: IObserver.h:24
void DetachFromScene(iqt2d::IViewProvider *providerPtr)
Set of change flags (its IDs).
Definition: IChangeable.h:30
Interface for GUI objects managing view.
Definition: IViewProvider.h:24
virtual void OnPageChanged(int widgetIndex)

© 2007-2017 Witold Gantzke and Kirill Lepskiy