QCAD
Open Source 2D CAD
RPropertyTypeId.h
Go to the documentation of this file.
1 
20 #ifndef RPROPERTYTYPEID_H_
21 #define RPROPERTYTYPEID_H_
22 
23 #include "core_global.h"
24 
25 #include <typeinfo>
26 
27 #include <QMap>
28 #include <QMetaType>
29 #include <QSet>
30 #include <QString>
31 
32 #include "RDebug.h"
33 #include "RS.h"
34 
58 public:
62  //RPropertyTypeId(const std::type_info& classInfo, const QString& groupTitle,
63  // const QString& title);
67  //RPropertyTypeId(const std::type_info& classInfo, const RPropertyTypeId& other);
68 
69  RPropertyTypeId(const QString& customPropertyTitle, const QString& customPropertyName);
70  RPropertyTypeId(const QString& customPropertyName);
71 
72  RPropertyTypeId(const RPropertyTypeId& other);
73  RPropertyTypeId(long int id = INVALID_ID);
74 
75  long int getId() const;
76  void setId(long int id);
77  QString getCustomPropertyTitle() const;
78  void setCustomPropertyTitle(const QString& t);
79  QString getCustomPropertyName() const;
80  void setCustomPropertyName(const QString& n);
81 
82  bool isValid() const;
83  bool isCustom() const;
84  //bool isBlockAttribute() const;
85 
86 // QString getBlockAttributeTag() const;
87 // QString getBlockAttributePrompt() const;
88 // QString getBlockAttributeId() const;
89 
93  void generateId(const std::type_info& classInfo,
94  const QString& groupTitle, const QString& title, bool forceNew = false);
98  void generateId(const std::type_info& classInfo,
99  const RPropertyTypeId& other);
100 
104  static QSet<RPropertyTypeId> getPropertyTypeIds(
105  const std::type_info& classInfo);
109  static bool hasPropertyType(const std::type_info& classInfo,
110  RPropertyTypeId propertyTypeId);
111  QString getPropertyGroupTitle() const;
112  QString getPropertyTitle() const;
113  static RPropertyTypeId getPropertyTypeId(const QString& groupTitle,
114  const QString& title);
115 
116  bool operator ==(const RPropertyTypeId& other) const;
117  bool operator !=(const RPropertyTypeId& other) const;
118  bool operator <(const RPropertyTypeId& other) const;
119 
120 public:
121  const static long int INVALID_ID;
122  //const static QString blockAttributePrefix;
123 
124 private:
125  long int id;
128 
129  static long int counter;
130  static QMap<QString, QSet<RPropertyTypeId> > propertyTypeByObjectMap;
131  static QMap<long int, QPair<QString, QString> > titleMap;
132 };
133 
134 QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RPropertyTypeId& p);
135 
136 QCADCORE_EXPORT uint qHash(RPropertyTypeId propertyTypeId);
137 
143 
144 #endif /* RPROPERTYTYPEID_H_ */
QString customPropertyName
Definition: RPropertyTypeId.h:127
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPropertyTypeId.h:57
static long int counter
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPropertyTypeId.h:129
#define QCADCORE_EXPORT
Definition: core_global.h:10
static QMap< long int, QPair< QString, QString > > titleMap
Definition: RPropertyTypeId.h:131
QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RPropertyTypeId &p)
Definition: RPropertyTypeId.cpp:286
QCADCORE_EXPORT uint qHash(RPropertyTypeId propertyTypeId)
Definition: RPropertyTypeId.cpp:277
static const long int INVALID_ID
Definition: RPropertyTypeId.h:121
Q_DECLARE_METATYPE(RMath *)
bool operator<(const RPainterPath &p1, const RPainterPath &p2)
This operator allows us to sort painter paths based on z-level.
Definition: RPainterPath.cpp:498
long int id
Definition: RPropertyTypeId.h:125
QString customPropertyTitle
Definition: RPropertyTypeId.h:126
static QMap< QString, QSet< RPropertyTypeId > > propertyTypeByObjectMap
Definition: RPropertyTypeId.h:130