QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RPropertyTypeId.h
Go to the documentation of this file.
1 #ifndef RPROPERTYTYPEID_H_
2 #define RPROPERTYTYPEID_H_
3 
4 #include <typeinfo>
5 
6 #include <QMap>
7 #include <QMetaType>
8 #include <QSet>
9 #include <QString>
10 
11 #include "RDebug.h"
12 
36 public:
40  //RPropertyTypeId(const std::type_info& classInfo, const QString& groupTitle,
41  // const QString& title);
45  //RPropertyTypeId(const std::type_info& classInfo, const RPropertyTypeId& other);
46 
47  RPropertyTypeId(const QString& customPropertyName);
48 
49  RPropertyTypeId(const RPropertyTypeId& other);
50  RPropertyTypeId(long int id = INVALID_ID);
51 
52  long int getId() const;
53  QString getCustomPropertyName() const;
54 
55  bool isValid() const;
56  bool isCustom() const;
57 
61  void generateId(const std::type_info& classInfo,
62  const QString& groupTitle, const QString& title, bool forceNew = false);
66  void generateId(const std::type_info& classInfo,
67  const RPropertyTypeId& other);
68 
72  static QSet<RPropertyTypeId> getPropertyTypeIds(
73  const std::type_info& classInfo);
77  static bool hasPropertyType(const std::type_info& classInfo,
78  RPropertyTypeId propertyTypeId);
79  QString getPropertyGroupTitle() const;
80  QString getPropertyTitle() const;
81  static RPropertyTypeId getPropertyTypeId(const QString& groupTitle,
82  const QString& title);
83 
84  bool operator ==(const RPropertyTypeId& other) const;
85  bool operator !=(const RPropertyTypeId& other) const;
86  bool operator <(const RPropertyTypeId& other) const;
87 
88 public:
89  const static long int INVALID_ID;
90 
91 private:
92  long int id;
94 
95  static long int counter;
96  static QMap<QString, QSet<RPropertyTypeId> > propertyTypeByObjectMap;
97  static QMap<long int, QPair<QString, QString> > titleMap;
98 };
99 
100 QDebug operator<<(QDebug dbg, RPropertyTypeId& p);
101 
102 uint qHash(RPropertyTypeId propertyTypeId);
103 
109 
110 #endif /* RPROPERTYTYPEID_H_ */