Update to support both Qt 4 and Qt 5
[apps/thermostat-demo.git] / mainwindow.h
1 #ifndef MAINWINDOW_H\r
2 #define MAINWINDOW_H\r
3 \r
4 #include <qglobal.h>\r
5 #include <QtGui>\r
6 #include "webdata.h"\r
7 \r
8 #if QT_VERSION >= 0x050000\r
9 \r
10 #include <QPushButton>\r
11 \r
12 #endif\r
13 \r
14 \r
15 class GlobalSettings;\r
16 class OptionsWidget;\r
17 class ThermostatWidget;\r
18 class WeatherWidget;\r
19 \r
20 class MainWindow : public QWidget\r
21 {\r
22     Q_OBJECT\r
23 public:\r
24     explicit MainWindow(QWidget *parent = 0);\r
25 \r
26     int m_currentThermostatTemp;\r
27 protected:\r
28     void paintEvent(QPaintEvent *);\r
29     \r
30 signals:\r
31     \r
32 public slots:\r
33     void loadWebData();\r
34     void closeEvent(QCloseEvent *);\r
35     void setWebData(WeatherData* weatherData);\r
36     void webDataFailed();\r
37     QHash<QString, QVariant> processCommand(QHash<QString, QVariant> command);\r
38 \r
39 private:\r
40     WebData *webData;\r
41     QPushButton *energyButton;\r
42     QPushButton *timeButton;\r
43     QPushButton *dateButton;\r
44     QPushButton *closeButton;\r
45     QTimer *clockTimer;\r
46     QDateTime dateTime;\r
47     void setBackground(QString, QTime);\r
48     WeatherWidget *weatherWidget;\r
49     OptionsWidget *optionsWidget;\r
50     ThermostatWidget *thermostatWidget;\r
51 \r
52     GlobalSettings* m_globalSettings;\r
53 \r
54     void createScreenLayout();\r
55 \r
56 private slots:\r
57     void updateClock();\r
58     void energySaving(bool);\r
59     \r
60 };\r
61 \r
62 #endif // MAINWINDOW_H\r