Task #1170 Progress bar for meeting details pop-up
[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         
99         void insertMeeting( Meeting *aMeeting );
100         
101         void deleteMeeting( Meeting *aMeeting );
102
103 signals:
104         //! Request current status of the room.
105         /*!
106          * Signal is emitted when there is need to check current status of room aRoom.
107          * \param aRoom Meetingroom which status is requested.
108          */
109         void roomStatusInfoNeeded( Room *aRoom );
110         //! Indicate that some user event has happened.
111         /*!
112          * Signal is emitted if some user event has happened.
113          */
114         void observedEventDetected();
115         //! Meeting activated.
116         /*!
117          * Signal is emitted when a meeting is clicked by the user.
118          * \param aMeeting actived meeting.
119          */
120         void meetingActivated( Meeting *aMeeting );
121         //! Signals if the shown week has been changed.
122         /*!
123          * Signal. Emitted if the shown week has been changed.
124          * \param aDate The first date of the shown week.
125          */
126         void shownWeekChanged( QDate aDate );
127         //! Signals change of the meeting room.
128         /*!
129          * Signal is emitted when meeting room is changed.
130          * \param aRoom Selected meeting room.
131          */
132         void currentRoomChanged( Room *aRoom );
133         //! Signals when the password dialog buttons are clicked.
134         /*!
135          * Signal is emitted when the password dialog buttons are clicked.
136          * \param aPasswordStatus The status of the password.
137          */
138         void passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus );
139         //! Signals when the cancel button in the progress bar is clicked.
140         /*!
141          * Signal is emitted when the cancel button in the progress bar is clicked.
142          */
143         void progressBarCancelled();
144         
145 public slots:
146         //! Slot for displaying the screensaver (room status view).
147         /*!
148          * Slot. Displays the screensaver.
149          */
150         void showRoomStatus();
151         //! Slot for updating the time.
152         /*!
153          * Slot. Forwards the signal of changed time to current view.
154          * \param aCurrentDateTime Current date and time.
155          */
156         void distributeDateTimeInfo( QDateTime aCurrentDateTime );
157         
158         void updateProgressBar( const QString &aMessage );
159         
160 private slots:
161         //! Displays the settings view
162         void showSettingsView();
163
164 private:
165         //! Name of the application.
166         QString iApplicationName;
167         //! Defines whether the views should be shown as full screen 
168         bool iFullScreen;
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;
183
184 };
185
186 #endif /*WINDOWMANAGER_H_*/