Reset indicator when the screen is locked
[ameter] / mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QtCore/QSettings>
5
6 #include <QtGui/QMainWindow>
7 #include <QtGui/QMenuBar>
8
9 #include <QtSensors/QAccelerometer>
10
11 #ifdef Q_WS_MAEMO_5
12 #include <QtDBus/QtDBus>
13 #endif
14
15 // Neccessary for Qt Mobility API usage
16 QTM_USE_NAMESPACE
17
18 #include "ameterwidget.h"
19
20 class MainWindow : public QMainWindow
21 {
22     Q_OBJECT
23 public:
24     enum ScreenOrientation {
25         ScreenOrientationLockPortrait,
26         ScreenOrientationLockLandscape,
27         ScreenOrientationAuto
28     };
29
30     explicit MainWindow(QWidget *parent = 0);
31     virtual ~MainWindow();
32
33     // Note that this will only have an effect on Symbian and Fremantle.
34     void setOrientation(ScreenOrientation orientation);
35
36     void showExpanded();
37
38 public slots:
39         void showAbout();
40         void showSettings();
41 #ifdef Q_WS_MAEMO_5
42         void screenChange(const QDBusMessage &message);
43 #endif
44
45 private:
46         QAccelerometer *accelerometer;
47         AMeterWidget *awidget;
48 #ifdef Q_WS_MAEMO_5
49         QDBusInterface *dBusInterface;
50 #endif
51 };
52
53 #endif // MAINWINDOW_H
54