QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RLinetype.h
Go to the documentation of this file.
1 #ifndef RLINETYPE_H
2 #define RLINETYPE_H
3 
4 #include <QColor>
5 #include <QCoreApplication>
6 #include <QIcon>
7 #include <QMetaType>
8 #include <QString>
9 
10 #include "RLinetypePattern.h"
11 #include "RObject.h"
12 #include "RPropertyTypeId.h"
13 #include "RVector.h"
14 
15 class RDocument;
16 
17 
18 
28 class RLinetype: public RObject {
29 
31 
32 public:
34 
35 public:
37  RLinetype(RDocument* document, const QString& name);
38 
39  virtual ~RLinetype();
40 
41  static void init();
42 
43  virtual RLinetype* clone() const {
44  return new RLinetype(*this);
45  }
46 
47  QString getName() const {
48  return name;
49  }
50 
51  void setName(const QString& n) {
52  name = n;
53  }
54 
55  bool isValid() const;
56 
57  static QList<QPair<QString, RLinetype> > getList(bool onlyFixed = false);
58 
59  virtual QPair<QVariant, RPropertyAttributes> getProperty(
60  RPropertyTypeId propertyTypeId,
61  bool humanReadable = false, bool noAttributes = false);
62  virtual bool setProperty(RPropertyTypeId propertyTypeId,
63  const QVariant& value);
64 
65  virtual bool isSelectedForPropertyEditing();
66 
67  static QIcon getIcon(const RLinetype& linetype);
68  static QString getTitle(const RLinetype& linetype);
69 
70  bool operator==(const RLinetype & linetype) const;
71  bool operator!=(const RLinetype & linetype) const;
72  bool operator<(const RLinetype & linetype) const;
73 
74 private:
75  static void init(const QString& cn, const RLinetype& c);
76 
77 private:
78  QString name;
79  static QList<QPair<QString, RLinetype> > list;
80  static QMap<RLinetype, QIcon> iconMap;
81 };
82 
83 QDebug operator<<(QDebug dbg, const RLinetype& l);
84 
87 Q_DECLARE_METATYPE(QSharedPointer<RLinetype>)
88 Q_DECLARE_METATYPE(QSharedPointer<RLinetype>*)
89 typedef QPair<QString, RLinetype> _RPairStringRLinetype;
90 Q_DECLARE_METATYPE(_RPairStringRLinetype)
91 Q_DECLARE_METATYPE(QList< _RPairStringRLinetype >)
92 
93 #endif