308043e7087f7c9759f59eb67c42a8644d2ca0b5
[jspeed] / src / theme.h
1 /*
2  * This file is part of jSpeed.
3  *
4  * jSpeed is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * jSpeed is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with jSpeed.  If not, see <http://www.gnu.org/licenses/>.
16  *
17  */
18
19 #ifndef THEME_H
20 #define THEME_H
21
22 #include "widgetscreen.h"
23
24 class QString;
25 class Reader;
26 class ThemeScreen;
27 class DetailScreen;
28
29 class Theme : public WidgetScreen
30 {
31     Q_OBJECT
32
33 public:
34     Theme(DetailScreen* detailScreen, QWidget* parent = 0);
35     ~Theme();
36     bool load();
37     bool portraitEnabled() const;
38     bool landscapeEnabled() const;
39     QString const& error() const;
40     static QString getThemeDir();
41     static QString const& getThemeSuffix();
42
43 public slots:
44     virtual void reArrange();
45     virtual void flip();
46
47 private:
48     bool read();
49     void connectSignals(ThemeScreen* screen);
50     int portraitId_;
51     int landscapeId_;
52     Reader* reader_;
53     QString error_;
54     ThemeScreen* portrait_;
55     ThemeScreen* landscape_;
56     DetailScreen* detailScreen_;
57     bool portraitMode_;
58
59 };
60
61 #endif