ACF $AcfVersion:0$
CSelectableParamsSetComp.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
6
9
10#include <iprm/IOptionsList.h>
11#include <iprm/IParamsSet.h>
13#include <iprm/IParamsManager.h>
14
15
16namespace iprm
17{
18
19
25 virtual public iprm::IParamsSet
26{
27public:
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 override;
45 virtual const iser::ISerializable* GetParameter(const QByteArray& id) const override;
46 virtual iser::ISerializable* GetEditableParameter(const QByteArray& id) override;
47 virtual const IParamsInfoProvider* GetParamsInfoProvider() const override;
48
49 // reimplemented (iser::ISerializable)
50 virtual bool Serialize(iser::IArchive& archive) override;
51
52protected:
53 // reimplemented (icomp::CComponentBase)
54 virtual void OnComponentCreated() override;
55 virtual void OnComponentDestroyed() override;
56
57private:
58 I_ATTR(QByteArray, m_selectionParamIdAttrPtr);
59 I_ATTR(bool, m_allowEditingAttrPtr);
60 I_REF(iprm::ISelectionParam, m_currentSelectionCompPtr);
61 I_REF(imod::IModel, m_currentSelectionModelCompPtr);
62 I_REF(IParamsManager, m_paramsManagerCompPtr);
63 I_REF(imod::IModel, m_paramsManagerModelCompPtr);
64
65 imod::CModelUpdateBridge m_updateBridge;
66};
67
68
69} // namespace iprm
70
71
72
73
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:25
Interface allowing to select single option from list of options.
virtual iser::ISerializable * GetEditableParameter(const QByteArray &id) override
Get access to editable parameter (read-write access).
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
virtual const IParamsInfoProvider * GetParamsInfoProvider() const override
Get parameter information provider.
virtual void OnComponentCreated() override
virtual void OnComponentDestroyed() override
virtual const iser::ISerializable * GetParameter(const QByteArray &id) const override
Get any parameter (read-only access).
virtual Ids GetParamIds(bool editableOnly=false) const override
Get list of used parameter IDs in the parameter set.
Provider of parameter information (name and description).
Manager of parameter sets.
Set of general parameters.
Definition IParamsSet.h:81
QSet< QByteArray > Ids
Definition IParamsSet.h:83
Interface allowing to select single option from list of options.
Represents an input/output persistence archive for object serialization.
Definition IArchive.h:164
Common class for all classes which objects can be archived or restored from archive.
Contains interfaces and implementations of flexible parameter concept.