OSDN Git Service

fix compile problem
[tjqt4port/tj2qt4.git] / taskjuggler / TableColorSet.h
1 /*
2  * TableColorSet.h - TaskJuggler
3  *
4  * Copyright (c) 2001, 2002, 2003, 2004 by Chris Schlaeger <cs@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of version 2 of the GNU General Public License as
8  * published by the Free Software Foundation.
9  *
10  * $Id$
11  */
12 #ifndef _TableColorSet_h_
13 #define _TableColorSet_h_
14
15 #include <qcolor.h>
16 #include <qmap.h>
17
18 class TableColorSet
19 {
20 public:
21     TableColorSet()
22     {
23         colors["header"] = QColor(0xa5c2ff);
24         colors["default"] = QColor(0xf3ebae);
25         colors["error"] = QColor(0xff0000);
26         colors["today"] = QColor(0xa387ff);
27         colors["vacation"] = QColor(0xfffc60);
28         colors["available"] = QColor(0xa4ff8d);
29         colors["booked"] = QColor(0xff5a5d);
30         colors["completed"] = QColor(0x87ff75);
31     }
32     ~TableColorSet() { }
33
34     void setColor(const QString& name, uint value)
35     {
36         colors[name] = QColor(value);
37     }
38     const QColor getColor(const QString& name) const
39     {
40        return colors[name];
41     }
42     QString getColorName(const QString& name) const
43     {
44         return colors[name].name();
45     }
46
47 private:
48     QMap<QString, QColor> colors;
49 } ;
50
51 #endif
52