Mercurial > hg > easyhg
comparison src/colourset.h @ 370:b9c153e00e84
Move source files to src/
author | Chris Cannam |
---|---|
date | Thu, 24 Mar 2011 10:27:51 +0000 |
parents | colourset.h@8fd71f570884 |
children | 533519ebc0cb |
comparison
equal
deleted
inserted
replaced
369:19cce6d2c470 | 370:b9c153e00e84 |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
2 | |
3 /* | |
4 EasyMercurial | |
5 | |
6 Based on HgExplorer by Jari Korhonen | |
7 Copyright (c) 2010 Jari Korhonen | |
8 Copyright (c) 2011 Chris Cannam | |
9 Copyright (c) 2011 Queen Mary, University of London | |
10 | |
11 This program is free software; you can redistribute it and/or | |
12 modify it under the terms of the GNU General Public License as | |
13 published by the Free Software Foundation; either version 2 of the | |
14 License, or (at your option) any later version. See the file | |
15 COPYING included with this distribution for more information. | |
16 */ | |
17 | |
18 #ifndef _COLOURSET_H_ | |
19 #define _COLOURSET_H_ | |
20 | |
21 #include <QSet> | |
22 #include <QMap> | |
23 #include <QColor> | |
24 #include <QString> | |
25 | |
26 class ColourSet | |
27 { | |
28 public: | |
29 void clearDefaultNames() { m_defaultNames.clear(); } | |
30 void addDefaultName(QString n) { m_defaultNames.insert(n); } | |
31 | |
32 QColor getColourFor(QString n); | |
33 | |
34 static ColourSet *instance(); | |
35 | |
36 private: | |
37 ColourSet(); | |
38 QSet<QString> m_defaultNames; | |
39 QMap<QString, QColor> m_colours; | |
40 QColor m_lastColour; | |
41 | |
42 static ColourSet m_instance; | |
43 }; | |
44 | |
45 #endif |