Got something working
[qtmeetings] / src / UserInterface / WindowManager.h
1 #ifndef WINDOWMANAGER_H_\r
2 #define WINDOWMANAGER_H_\r
3 \r
4 #include <QWidget>\r
5 #include <QStack>\r
6 \r
7 // Forward declarations\r
8 class ViewBase;\r
9 class QEvent;\r
10 class QSize;\r
11 class QDialog;\r
12 class QString;\r
13 \r
14 //! UserInterface class. Manages displayed views.\r
15 /*!\r
16  * UserInterface class. WindowManager class is responsible for displaying views that inherit the\r
17  * ViewBase class. It also handles dialog showing. Depending on the views type the WindowManager\r
18  * can track the views events and restore previous view if the current on is ObservedView. This\r
19  * is a handy mechanism for screensaver etc.\r
20  */\r
21 class WindowManager : public QWidget\r
22 {\r
23         Q_OBJECT\r
24 \r
25 public:\r
26         //! Constructor.\r
27         /*!\r
28          * Constructor of WindowManager.\r
29          */\r
30         WindowManager( QWidget *aParent = 0 );\r
31         //! Destructor.\r
32         virtual ~WindowManager();\r
33         \r
34         virtual bool event(QEvent *event);\r
35 \r
36 signals:\r
37         //! Request current status of the room.\r
38         /*!\r
39          * Signal is emitted when there is need to check current status of room aRoom.\r
40          * \param aRoom Meetingroom which status is requested.\r
41          */\r
42         void eventDetected();\r
43         \r
44         //! The view size is changed.\r
45         /*!\r
46          * This signal is emitted when the window managers view changes,\r
47          * i.e. it received resized QEvent.\r
48          * \param The new view size.\r
49          */\r
50         void viewResized(const QSize &newSize, const QSize &oldSize);\r
51         \r
52         //! Previous view is restored.\r
53         /*!\r
54          * This signal is emitted when previously stored view is\r
55          * restored. This happens when view with type ViewMode::ObservedView\r
56          * is shown and it receives an event that initiates the view\r
57          * restoring chain.\r
58          */\r
59         void previousViewRestored();\r
60         \r
61         void dialogActivated();\r
62         void dialogDeactivated();\r
63 \r
64 public slots:\r
65         //! Shows the view.\r
66         /*!\r
67          * Show view that inherits ViewBase class. If the views parent is not\r
68          * the WindowManager it will changed within this method. Depeding on the\r
69          * views type the currently active view might be stored and restored\r
70          * when specific event occurs in the view to be displayed.\r
71          */\r
72         void showView( ViewBase *view );\r
73         \r
74         //! Shows modal dialog.\r
75         /*!\r
76          * Shows modal dialog. Emits dialogActivated() signal prior calling\r
77          * QDialog's exec() method and emits dialogDeactivated signal when\r
78          * the exec() method returns.\r
79          */\r
80         void showDialog( QDialog *aDialog, bool blocking = true, bool aSendSignal = true );\r
81         \r
82         //! View event is detected.\r
83         /*!\r
84          * WindowManager connects this slot to ViewBase classes eventDetected()\r
85          * signal and either emits eventDetected() signal if the current views\r
86          * type is ViewMode::NormalView or restores possible previous view\r
87          * if the current views type is ViewMode::ObservedView.\r
88          */\r
89         void viewEventDetected();\r
90         \r
91         void setFullscreen();\r
92         \r
93         void error( const QString &aErrorMessage );\r
94 \r
95 private:\r
96         //! Name of the application.\r
97         QString iApplicationName;\r
98         \r
99         //! Currently active view.\r
100         ViewBase *iCurrentView;\r
101         \r
102         //! Stack of views previously displayed.\r
103         QStack<ViewBase *> iViewList;\r
104 \r
105 };\r
106 \r
107 #endif /*WINDOWMANAGER_H_*/\r