ACF $AcfVersion:0$
CSelectionConstraintsComp.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
5// ACF includes
8#include <iprm/IOptionsList.h>
10
11
12namespace iprm
13{
14
15
21 virtual public iprm::IOptionsList
22{
23public:
25
26 I_BEGIN_COMPONENT(CSelectionConstraintsComp);
27 I_REGISTER_INTERFACE(istd::IChangeable);
28 I_REGISTER_INTERFACE(iprm::IOptionsList);
29 I_ASSIGN_MULTI_0(m_optionNamesAttrPtr, "OptionNames", "Names of selectable options", true);
30 I_ASSIGN_MULTI_0(m_optionDescriptionsAttrPtr, "OptionDescriptions", "Descriptions of selectable options", true);
31 I_ASSIGN_MULTI_0(m_optionIdsAttrPtr, "OptionIds", "List of option IDs", true);
32 I_ASSIGN_MULTI_0(m_optionsEnablersCompPtr, "OptionEnablers", "List of enablers for the options", false);
33 I_END_COMPONENT;
34
35 // reimplemented (iprm::IOptionsList)
36 virtual int GetOptionsFlags() const override;
37 virtual int GetOptionsCount() const override;
38 virtual QString GetOptionName(int index) const override;
39 virtual QString GetOptionDescription(int index) const override;
40 virtual QByteArray GetOptionId(int index) const override;
41 virtual bool IsOptionEnabled(int index) const override;
42
43private:
44 I_MULTITEXTATTR(m_optionNamesAttrPtr);
45 I_MULTITEXTATTR(m_optionDescriptionsAttrPtr);
46 I_MULTIATTR(QByteArray, m_optionIdsAttrPtr);
47 I_MULTIREF(iprm::IEnableableParam, m_optionsEnablersCompPtr);
48};
49
50
51} // namespace iprm
52
53
54
55
Base class for component implementation.
Implementation of selection constraints.
virtual QString GetOptionName(int index) const override
Get name of specified option.
virtual QByteArray GetOptionId(int index) const override
Get option ID.
virtual bool IsOptionEnabled(int index) const override
Return true if the option is enabled and can be selected.
virtual int GetOptionsFlags() const override
Get constraints flags.
virtual int GetOptionsCount() const override
Get number of managed options.
virtual QString GetOptionDescription(int index) const override
Get human-readable description for an option.
Interface for objects which can be enabled/disabled.
Constraints of selection from set of possibilities.
Common interface for data model objects, which can be changed.
Definition IChangeable.h:28
#define I_MULTITEXTATTR(member)
Declare translatable multiple text attribute member.
Contains interfaces and implementations of flexible parameter concept.