summaryrefslogtreecommitdiff
path: root/src/data/style.h
diff options
context:
space:
mode:
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