Merged
[qtmeetings] / src / UserInterface / WindowManager.h
1 <<<<<<< HEAD:src/UserInterface/WindowManager.h
2 #ifndef WINDOWMANAGER_H_\r
3 #define WINDOWMANAGER_H_\r
4 \r
5 #include <QWidget>\r
6 #include <QStack>\r
7 \r
8 // Forward declarations\r
9 class ViewBase;\r
10 class QEvent;\r
11 class QSize;\r
12 class QDialog;\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 &);\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 *dialog );\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 private:\r
94         //! Name of the application.\r
95         QString iApplicationName;\r
96         \r
97         //! Currently active view.\r
98         ViewBase *iCurrentView;\r
99         \r
100         //! Stack of views previously displayed.\r
101         QStack<ViewBase *> iViewList;\r
102 \r
103 };\r
104 \r
105 #endif /*WINDOWMANAGER_H_*/\r
106 =======
107 #ifndef WINDOWMANAGER_H_
108 #define WINDOWMANAGER_H_
109
110 #include <QObject>
111 #include <QTime>
112 #include "Room.h"
113 #include "Meeting.h"
114 #include "PasswordDialog.h"
115 #include "DeviceManager.h"
116
117 class QTimer;
118 class RoomStatusIndicatorWidget;
119 class WeeklyViewWidget;
120 class Engine;
121 class MeetingInfoDialog;
122 class SettingsView;
123 class ProgressBar;
124 class Configuration;
125
126 //! UserInterface class. Behaves as a proxy between the user interface and application's business logic.
127 /*!
128  * UserInterface class. Controls the whole user interface, starting with displaying the appropriate
129  * views. It behaves as a proxy between the user interface and application's business logic, it connects
130  * the specified components together and forwards the data to the correct place. It also manages the correct
131  * appearance of current views on the screen.
132  */
133 class WindowManager : public QObject
134 {
135         Q_OBJECT
136
137 public:
138         //! Constructor.
139         /*!
140          * Constructor of WindowManager.
141          * \param aConfiguration The pointer to configuration.
142          */
143         WindowManager( Configuration *aConfiguration );
144         //! Destructor.
145         virtual ~WindowManager();
146         /*!
147          * Displays an error message
148          * \param aErrorMessage Message to be displayd
149          */
150         void error( const QString &aErrorMessage );
151         //! Updates the rooms status.
152         /*! 
153          * Forwards the signal of changed status to current view.
154          * \param aRoom Room which status is changed.
155          * \param aStatus Current status of room.
156          * \param aTime Time when status is changed.
157          */
158         void roomStatusChanged( Room *aRoom, Room::Status aStatus, QTime aTime );
159         //! Shows the password dialog.
160         /*!
161          * Shows the password dialog.
162          * \param aAdminPassword The correct password.
163          * \param aMessage The message to be shown in the password dialog.
164          */
165         void showPasswordDialog( QByteArray aAdminPassword, const QString &aMessage );
166         //! Closes the password dialog.
167         /*!
168          * Closes the password dialog.
169          */
170         void closePasswordDialog();
171         //! Displays the weekly view.
172         /*!
173          * Displays the weekly view.
174          */
175         void showWeeklyView();
176         //! Displays the meeting info dialog.
177         /*!
178          * Displays the meeting info dialog. 
179          * \param aMeeting Meeting to be displayd
180          */
181         void showMeetingInfo( Meeting *aMeeting );
182         //! Returns the pointer to the weekly view. 
183         /*!
184          * Returns the pointer to the weekly view.
185          */
186         WeeklyViewWidget * weeklyView();
187         //! Switches the views to full screen.
188         /*!
189          * Switches the views to full screen.
190          */
191         void fullScreen();
192         //! Shows the progress bar.
193         /*!
194          * Starts showing the progress bar.
195          * \param aText The text to be shown in progress bar.
196          *  \param aCancellable Is the Cancel button visible. By default not visible.
197          */
198         void showProgressBar( const QString &aText, bool aCancellable = false );
199         //! Closes the progress bar.
200         /*!
201          * Closes the progress bar.
202          */
203         void closeProgressBar();
204         
205         void insertMeeting( Meeting *aMeeting );
206         
207         void deleteMeeting( Meeting *aMeeting );
208
209 signals:
210         //! Request current status of the room.
211         /*!
212          * Signal is emitted when there is need to check current status of room aRoom.
213          * \param aRoom Meetingroom which status is requested.
214          */
215         void roomStatusInfoNeeded( Room *aRoom );
216         //! Indicate that some user event has happened.
217         /*!
218          * Signal is emitted if some user event has happened.
219          */
220         void observedEventDetected();
221         //! Meeting activated.
222         /*!
223          * Signal is emitted when a meeting is clicked by the user.
224          * \param aMeeting actived meeting.
225          */
226         void meetingActivated( Meeting *aMeeting );
227         //! Signals if the shown week has been changed.
228         /*!
229          * Signal. Emitted if the shown week has been changed.
230          * \param aDate The first date of the shown week.
231          */
232         void shownWeekChanged( QDate aDate );
233         //! Signals change of the meeting room.
234         /*!
235          * Signal is emitted when meeting room is changed.
236          * \param aRoom Selected meeting room.
237          */
238         void currentRoomChanged( Room *aRoom );
239         //! Signals when the password dialog buttons are clicked.
240         /*!
241          * Signal is emitted when the password dialog buttons are clicked.
242          * \param aPasswordStatus The status of the password.
243          */
244         void passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus );
245         //! Signals when the cancel button in the progress bar is clicked.
246         /*!
247          * Signal is emitted when the cancel button in the progress bar is clicked.
248          */
249         void progressBarCancelled();
250         
251 public slots:
252         //! Slot for displaying the screensaver (room status view).
253         /*!
254          * Slot. Displays the screensaver.
255          */
256         void showRoomStatus();
257         //! Slot for updating the time.
258         /*!
259          * Slot. Forwards the signal of changed time to current view.
260          * \param aCurrentDateTime Current date and time.
261          */
262         void distributeDateTimeInfo( QDateTime aCurrentDateTime );
263         
264         void updateProgressBar( const QString &aMessage );
265         
266 private slots:
267         //! Displays the settings view
268         void showSettingsView();
269
270 private:
271         //! Name of the application.
272         QString iApplicationName;
273         //! Defines whether the views should be shown as full screen 
274         bool iFullScreen;
275         //! Pointer to the configuration.
276         Configuration *iConfiguration;
277         //! Pointer to the weekly view.
278         WeeklyViewWidget *iWeeklyView;
279         //! Pointer to the screensaver (room status view).
280         RoomStatusIndicatorWidget *iRoomStatusView;
281         //! Pointer to the meeting info dialog
282         MeetingInfoDialog *iMeetingInfo;
283         //! Pointer to the settings view
284         SettingsView *iSettingsView;
285         //! Pointer to the progress bar
286         ProgressBar *iProgressBar;
287         //! Pointer to the password dialog.
288         PasswordDialog *iPasswordDialog;
289
290 };
291
292 #endif /*WINDOWMANAGER_H_*/
293 >>>>>>> deb6aee06a80416a24a64c2ac6349a2341acdc39:src/UserInterface/WindowManager.h