QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RLinetype.h
Go to the documentation of this file.
1 
20 #ifndef RLINETYPE_H
21 #define RLINETYPE_H
22 
23 #include "core_global.h"
24 
25 #include <QColor>
26 #include <QCoreApplication>
27 #include <QIcon>
28 #include <QMetaType>
29 #include <QString>
30 
31 #include "RLinetypePattern.h"
32 #include "RObject.h"
33 #include "RPropertyTypeId.h"
34 #include "RVector.h"
35 
36 class RDocument;
37 class RTransaction;
38 
39 
40 
51 
52  //Q_DECLARE_TR_FUNCTIONS(RLinetype);
53 
54 public:
57 
58 public:
59  RLinetype(RDocument* document=NULL);
60  RLinetype(RDocument* document, const RLinetypePattern& pattern);
61 
62  virtual ~RLinetype();
63 
64  static void init();
65 
66  virtual RLinetype* clone() const {
67  return new RLinetype(*this);
68  }
69 
70  QString getName() const {
71  return pattern.getName();
72  }
73 
74  void setName(const QString& n) {
75  pattern.setName(n);
76  }
77 
78  QString getDescription() const {
79  return pattern.getDescription();
80  }
81 
82  void setDescription(const QString& d) {
83  pattern.setDescription(d);
84  }
85 
86  QString getLabel() const {
87  return pattern.getLabel();
88  }
89 
90  bool isValid() const;
91 
92  //static QList<QPair<QString, RLinetype> > getList(bool onlyFixed = false);
93 
94  virtual QPair<QVariant, RPropertyAttributes> getProperty(
95  RPropertyTypeId& propertyTypeId,
96  bool humanReadable = false, bool noAttributes = false);
97  virtual bool setProperty(RPropertyTypeId propertyTypeId,
98  const QVariant& value, RTransaction* transaction=NULL);
99 
100  virtual bool isSelectedForPropertyEditing();
101 
102  RLinetypePattern getPattern() const;
103  void setPattern(const RLinetypePattern& p);
104 
105 // static QIcon getIcon(const RLinetype& linetype);
106 // static QString getTitle(const RLinetype& linetype);
107 
108  bool operator==(const RLinetype & linetype) const;
109  bool operator!=(const RLinetype & linetype) const;
110  bool operator<(const RLinetype & linetype) const;
111 
112 //private:
113 // static void init(const QString& cn, const RLinetype& c);
114 
115 private:
117  //QString name;
118  //QString description;
119  //int flags;
120  //int numberOfDashes;
121  //double patternLength;
122  //double* pattern;
123  //static QList<QPair<QString, RLinetype> > list;
124  //static QMap<RLinetype, QIcon> iconMap;
125 };
126 
127 QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RLinetype& l);
128 
131 Q_DECLARE_METATYPE(QSharedPointer<RLinetype>)
132 Q_DECLARE_METATYPE(QSharedPointer<RLinetype>*)
133 typedef QPair<QString, RLinetype> _RPairStringRLinetype;
134 Q_DECLARE_METATYPE(_RPairStringRLinetype)
135 Q_DECLARE_METATYPE(QList< _RPairStringRLinetype >)
136 
137 #endif