1 <<<<<<< HEAD:src/UserInterface/WindowManager.h
2 #ifndef WINDOWMANAGER_H_
\r
3 #define WINDOWMANAGER_H_
\r
8 // Forward declarations
\r
14 //! UserInterface class. Manages displayed views.
\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
21 class WindowManager : public QWidget
\r
28 * Constructor of WindowManager.
\r
30 WindowManager( QWidget *aParent = 0 );
\r
32 virtual ~WindowManager();
\r
34 virtual bool event(QEvent *event);
\r
37 //! Request current status of the room.
\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
42 void eventDetected();
\r
44 //! The view size is changed.
\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
50 void viewResized(const QSize &);
\r
52 //! Previous view is restored.
\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
59 void previousViewRestored();
\r
61 void dialogActivated();
\r
62 void dialogDeactivated();
\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
72 void showView( ViewBase *view );
\r
74 //! Shows modal dialog.
\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
80 void showDialog( QDialog *dialog );
\r
82 //! View event is detected.
\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
89 void viewEventDetected();
\r
91 void setFullscreen();
\r
94 //! Name of the application.
\r
95 QString iApplicationName;
\r
97 //! Currently active view.
\r
98 ViewBase *iCurrentView;
\r
100 //! Stack of views previously displayed.
\r
101 QStack<ViewBase *> iViewList;
\r
105 #endif /*WINDOWMANAGER_H_*/
\r
107 #ifndef WINDOWMANAGER_H_
108 #define WINDOWMANAGER_H_
114 #include "PasswordDialog.h"
115 #include "DeviceManager.h"
118 class RoomStatusIndicatorWidget;
119 class WeeklyViewWidget;
121 class MeetingInfoDialog;
126 //! UserInterface class. Behaves as a proxy between the user interface and application's business logic.
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.
133 class WindowManager : public QObject
140 * Constructor of WindowManager.
141 * \param aConfiguration The pointer to configuration.
143 WindowManager( Configuration *aConfiguration );
145 virtual ~WindowManager();
147 * Displays an error message
148 * \param aErrorMessage Message to be displayd
150 void error( const QString &aErrorMessage );
151 //! Updates the rooms status.
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.
158 void roomStatusChanged( Room *aRoom, Room::Status aStatus, QTime aTime );
159 //! Shows the password dialog.
161 * Shows the password dialog.
162 * \param aAdminPassword The correct password.
163 * \param aMessage The message to be shown in the password dialog.
165 void showPasswordDialog( QByteArray aAdminPassword, const QString &aMessage );
166 //! Closes the password dialog.
168 * Closes the password dialog.
170 void closePasswordDialog();
171 //! Displays the weekly view.
173 * Displays the weekly view.
175 void showWeeklyView();
176 //! Displays the meeting info dialog.
178 * Displays the meeting info dialog.
179 * \param aMeeting Meeting to be displayd
181 void showMeetingInfo( Meeting *aMeeting );
182 //! Returns the pointer to the weekly view.
184 * Returns the pointer to the weekly view.
186 WeeklyViewWidget * weeklyView();
187 //! Switches the views to full screen.
189 * Switches the views to full screen.
192 //! Shows the progress bar.
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.
198 void showProgressBar( const QString &aText, bool aCancellable = false );
199 //! Closes the progress bar.
201 * Closes the progress bar.
203 void closeProgressBar();
205 void insertMeeting( Meeting *aMeeting );
207 void deleteMeeting( Meeting *aMeeting );
210 //! Request current status of the room.
212 * Signal is emitted when there is need to check current status of room aRoom.
213 * \param aRoom Meetingroom which status is requested.
215 void roomStatusInfoNeeded( Room *aRoom );
216 //! Indicate that some user event has happened.
218 * Signal is emitted if some user event has happened.
220 void observedEventDetected();
221 //! Meeting activated.
223 * Signal is emitted when a meeting is clicked by the user.
224 * \param aMeeting actived meeting.
226 void meetingActivated( Meeting *aMeeting );
227 //! Signals if the shown week has been changed.
229 * Signal. Emitted if the shown week has been changed.
230 * \param aDate The first date of the shown week.
232 void shownWeekChanged( QDate aDate );
233 //! Signals change of the meeting room.
235 * Signal is emitted when meeting room is changed.
236 * \param aRoom Selected meeting room.
238 void currentRoomChanged( Room *aRoom );
239 //! Signals when the password dialog buttons are clicked.
241 * Signal is emitted when the password dialog buttons are clicked.
242 * \param aPasswordStatus The status of the password.
244 void passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus );
245 //! Signals when the cancel button in the progress bar is clicked.
247 * Signal is emitted when the cancel button in the progress bar is clicked.
249 void progressBarCancelled();
252 //! Slot for displaying the screensaver (room status view).
254 * Slot. Displays the screensaver.
256 void showRoomStatus();
257 //! Slot for updating the time.
259 * Slot. Forwards the signal of changed time to current view.
260 * \param aCurrentDateTime Current date and time.
262 void distributeDateTimeInfo( QDateTime aCurrentDateTime );
264 void updateProgressBar( const QString &aMessage );
267 //! Displays the settings view
268 void showSettingsView();
271 //! Name of the application.
272 QString iApplicationName;
273 //! Defines whether the views should be shown as full screen
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;
292 #endif /*WINDOWMANAGER_H_*/
293 >>>>>>> deb6aee06a80416a24a64c2ac6349a2341acdc39:src/UserInterface/WindowManager.h