Re-implemented the showing of meetings (Task id 1166). Corrected the errortable order...
[qtmeetings] / src / UserInterface / WindowManager.h
1 #ifndef WINDOWMANAGER_H_
2 #define WINDOWMANAGER_H_
3
4 #include <QObject>
5 #include <QTime>
6 #include "Room.h"
7 #include "Meeting.h"
8 #include "PasswordDialog.h"
9 #include "DeviceManager.h"
10
11 class QTimer;
12 class RoomStatusIndicatorWidget;
13 class WeeklyViewWidget;
14 class Engine;
15 class MeetingInfoDialog;
16 class SettingsView;
17 class ProgressBar;
18 class Configuration;
19
20 //! UserInterface class. Behaves as a proxy between the user interface and application's business logic.
21 /*!
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.
26  */
27 class WindowManager : public QObject
28 {
29         Q_OBJECT
30
31 public:
32         //! Constructor.
33         /*!
34          * Constructor of WindowManager.
35          * \param aConfiguration The pointer to configuration.
36          */
37         WindowManager( Configuration *aConfiguration );
38         //! Destructor.
39         virtual ~WindowManager();
40         /*!
41          * Displays an error message
42          * \param aErrorMessage Message to be displayd
43          */
44         void error( const QString &aErrorMessage );
45         //! Updates the rooms status.
46         /*! 
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.
51          */
52         void roomStatusChanged( Room *aRoom, Room::Status aStatus, QTime aTime );
53         //! Shows the password dialog.
54         /*!
55          * Shows the password dialog.
56          * \param aAdminPassword The correct password.
57          * \param aMessage The message to be shown in the password dialog.
58          */
59         void showPasswordDialog( QByteArray aAdminPassword, const QString &aMessage );
60         //! Closes the password dialog.
61         /*!
62          * Closes the password dialog.
63          */
64         void closePasswordDialog();
65         //! Displays the weekly view.
66         /*!
67          * Displays the weekly view.
68          */
69         void showWeeklyView();
70         //! Displays the meeting info dialog.
71         /*!
72          * Displays the meeting info dialog. 
73          * \param aMeeting Meeting to be displayd
74          */
75         void showMeetingInfo( Meeting *aMeeting );
76         //! Returns the pointer to the weekly view. 
77         /*!
78          * Returns the pointer to the weekly view.
79          */
80         WeeklyViewWidget * weeklyView();
81         //! Switches the views to full screen.
82         /*!
83          * Switches the views to full screen.
84          */
85         void fullScreen();
86         //! Shows the progress bar.
87         /*!
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.
91          */
92         void showProgressBar( const QString &aText, bool aCancellable = false );
93         //! Closes the progress bar.
94         /*!
95          * Closes the progress bar.
96          */
97         void closeProgressBar();
98         //! Sends the refresh command to weekly view widget.
99         /*!
100          * Sends the refresh command to weekly view widget.
101          * \param aMeetings The list of meetings.
102          */
103         void refreshMeetings( const QList<Meeting*> &aMeetings );
104         
105 signals:
106         //! Request current status of the room.
107         /*!
108          * Signal is emitted when there is need to check current status of room aRoom.
109          * \param aRoom Meetingroom which status is requested.
110          */
111         void roomStatusInfoNeeded( Room *aRoom );
112         //! Indicate that some user event has happened.
113         /*!
114          * Signal is emitted if some user event has happened.
115          */
116         void observedEventDetected();
117         //! Meeting activated.
118         /*!
119          * Signal is emitted when a meeting is clicked by the user.
120          * \param aMeeting actived meeting.
121          */
122         void meetingActivated( Meeting *aMeeting );
123         //! Signals if the shown week has been changed.
124         /*!
125          * Signal. Emitted if the shown week has been changed.
126          * \param aDate The first date of the shown week.
127          */
128         void shownWeekChanged( QDate aDate );
129         //! Signals change of the meeting room.
130         /*!
131          * Signal is emitted when meeting room is changed.
132          * \param aRoom Selected meeting room.
133          */
134         void currentRoomChanged( Room *aRoom );
135         //! Signals when the password dialog buttons are clicked.
136         /*!
137          * Signal is emitted when the password dialog buttons are clicked.
138          * \param aPasswordStatus The status of the password.
139          */
140         void passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus );
141         //! Signals when the cancel button in the progress bar is clicked.
142         /*!
143          * Signal is emitted when the cancel button in the progress bar is clicked.
144          */
145         void progressBarCancelled();
146         
147 public slots:
148         //! Slot for displaying the screensaver (room status view).
149         /*!
150          * Slot. Displays the screensaver.
151          */
152         void showRoomStatus();
153         //! Slot for updating the time.
154         /*!
155          * Slot. Forwards the signal of changed time to current view.
156          * \param aCurrentDateTime Current date and time.
157          */
158         void distributeDateTimeInfo( QDateTime aCurrentDateTime );
159         
160         void updateProgressBar( const QString &aMessage );
161         
162 private slots:
163         //! Displays the settings view
164         void showSettingsView();
165
166 private:
167         //! Name of the application.
168         QString iApplicationName;
169         //! Defines whether the views should be shown as full screen 
170         bool iFullScreen;
171         //! Pointer to the configuration.
172         Configuration *iConfiguration;
173         //! Pointer to the weekly view.
174         WeeklyViewWidget *iWeeklyView;
175         //! Pointer to the screensaver (room status view).
176         RoomStatusIndicatorWidget *iRoomStatusView;
177         //! Pointer to the meeting info dialog
178         MeetingInfoDialog *iMeetingInfo;
179         //! Pointer to the settings view
180         SettingsView *iSettingsView;
181         //! Pointer to the progress bar
182         ProgressBar *iProgressBar;
183         //! Pointer to the password dialog.
184         PasswordDialog *iPasswordDialog;
185
186 };
187
188 #endif /*WINDOWMANAGER_H_*/