Re-factored the basic idea of the application: Engine is the main class that ownsWind...
[qtmeetings] / src / UserInterface / WindowManager.h
1 #ifndef WINDOWMANAGER_H_\r
2 #define WINDOWMANAGER_H_\r
3 \r
4 #include <QObject>\r
5 #include <QTime>\r
6 #include "Room.h"\r
7 #include "Meeting.h"\r
8 #include "PasswordDialog.h"\r
9 #include "DeviceManager.h"\r
10 \r
11 class QTimer;\r
12 class RoomStatusIndicatorWidget;\r
13 class WeeklyViewWidget;\r
14 class Engine;\r
15 class MeetingInfoDialog;\r
16 class SettingsView;\r
17 class ProgressBar;\r
18 class Configuration;\r
19 \r
20 //! UserInterface class. Behaves as a proxy between the user interface and application's business logic.\r
21 /*!\r
22  * UserInterface class. Controls the whole user interface, starting with displaying the appropriate\r
23  * views. It behaves as a proxy between the user interface and application's business logic, it connects\r
24  * the specified components together and forwards the data to the correct place. It also manages the correct\r
25  * appearance of current views on the screen.\r
26  */\r
27 class WindowManager : public QObject\r
28 {\r
29         Q_OBJECT\r
30 \r
31 public:\r
32         //! Constructor.\r
33         /*!\r
34          * Constructor of WindowManager.\r
35          * \param aConfiguration The pointer to configuration.\r
36          */\r
37         WindowManager( Configuration *aConfiguration );\r
38         //! Destructor.\r
39         virtual ~WindowManager();\r
40         /*!\r
41          * Displays an error message\r
42          * \param aErrorMessage Message to be displayd\r
43          */\r
44         void error( const QString &aErrorMessage );\r
45         //! Updates the rooms status.\r
46         /*! \r
47          * Forwards the signal of changed status to current view.\r
48          * \param aRoom Room which status is changed.\r
49          * \param aStatus Current status of room.\r
50          * \param aTime Time when status is changed.\r
51          */\r
52         void roomStatusChanged( Room *aRoom, Room::Status aStatus, QTime aTime );\r
53         //! Shows the password dialog.\r
54         /*!\r
55          * Shows the password dialog.\r
56          * \param aAdminPassword The correct password.\r
57          * \param aMessage The message to be shown in the password dialog.\r
58          */\r
59         void showPasswordDialog( QByteArray aAdminPassword, const QString &aMessage );\r
60         //! Displays the weekly view.\r
61         /*!\r
62          * Displays the weekly view.\r
63          */\r
64         void showWeeklyView();\r
65         //! Displays the meeting info dialog.\r
66         /*!\r
67          * Displays the meeting info dialog. \r
68          * \param aMeeting Meeting to be displayd\r
69          */\r
70         void showMeetingInfo( Meeting *aMeeting );\r
71         //! Returns the pointer to the weekly view. \r
72         /*!\r
73          * Returns the pointer to the weekly view.\r
74          */\r
75         WeeklyViewWidget * weeklyView();\r
76         //! Switches the views to full screen.\r
77         /*!\r
78          * Switches the views to full screen.\r
79          */\r
80         void fullScreen();\r
81         \r
82         void insertMeeting( Meeting *aMeeting );\r
83         \r
84         void deleteMeeting( Meeting *aMeeting );\r
85 \r
86 signals:\r
87         //! Request current status of the room.\r
88         /*!\r
89          * Signal is emitted when there is need to check current status of room aRoom.\r
90          * \param aRoom Meetingroom which status is requested.\r
91          */\r
92         void roomStatusInfoNeeded( Room *aRoom );\r
93         //! Indicate that some user event has happened.\r
94         /*!\r
95          * Signal is emitted if some user event has happened.\r
96          */\r
97         void observedEventDetected();\r
98         //! Meeting activated.\r
99         /*!\r
100          * Signal is emitted when a meeting is clicked by the user.\r
101          * \param aMeeting actived meeting.\r
102          */\r
103         void meetingActivated( Meeting *aMeeting );\r
104         //! Signals if the shown week has been changed.\r
105         /*!\r
106          * Signal. Emitted if the shown week has been changed.\r
107          * \param aDate The first date of the shown week.\r
108          */\r
109         void shownWeekChanged( QDate aDate );\r
110         //! Signals change of the meeting room.\r
111         /*!\r
112          * Signal is emitted when meeting room is changed.\r
113          * \param aRoom Selected meeting room.\r
114          */\r
115         void currentRoomChanged( Room *aRoom );\r
116         \r
117 public slots:\r
118         //! Slot for displaying the screensaver (room status view).\r
119         /*!\r
120          * Slot. Displays the screensaver.\r
121          */\r
122         void showRoomStatus();\r
123         //! Slot for updating the time.\r
124         /*!\r
125          * Slot. Forwards the signal of changed time to current view.\r
126          * \param aCurrentDateTime Current date and time.\r
127          */\r
128         void distributeDateTimeInfo( QDateTime aCurrentDateTime );\r
129         \r
130 private slots:\r
131         //! Displays the settings view\r
132         void showSettingsView();\r
133         //! Slot for receiving the status of the entered password\r
134         /*!\r
135          * Slot. Receives the status of the entered password and makes the DeviceManager to change the\r
136          * operation mode if the password is correct.\r
137          * \param aPasswordStatus The status of the password.\r
138          */\r
139         void passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus );\r
140         //! Slot for showing/hiding the progress bar.\r
141         /*!\r
142          * Slot. Starts showing or hides the progress bar.\r
143          * \param aText The text to be shown in progress bar.\r
144          * \param aStart to indicate whether the progress bar is wanted to shown or hidden\r
145          */\r
146         void progressBar( const QString &aText = "", bool aStart = false );\r
147 \r
148 private:\r
149         //! Name of the application.\r
150         QString iApplicationName;\r
151         //! Pointer to the configuration.\r
152         Configuration *iConfiguration;\r
153         //! Pointer to the weekly view.\r
154         WeeklyViewWidget *iWeeklyView;\r
155         //! Pointer to the screensaver (room status view).\r
156         RoomStatusIndicatorWidget *iRoomStatusView;\r
157         //! Pointer to the meeting info dialog\r
158         MeetingInfoDialog *iMeetingInfo;\r
159         //! Pointer to the settings view\r
160         SettingsView *iSettingsView;\r
161         //! Pointer to the progress bar\r
162         ProgressBar *iProgressBar;\r
163         //! Pointer to the password dialog.\r
164         PasswordDialog *iPasswordDialog;\r
165 \r
166 };\r
167 \r
168 #endif /*WINDOWMANAGER_H_*/\r