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