Incorporated changes from bus project.
[ptas] / src / ui.h
1 #ifndef UI_H
2 #define UI_H
3
4 #include <QObject>
5
6 class QMainWindow;
7 class QWidget;
8 class QTableWidget;
9 class QButtonGroup;
10 class QHBoxLayout;
11 class QVBoxLayout;
12 class QGridLayout;
13 class QMenu;
14 class QAction;
15 class Location;
16
17 class Ui : public QObject
18 {
19     Q_OBJECT
20
21 public:
22     Ui();
23     ~Ui();
24     void setupUi(QMainWindow *mainWindow);
25
26     enum {
27         HomeButtonId=0,
28         WorkButtonId=1
29     };
30
31     enum {
32         ScreenWidth=800,
33         ScreenHeight=480
34     };
35
36     QMainWindow *m_mainWindow;
37     QWidget *m_centralWidget;
38     QButtonGroup *m_destinationButtons;
39     QButtonGroup *m_routeButtons;
40     QVBoxLayout *m_routeStack;
41     QTableWidget *m_routeDetailTable;
42     QVBoxLayout *m_mainLayout;
43     QGridLayout *m_buttonLayout;
44     QMenu       *m_menu;
45     QAction     *m_toggleFakeGpsAction;
46     QAction     *m_useLiveGpsAction;
47     bool        m_usingFakeGps;
48     QString     m_fakeLocationLabel;
49
50 Q_SIGNALS:
51     void homeAddressChanged(QString address);
52     void workAddressChanged(QString address);
53     void fakeGpsPressed(const QString &fakeLocationLabel);
54     void liveGpsPressed();
55
56 private Q_SLOTS:
57     void setHomeAddress();
58     void setWorkAddress();
59     void toggleFakeGps();
60     void setBusy(bool busy);
61
62 private:
63     void useFakeGps();
64     void useLiveGps();
65     void setAddress(const QString &label);
66 };
67 #endif //UI_H