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 );
103 //! Shows any view specific indicators for connection error
104 void connectionLost();
106 //! Removes any view specific indicators for connection error
107 void connectionEstablished();
110 //! Request current status of the room.
112 * Signal is emitted when there is need to check current status of room aRoom.
113 * \param aRoom Meetingroom which status is requested.
115 void roomStatusInfoNeeded( Room *aRoom );
116 //! Indicate that some user event has happened.
118 * Signal is emitted if some user event has happened.
120 void observedEventDetected();
121 //! Meeting activated.
123 * Signal is emitted when a meeting is clicked by the user.
124 * \param aMeeting actived meeting.
126 void meetingActivated( Meeting *aMeeting );
127 //! Signals if the shown week has been changed.
129 * Signal. Emitted if the shown week has been changed.
130 * \param aDate The first date of the shown week.
132 void shownWeekChanged( QDate aDate );
133 //! Signals change of the meeting room.
135 * Signal is emitted when meeting room is changed.
136 * \param aRoom Selected meeting room.
138 void currentRoomChanged( Room *aRoom );
139 //! Signals when the password dialog buttons are clicked.
141 * Signal is emitted when the password dialog buttons are clicked.
142 * \param aPasswordStatus The status of the password.
144 void passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus );
145 //! Signals when the cancel button in the progress bar is clicked.
147 * Signal is emitted when the cancel button in the progress bar is clicked.
149 void progressBarCancelled();
152 //! Slot for displaying the screensaver (room status view).
154 * Slot. Displays the screensaver.
156 void showRoomStatus();
157 //! Slot for updating the time.
159 * Slot. Forwards the signal of changed time to current view.
160 * \param aCurrentDateTime Current date and time.
162 void distributeDateTimeInfo( QDateTime aCurrentDateTime );
164 void updateProgressBar( const QString &aMessage );
167 //! Displays the settings view
168 void showSettingsView();
171 //! Name of the application.
172 QString iApplicationName;
173 //! Defines whether the views should be shown as full screen
175 //! Pointer to the configuration.
176 Configuration *iConfiguration;
177 //! Pointer to the weekly view.
178 WeeklyViewWidget *iWeeklyView;
179 //! Pointer to the screensaver (room status view).
180 RoomStatusIndicatorWidget *iRoomStatusView;
181 //! Pointer to the meeting info dialog
182 MeetingInfoDialog *iMeetingInfo;
183 //! Pointer to the settings view
184 SettingsView *iSettingsView;
185 //! Pointer to the progress bar
186 ProgressBar *iProgressBar;
187 //! Pointer to the password dialog.
188 PasswordDialog *iPasswordDialog;
192 #endif /*WINDOWMANAGER_H_*/