Added zpos attribute to all elements. Changed architecture to allow detailscreen...
[jspeed] / src / widgetscreen.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 WIDGETSCREEN_H
20 #define WIDGETSCREEN_H
21
22 #include <QtCore/QMap>
23 #include <QtCore/QSet>
24 #include <QtGui/QStackedWidget>
25 #include "abstractscreen.h"
26
27 class QDomNode;
28 class QString;
29 class Reader;
30 class ThemeScreen;
31
32 class WidgetScreen : public QStackedWidget, public AbstractScreen
33 {
34     Q_OBJECT
35
36 public:
37     enum Orientation {LANDSCAPE, PORTRAIT};
38     WidgetScreen(QWidget* parent = 0);
39     ~WidgetScreen();
40     void addScreen(ThemeScreen* screen, Orientation orientation);
41     bool load(Orientation orientation, QDomNode const& data, Reader* reader);
42     bool orientationEnabled(Orientation orientation) const;
43     bool orientationLoaded(Orientation orientation) const;
44     virtual void setColor(QString const& color);
45
46 public slots:
47     virtual void reArrange();
48     virtual void flip();
49     virtual void clear();
50     void removeUnloaded();
51
52 signals:
53     void minimizePressed();
54     void settingsPressed();
55     void closePressed();
56     void clicked();
57
58 private:
59     QMap<Orientation, ThemeScreen*> screens_;
60     QSet<Orientation> loadedScreens_;
61     Orientation currentOrientation_;
62
63 };
64
65 #endif