diff colourset.h @ 53:3c46b2ac45d3

* Put proper labels &c in changeset items; colour branches and users; etc
author Chris Cannam
date Fri, 12 Nov 2010 16:48:18 +0000
parents
children f583e44d9d31
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/colourset.h	Fri Nov 12 16:48:18 2010 +0000
@@ -0,0 +1,28 @@
+#ifndef _COLOURSET_H_
+#define _COLOURSET_H_
+
+#include <QSet>
+#include <QMap>
+#include <QColor>
+#include <QString>
+
+class ColourSet
+{
+public:
+    void clearDefaultNames() { m_defaultNames.clear(); }
+    void addDefaultName(QString n) { m_defaultNames.insert(n); }
+
+    QColor getColourFor(QString n);
+
+    static ColourSet *instance();
+
+private:
+    ColourSet();
+    QSet<QString> m_defaultNames;
+    QMap<QString, QColor> m_colours;
+    QColor m_lastColour;
+
+    static ColourSet m_instance;
+};
+
+#endif