ICF 3.1.1.10
Technical documentation of ICF Libraries
CSelectableParamsSetComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef iprm_CSelectableParamsSetComp_included
7#define iprm_CSelectableParamsSetComp_included
8
9
11
14
15#include <iprm/IOptionsList.h>
16#include <iprm/IParamsSet.h>
18#include <iprm/IParamsManager.h>
19
20
21namespace iprm
22{
23
24
30 virtual public iprm::IParamsSet
31{
32public:
34
35 I_BEGIN_COMPONENT(CSelectableParamsSetComp);
36 I_REGISTER_INTERFACE(iser::ISerializable);
37 I_REGISTER_INTERFACE(IParamsSet);
38 I_ASSIGN(m_selectionParamIdAttrPtr, "SelectionParamId", "ID of selection in this parameter set", false, "Input");
39 I_ASSIGN(m_currentSelectionCompPtr, "CurrentSelection", "Current selected index, if unspecified the selection from manager will be used", false, "CurrentSelection");
40 I_ASSIGN_TO(m_currentSelectionModelCompPtr, m_currentSelectionCompPtr, false);
41 I_ASSIGN(m_paramsManagerCompPtr, "ParamsManager", "Manager of parameter set used to realize selection", true, "ParamsManager");
42 I_ASSIGN_TO(m_paramsManagerSelectionCompPtr, m_paramsManagerCompPtr, false);
43 I_ASSIGN_TO(m_paramsManagerModelCompPtr, m_paramsManagerCompPtr, false);
44 I_ASSIGN(m_allowEditingAttrPtr, "AllowEditing", "If enabled, the selected parameter set will be editable", true, false);
45 I_END_COMPONENT;
46
48
49 // reimplemented (iprm::IParamsSet)
50 Ids GetParamIds(bool editableOnly = false) const override;
51 const iser::ISerializable* GetParameter(const QByteArray& id) const override;
52 iser::ISerializable* GetEditableParameter(const QByteArray& id) override;
53
54 // reimplemented (iser::ISerializable)
55 bool Serialize(iser::IArchive& archive) override;
56
57protected:
58 // reimplemented (icomp::CComponentBase)
59 void OnComponentCreated() override;
60 void OnComponentDestroyed() override;
61
62private:
63 I_ATTR(QByteArray, m_selectionParamIdAttrPtr);
64 I_ATTR(bool, m_allowEditingAttrPtr);
65 I_REF(ISelectionParam, m_currentSelectionCompPtr);
66 I_REF(imod::IModel, m_currentSelectionModelCompPtr);
67 I_REF(IParamsManager, m_paramsManagerCompPtr);
68 I_REF(ISelectionParam, m_paramsManagerSelectionCompPtr);
69 I_REF(imod::IModel, m_paramsManagerModelCompPtr);
70
71 imod::CModelUpdateBridge m_updateBridge;
72};
73
74
75} // namespace iprm
76
77
78#endif // !iprm_CSelectableParamsSetComp_included
79
80
Base class for component implementation.
Reflects the changes of observed objects as changes of some other object (over istd::IChangeable),...
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:29
Interface allowing to select single option from list of options.
void OnComponentDestroyed() override
Ids GetParamIds(bool editableOnly=false) const override
Get list of used parameter IDs in the parameter set.
const iser::ISerializable * GetParameter(const QByteArray &id) const override
Get any parameter.
iser::ISerializable * GetEditableParameter(const QByteArray &id) override
Get access to editable parameter.
void OnComponentCreated() override
bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
Manager of parameters set.
Set of general parameters.
Definition IParamsSet.h:29
QSet< QByteArray > Ids
Definition IParamsSet.h:31
Interface allowing to select single option from list of options.
Represent input/output persistence archive.
Definition IArchive.h:34
Common class for all classes which objects can be archived or restored from archive.
Contains interfaces and implementations of flexible parameter concept.

© Witold Gantzke and Kirill Lepskiy