40 InvalidValue |
39 InvalidValue |
41 }; |
40 }; |
42 BaseObject(); |
41 BaseObject(); |
43 BaseObject(const BaseObject&) = delete; |
42 BaseObject(const BaseObject&) = delete; |
44 virtual ~BaseObject(); |
43 virtual ~BaseObject(); |
45 const Uuid id; |
44 const unsigned int id; |
46 //virtual void toString(QTextStream &out) = 0; |
45 //virtual void toString(QTextStream &out) = 0; |
47 virtual bool hasColor() const; |
46 virtual bool hasColor() const; |
48 virtual QVariant getProperty(Property id) const; |
47 virtual QVariant getProperty(Property id) const; |
49 virtual SetPropertyResult setProperty(Property id, const QVariant& value); |
48 virtual SetPropertyResult setProperty(Property id, const QVariant& value); |
|
49 virtual QString textRepresentation() const = 0; |
|
50 virtual QBrush textRepresentationForeground() const; |
|
51 virtual QBrush textRepresentationBackground() const; |
|
52 virtual QFont textRepresentationFont() const; |
50 }; |
53 }; |
51 |
54 |
52 class modelobjects::ColoredBaseObject : public BaseObject |
55 class modelobjects::ColoredBaseObject : public BaseObject |
53 { |
56 { |
54 public: |
57 public: |
57 QVariant getProperty(Property id) const override; |
60 QVariant getProperty(Property id) const override; |
58 SetPropertyResult setProperty(Property id, const QVariant& value) override; |
61 SetPropertyResult setProperty(Property id, const QVariant& value) override; |
59 private: |
62 private: |
60 Color color_index = colors::main; |
63 Color color_index = colors::main; |
61 }; |
64 }; |
|
65 |
|
66 namespace modelobjects |
|
67 { |
|
68 using Id = std::remove_const_t<decltype(BaseObject::id)>; |
|
69 } |