1 #ifndef WINDOWMANAGER_H_
2 #define WINDOWMANAGER_H_
8 #include "PasswordDialog.h"
9 #include "DeviceManager.h"
12 class RoomStatusIndicatorWidget;
13 class WeeklyViewWidget;
15 class MeetingInfoDialog;
20 //! UserInterface class. Behaves as a proxy between the user interface and application's business logic.
22 * UserInterface class. Controls the whole user interface, starting with displaying the appropriate
23 * views. It behaves as a proxy between the user interface and application's business logic, it connects
24 * the specified components together and forwards the data to the correct place. It also manages the correct
25 * appearance of current views on the screen.
27 class WindowManager : public QObject
34 * Constructor of WindowManager.
35 * \param aConfiguration The pointer to configuration.
37 WindowManager( Configuration *aConfiguration );
39 virtual ~WindowManager();
41 * Displays an error message
42 * \param aErrorMessage Message to be displayd
44 void error( const QString &aErrorMessage );
45 //! Updates the rooms status.
47 * Forwards the signal of changed status to current view.
48 * \param aRoom Room which status is changed.
49 * \param aStatus Current status of room.
50 * \param aTime Time when status is changed.
52 void roomStatusChanged( Room *aRoom, Room::Status aStatus, QTime aTime );
53 //! Shows the password dialog.
55 * Shows the password dialog.
56 * \param aAdminPassword The correct password.
57 * \param aMessage The message to be shown in the password dialog.
59 void showPasswordDialog( QByteArray aAdminPassword, const QString &aMessage );
60 //! Closes the password dialog.
62 * Closes the password dialog.
64 void closePasswordDialog();
65 //! Displays the weekly view.
67 * Displays the weekly view.
69 void showWeeklyView();
70 //! Displays the meeting info dialog.
72 * Displays the meeting info dialog.
73 * \param aMeeting Meeting to be displayd
75 void showMeetingInfo( Meeting *aMeeting );
76 //! Returns the pointer to the weekly view.
78 * Returns the pointer to the weekly view.
80 WeeklyViewWidget * weeklyView();
81 //! Switches the views to full screen.
83 * Switches the views to full screen.
86 //! Shows the progress bar.
88 * Starts showing the progress bar.
89 * \param aText The text to be shown in progress bar.
90 * \param aCancellable Is the Cancel button visible. By default not visible.
92 void showProgressBar( const QString &aText, bool aCancellable = false );
93 //! Closes the progress bar.
95 * Closes the progress bar.
97 void closeProgressBar();
99 void insertMeeting( Meeting *aMeeting );
101 void deleteMeeting( Meeting *aMeeting );
104 //! Request current status of the room.
106 * Signal is emitted when there is need to check current status of room aRoom.
107 * \param aRoom Meetingroom which status is requested.
109 void roomStatusInfoNeeded( Room *aRoom );
110 //! Indicate that some user event has happened.
112 * Signal is emitted if some user event has happened.
114 void observedEventDetected();
115 //! Meeting activated.
117 * Signal is emitted when a meeting is clicked by the user.
118 * \param aMeeting actived meeting.
120 void meetingActivated( Meeting *aMeeting );
121 //! Signals if the shown week has been changed.
123 * Signal. Emitted if the shown week has been changed.
124 * \param aDate The first date of the shown week.
126 void shownWeekChanged( QDate aDate );
127 //! Signals change of the meeting room.
129 * Signal is emitted when meeting room is changed.
130 * \param aRoom Selected meeting room.
132 void currentRoomChanged( Room *aRoom );
133 //! Signals when the password dialog buttons are clicked.
135 * Signal is emitted when the password dialog buttons are clicked.
136 * \param aPasswordStatus The status of the password.
138 void passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus );
139 //! Signals when the cancel button in the progress bar is clicked.
141 * Signal is emitted when the cancel button in the progress bar is clicked.
143 void progressBarCancelled();
146 //! Slot for displaying the screensaver (room status view).
148 * Slot. Displays the screensaver.
150 void showRoomStatus();
151 //! Slot for updating the time.
153 * Slot. Forwards the signal of changed time to current view.
154 * \param aCurrentDateTime Current date and time.
156 void distributeDateTimeInfo( QDateTime aCurrentDateTime );
158 void updateProgressBar( const QString &aMessage );
161 //! Displays the settings view
162 void showSettingsView();
165 //! Name of the application.
166 QString iApplicationName;
167 //! Defines whether the views should be shown as full screen
169 //! Pointer to the configuration.
170 Configuration *iConfiguration;
171 //! Pointer to the weekly view.
172 WeeklyViewWidget *iWeeklyView;
173 //! Pointer to the screensaver (room status view).
174 RoomStatusIndicatorWidget *iRoomStatusView;
175 //! Pointer to the meeting info dialog
176 MeetingInfoDialog *iMeetingInfo;
177 //! Pointer to the settings view
178 SettingsView *iSettingsView;
179 //! Pointer to the progress bar
180 ProgressBar *iProgressBar;
181 //! Pointer to the password dialog.
182 PasswordDialog *iPasswordDialog;
186 #endif /*WINDOWMANAGER_H_*/