summaryrefslogtreecommitdiff
path: root/src/data/style.h
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2018-04-10 16:07:44 +0200
committerAleks Kissinger <aleks0@gmail.com>2018-04-10 16:07:44 +0200
commiteac7dee2d8ba86001afbc61c4e9d7baae7341cb8 (patch)
tree4214eb557fbeee94144c298bd2ec5e5a0e2df27f /src/data/style.h
parentfacfa3e8aa7e3c278b0016c02c6a9f1f019903e2 (diff)
added edgestyles, but cant apply to nodes yet
Diffstat (limited to 'src/data/style.h')
-rw-r--r--src/data/style.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/data/style.h b/src/data/style.h
new file mode 100644
index 0000000..9d58ebe
--- /dev/null
+++ b/src/data/style.h
@@ -0,0 +1,36 @@
+#ifndef STYLE_H
+#define STYLE_H
+
+
+#include "graphelementdata.h"
+
+#include <QColor>
+#include <QPen>
+#include <QBrush>
+#include <QPainterPath>
+#include <QIcon>
+
+class Style
+{
+public:
+ Style();
+ Style(QString name, GraphElementData *data);
+ bool isNone();
+
+ // properties that both edges and nodes have
+ GraphElementData *data() const;
+ QString name() const;
+ QColor strokeColor() const;
+ int strokeThickness() const;
+
+ // methods that are implemented differently for edges and nodes
+ virtual QPen pen() const;
+ virtual QPainterPath path() const = 0;
+ virtual QPainterPath palettePath() const = 0;
+ virtual QIcon icon() const = 0;
+protected:
+ QString propertyWithDefault(QString prop, QString def) const;
+ QString _name;
+ GraphElementData *_data;
+};
+#endif // STYLE_H