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 <QSharedPointer>
31 #include <QString>
32 
33 #include "RDebug.h"
34 #include "RS.h"
35 
59 public:
63  //RPropertyTypeId(const std::type_info& classInfo, const QString& groupTitle,
64  // const QString& title);
68  //RPropertyTypeId(const std::type_info& classInfo, const RPropertyTypeId& other);
69 
70  RPropertyTypeId(const QString& customPropertyTitle, const QString& customPropertyName);
71  RPropertyTypeId(const QString& customPropertyName);
72 
73  RPropertyTypeId(const RPropertyTypeId& other);
74  RPropertyTypeId(long int id = INVALID_ID);
75 
76  long int getId() const;
77  void setId(long int id);
78  QString getCustomPropertyTitle() const;
79  void setCustomPropertyTitle(const QString& t);
80  QString getCustomPropertyName() const;
81  void setCustomPropertyName(const QString& n);
82 
83  bool isValid() const;
84  bool isCustom() const;
85  //bool isBlockAttribute() const;
86 
87 // QString getBlockAttributeTag() const;
88 // QString getBlockAttributePrompt() const;
89 // QString getBlockAttributeId() const;
90 
94  void generateId(const std::type_info& classInfo,
95  const QString& groupTitle, const QString& title, bool forceNew = false);
99  void generateId(const std::type_info& classInfo,
100  const RPropertyTypeId& other);
101 
105  static QSet<RPropertyTypeId> getPropertyTypeIds(
106  const std::type_info& classInfo);
110  static bool hasPropertyType(const std::type_info& classInfo,
111  RPropertyTypeId propertyTypeId);
112  QString getPropertyGroupTitle() const;
113  QString getPropertyTitle() const;
114  static RPropertyTypeId getPropertyTypeId(const QString& groupTitle,
115  const QString& title);
116 
117  bool operator ==(const RPropertyTypeId& other) const;
118  bool operator !=(const RPropertyTypeId& other) const;
119  bool operator <(const RPropertyTypeId& other) const;
120 
121 public:
122  const static long int INVALID_ID;
123  //const static QString blockAttributePrefix;
124 
125 private:
126  long int id;
129 
130  static long int counter;
131  static QMap<QString, QSet<RPropertyTypeId> > propertyTypeByObjectMap;
132  static QMap<long int, QPair<QString, QString> > titleMap;
133 };
134 
135 QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RPropertyTypeId& p);
136 
137 QCADCORE_EXPORT uint qHash(RPropertyTypeId propertyTypeId);
138 
144 
145 #endif /* RPROPERTYTYPEID_H_ */
QString customPropertyName
Definition: RPropertyTypeId.h:128
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
static long int counter
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RPropertyTypeId.h:130
#define QCADCORE_EXPORT
Definition: core_global.h:10
static QMap< long int, QPair< QString, QString > > titleMap
Definition: RPropertyTypeId.h:132
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:122
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:609
long int id
Definition: RPropertyTypeId.h:126
QString customPropertyTitle
Definition: RPropertyTypeId.h:127
static QMap< QString, QSet< RPropertyTypeId > > propertyTypeByObjectMap
Definition: RPropertyTypeId.h:131