Added altitude display to detail screen. Added option to disable auto rotation.
[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 load(QDomNode const& data, Reader* reader);
43     bool orientationEnabled(Orientation orientation) const;
44     bool orientationLoaded(Orientation orientation) const;
45     void setColor(Orientation orientation, QString const& color);
46     void setColor(QString const& color);
47
48 public slots:
49     virtual void reArrange();
50     virtual void flip();
51     virtual void clear();
52     void removeUnloaded();
53
54 signals:
55     void minimizePressed();
56     void settingsPressed();
57     void closePressed();
58     void clicked();
59
60 private:
61     QMap<Orientation, ThemeScreen*> screens_;
62     QSet<Orientation> loadedScreens_;
63     Orientation currentOrientation_;
64
65 };
66
67 #endif