src/linetypes/object.h

changeset 17
a5111f4e6412
parent 14
20d2ed3af73d
child 21
0133e565e072
equal deleted inserted replaced
16:aeb5f203b3eb 17:a5111f4e6412
6 #include "colors.h" 6 #include "colors.h"
7 #include "vertex.h" 7 #include "vertex.h"
8 8
9 namespace linetypes 9 namespace linetypes
10 { 10 {
11 struct Id { unsigned int value; };
11 enum class Property; 12 enum class Property;
12 class Object; 13 class Object;
13 class ColoredObject; 14 class ColoredObject;
14 class Empty; 15 class Empty;
15 } 16 }
44 InvalidValue 45 InvalidValue
45 }; 46 };
46 Object(); 47 Object();
47 Object(const Object&) = delete; 48 Object(const Object&) = delete;
48 virtual ~Object(); 49 virtual ~Object();
49 const unsigned int id; 50 const Id id;
50 //virtual void toString(QTextStream &out) = 0; 51 //virtual void toString(QTextStream &out) = 0;
51 virtual bool hasColor() const; 52 virtual bool hasColor() const;
52 virtual QVariant getProperty(Property id) const; 53 virtual QVariant getProperty(Property id) const;
53 virtual SetPropertyResult setProperty(Property id, const QVariant& value); 54 virtual SetPropertyResult setProperty(Property id, const QVariant& value);
54 virtual QString textRepresentation() const = 0; 55 virtual QString textRepresentation() const = 0;
73 */ 74 */
74 class linetypes::Empty : public Object 75 class linetypes::Empty : public Object
75 { 76 {
76 QString textRepresentation() const override; 77 QString textRepresentation() const override;
77 }; 78 };
78
79 namespace linetypes
80 {
81 using Id = std::decay_t<decltype(Object::id)>;
82 }

mercurial