CSelectableParamsSetComp.h
Go to the documentation of this file.
1 #ifndef iprm_CSelectableParamsSetComp_included
2 #define iprm_CSelectableParamsSetComp_included
3 
4 
5 #include <icomp/CComponentBase.h>
6 
9 
10 #include <iprm/IOptionsList.h>
11 #include <iprm/IParamsSet.h>
12 #include <iprm/ISelectionParam.h>
13 #include <iprm/IParamsManager.h>
14 
15 
16 namespace iprm
17 {
18 
19 
24  public icomp::CComponentBase,
25  virtual public iprm::IParamsSet
26 {
27 public:
29 
30  I_BEGIN_COMPONENT(CSelectableParamsSetComp);
31  I_REGISTER_INTERFACE(iser::ISerializable);
32  I_REGISTER_INTERFACE(IParamsSet);
33  I_ASSIGN(m_selectionParamIdAttrPtr, "SelectionParamId", "ID of selection in this parameter set", false, "Input");
34  I_ASSIGN(m_currentSelectionCompPtr, "CurrentSelection", "Current selected index, if unspecified the selection from manager will be used", false, "CurrentSelection");
35  I_ASSIGN_TO(m_currentSelectionModelCompPtr, m_currentSelectionCompPtr, false);
36  I_ASSIGN(m_paramsManagerCompPtr, "ParamsManager", "Manager of parameter set used to realize selection", true, "ParamsManager");
37  I_ASSIGN_TO(m_paramsManagerModelCompPtr, m_paramsManagerCompPtr, false);
38  I_ASSIGN(m_allowEditingAttrPtr, "AllowEditing", "If enabled, the selected parameter set will be editable", true, false);
39  I_END_COMPONENT;
40 
42 
43  // reimplemented (iprm::IParamsSet)
44  virtual Ids GetParamIds(bool editableOnly = false) const;
45  virtual const iser::ISerializable* GetParameter(const QByteArray& id) const;
46  virtual iser::ISerializable* GetEditableParameter(const QByteArray& id);
47 
48  // reimplemented (iser::ISerializable)
49  virtual bool Serialize(iser::IArchive& archive);
50 
51 protected:
52  // reimplemented (icomp::CComponentBase)
53  virtual void OnComponentCreated();
54  virtual void OnComponentDestroyed();
55 
56 private:
57  I_ATTR(QByteArray, m_selectionParamIdAttrPtr);
58  I_ATTR(bool, m_allowEditingAttrPtr);
59  I_REF(iprm::ISelectionParam, m_currentSelectionCompPtr);
60  I_REF(imod::IModel, m_currentSelectionModelCompPtr);
61  I_REF(IParamsManager, m_paramsManagerCompPtr);
62  I_REF(imod::IModel, m_paramsManagerModelCompPtr);
63 
64  imod::CModelUpdateBridge m_updateBridge;
65 };
66 
67 
68 } // namespace iprm
69 
70 
71 #endif // !iprm_CSelectableParamsSetComp_included
72 
73 
Interface allowing to select single option from list of options.
QSet< QByteArray > Ids
Definition: IParamsSet.h:26
Manager of parameters set.
virtual Ids GetParamIds(bool editableOnly=false) const
Get list of used parameter IDs in the parameter set.
Base class for component implementation.
Common class for all classes which objects can be archived or restored from archive.
Definition: ISerializable.h:23
virtual iser::ISerializable * GetEditableParameter(const QByteArray &id)
Get access to editable parameter.
Represent input/output persistence archive.
Definition: IArchive.h:30
virtual const iser::ISerializable * GetParameter(const QByteArray &id) const
Get any parameter.
Reflects the changes of observed objects as changes of some other object (over istd::IChangeable), typically delegated to itself.
virtual bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.
Common interface for model objects, that supports Model/Observer design pattern.
Definition: IModel.h:23
virtual void OnComponentDestroyed()
Interface allowing to select single option from list of options.
Set of general parameters.
Definition: IParamsSet.h:23

© 2007-2017 Witold Gantzke and Kirill Lepskiy