Switched to using QStateMachine.
[simple-xmbc-rem] / src / mainwindow.h
1 // checksum 0x9a77 version 0x20001
2 /*
3   This file was generated by the Mobile Qt Application wizard of Qt Creator.
4   MainWindow is a convenience class containing mobile device specific code
5   such as screen orientation handling.
6   It is recommended not to modify this file, since newer versions of Qt Creator
7   may offer an updated version of it.
8 */
9
10 #ifndef MAINWINDOW_H
11 #define MAINWINDOW_H
12
13 #include <QtGui/QMainWindow>
14 #include <QtNetwork/QTcpSocket>
15 #include <QStateMachine>
16 #include <QState>
17
18 namespace Ui {
19     class MainWindow;
20 }
21
22 class MainWindow : public QMainWindow
23 {
24     Q_OBJECT
25 public:
26     enum ScreenOrientation {
27         ScreenOrientationLockPortrait,
28         ScreenOrientationLockLandscape,
29         ScreenOrientationAuto
30     };
31
32     explicit MainWindow(QWidget *parent = 0);
33     virtual ~MainWindow();
34
35     void setOrientation(ScreenOrientation orientation);
36     void showExpanded();
37
38 private slots:
39     // manual connected slots
40     void connectToServer();
41     void disconnectFromServer();
42
43     // auto-connected slots
44     void on_actionSetup_triggered();
45
46 private:
47     void pendingNetworkOperation(bool pending);
48
49     void createStates();
50     void createTransitions();
51     void createConnections();
52
53     QTcpSocket serverSocket;
54     Ui::MainWindow *ui;
55
56     QStateMachine stateMachine;
57     QState* disconnectedState;
58     QState* connectedState;
59     QState* disconnectingState;
60     QState* normalState;
61     QState* connectingState;
62 };
63
64 #endif // MAINWINDOW_H