CEnumAttributeMetaInfo.h
Go to the documentation of this file.
1 #ifndef iattr_CEnumAttributeMetaInfo_included
2 #define iattr_CEnumAttributeMetaInfo_included
3 
4 
5 // Qt includes
6 #include <QtCore/QList>
7 
8 // ACF includes
9 #include <istd/TOptDelPtr.h>
10 
11 // ACF-Solutions includes
14 
15 
16 namespace iattr
17 {
18 
19 
24  public CAttributeMetaInfo,
25  virtual public IEnumAttributeMetaInfo
26 {
27 public:
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;
54  virtual int GetEnumsCount() const;
55  virtual QString GetValueDescription(const iser::IObject& value) const;
56  virtual const iser::IObject& GetEnum(int index) const;
57 
58 private:
59  bool m_isAnyValueAllowed;
60  struct EnumInfo
61  {
62  QString description;
64  };
65  typedef QList<EnumInfo> Enums;
66  Enums m_enums;
67 
71  QString m_unknownDescription;
72 };
73 
74 
75 } // namespace iattr
76 
77 
78 #endif // !iattr_CEnumAttributeMetaInfo_included
79 
80 
void SetUnknownDescription(const QString &description)
Set descrition of unknown value;.
virtual bool IsAnyValueAllowed() const
Checks if other then enumerated values are allowed.
virtual int GetEnumsCount() const
Gets number of enumerations.
const QString & GetUnknownDescription() const
Get descrition of unknown value;.
virtual QString GetValueDescription(const iser::IObject &value) const
Gets description of single enumeration.
Common interface for factorisable model objects.
Definition: IObject.h:19
bool InsertOption(const QString &description, const iser::IObject *valuePtr, bool releaseFlag)
Insert new enumeration element.
virtual const iser::IObject & GetEnum(int index) const
Gets single enumeration.
CEnumAttributeMetaInfo(const QByteArray &typeId="")
void SetOtherValueAllowed(bool state)
Represents constraints of properties allowing values from enumerated set.
Represents constraints of properties allowing values from enumerated set.
Represents constraints of properties allowing values from enumerated set.

© 2007-2017 Witold Gantzke and Kirill Lepskiy