Minor fix for another change in Google's movie pages and a fix in
[movie-schedule] / src / ui / styleutils.h
1 // Copyright 2010 Jochen Becher
2 //
3 // This file is part of MovieSchedule.
4 //
5 // MovieSchedule is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // MovieSchedule is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with MovieSchedule.  If not, see <http://www.gnu.org/licenses/>.
17
18 #ifndef STYLEUTILS_H
19 #define STYLEUTILS_H
20
21 #include <QColor>
22 #include <QTime>
23 #include <QDate>
24
25 class QPalette;
26
27 class StyleUtils
28 {
29     friend class StyleUtilsSingleton;
30
31 public:
32     enum StandardColor {
33         DefaultBackgroundColor,
34         DefaultTextColor,
35         SecondaryTextColor
36     };
37
38     enum Font {
39         TextFont,
40         SecondaryTextFont,
41     };
42
43 private:
44     StyleUtils();
45
46 public:
47     QColor GetColor(const QPalette &palette, StandardColor standard_color);
48
49     QColor GetScheduleTimeColor(const QPalette &palette, QTime time);
50
51     QColor GetDayTextColor(const QPalette &palette, const QDate &date);
52
53     QColor GetDayBackgroundColor(const QPalette &palette, const QDate &date);
54
55 public:
56     static StyleUtils *INSTANCE() { return _instance; }
57
58 private:
59     static StyleUtils *_instance;
60 };
61
62 class StyleUtilsSingleton
63 {
64 public:
65     StyleUtilsSingleton();
66
67 private:
68     StyleUtils _instance;
69 };
70
71 #endif // STYLEUTILS_H