ACF $AcfVersion:0$
CEnumAttributeMetaInfo.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// Qt includes
6#include <list>
7
8// ACF includes
9#include <istd/TOptDelPtr.h>
10
11// ACF-Solutions includes
14
15
16namespace iattr
17{
18
19
24 public CAttributeMetaInfo,
25 virtual public IEnumAttributeMetaInfo
26{
27public:
29
30 explicit CEnumAttributeMetaInfo(const QByteArray& typeId = "");
31
32 void SetOtherValueAllowed(bool state);
37 const QString& GetUnknownDescription() const;
42 void SetUnknownDescription(const QString& description);
43
50 bool InsertOption(const QString& description, const iser::IObject* valuePtr, bool releaseFlag);
51
52 // reimplemented (iattr::IEnumAttributeMetaInfo)
53 virtual bool IsAnyValueAllowed() const override;
54 virtual int GetEnumsCount() const override;
55 virtual QString GetValueDescription(const iser::IObject& value) const override;
56 virtual const iser::IObject& GetEnum(int index) const override;
57
58private:
59 bool m_isAnyValueAllowed;
60 struct EnumInfo
61 {
62 QString description;
64 };
65 typedef std::list<EnumInfo> Enums;
66 Enums m_enums;
67
71 QString m_unknownDescription;
72};
73
74
75} // namespace iattr
76
77
78
79
Represents constraints of properties allowing values from enumerated set.
Represents constraints of properties allowing values from enumerated set.
const QString & GetUnknownDescription() const
Get descrition of unknown value;.
bool InsertOption(const QString &description, const iser::IObject *valuePtr, bool releaseFlag)
Insert new enumeration element.
CEnumAttributeMetaInfo(const QByteArray &typeId="")
virtual QString GetValueDescription(const iser::IObject &value) const override
Gets description of single enumeration.
void SetUnknownDescription(const QString &description)
Set descrition of unknown value;.
virtual bool IsAnyValueAllowed() const override
Checks if other then enumerated values are allowed.
virtual int GetEnumsCount() const override
Gets number of enumerations.
void SetOtherValueAllowed(bool state)
virtual const iser::IObject & GetEnum(int index) const override
Gets single enumeration.
Represents constraints of properties allowing values from enumerated set.
Common interface for factorisable model objects.
Definition IObject.h:23
Pointer wrapper providing activatable deleting pointed object during destruction.
Definition TOptDelPtr.h:21
This namespace containes implementations of attributes concept.