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