Merge branch 'master' into dev_local
[qtmeetings] / src / BusinessLogic / UIManager.h
1 #ifndef UIMANAGER_H_
2 #define UIMANAGER_H_
3
4 #include <QObject>
5 #include <QList>
6
7 #include "Meeting.h"
8 #include "DeviceManager.h"
9 #include "PasswordDialog.h"
10
11 class Engine;
12 class WindowManager;
13 class WeeklyViewWidget;
14 class SettingsView;
15 class RoomStatusIndicatorWidget;
16 class ProgressBar;
17 class MeetingInfoDialog;
18 class CommunicationManager;
19 class QDateTime;
20
21 //! User Interface manager class.
22 /*!
23  * User Interface manager class that is responsible for handling
24  * UI actions. It creates the needed views and connects signals
25  * accordingly. All interactions with the UI is handled by this
26  * class. The Engine class handles the basic logic and does not
27  * know or care about the UI and this class does not know or care
28  * about the basic logic only UI related actions (signals, events etc.).
29  */
30 class UIManager : public QObject
31 {
32         Q_OBJECT
33         
34 public:
35         UIManager( Engine *aEngine, WindowManager *aWindowManager );
36         virtual ~UIManager();
37         
38         //! Connects Device Managers signals.
39         /*!
40          * This method connects Device Managers signals directly to UI
41          * components or to it selft.
42          */
43         void connectDeviceManager( DeviceManager *aDeviceManager );
44         //! Connects Communication Managers signals.
45         /*!
46          * This method connects Communication Managers signals directly to UI
47          * components or to it selft.
48          */
49         void connectCommunicationManager( CommunicationManager *aCommunicationManager );
50         //! Shows the main view.
51         /*!
52          * Makes the main view visible trough WindowManager.
53          */
54         void showMainView();
55
56 signals:
57         
58 public slots:
59
60         //! Handles setting view request.
61         /*!
62          * Handles request to show settings view. Makes the
63          * view visible and stops the idle time counter.
64          */
65         void settingsViewRequest();
66         //! Handles setting views ok clicked.
67         /*!
68          * Handles the setting views Ok button clicked
69          * signal. Sets the weekly view visible and starts
70          * the idle time counter.
71          */
72         void settingsOkClicked();
73         //! Handles room status indicator view request.
74         /*!
75          * Handles the request to show room status indicator
76          * view. Sets the view visible and stops the idle
77          * time counter. The WindowManager handles restoring
78          * what ever view was previously visible.
79          */
80         void roomStatusIndicatorRequested();
81         //! Handles previousViewRestored signal.
82         /*!
83          * Handles the restoring of previous view. This is usually
84          * signaled by WindowManager when room status indicator
85          * view is being hidden.
86          */
87         void previousViewRestored();
88         //! Handle change mode order.
89         /*!
90          * Handles change mode order. Displays the password query dialog
91          * and waits for its response.
92          */
93         void changeModeOrdered( DeviceManager::OperationMode aMode );
94         //! Handles select room change.
95         /*!
96          * Handles the changing of currently select room. Engine is requested
97          * to start fetching new meetings for currently shown week.
98          */
99         void currentRoomChanged( Room *aRoom );
100
101         //! Shows any view specific indicators for connection error
102         void connectionLost();
103         
104         //! Removes any view specific indicators for connection error
105         void connectionEstablished();
106         
107         
108 private slots:
109
110         void meetingsFetched( const QList<Meeting*> &aMeetings );
111         void meetingDetailsFetched( Meeting &aDetailedMeeting );
112         void progressBarCancelled();
113         void updateTime( QDateTime aDateTime );
114         void passwordEntered( PasswordDialog::PasswordStatus aStatus );
115         void showMeetingProgressBar( Meeting *aMeeting );
116         void updateProgressBarText( const QString &aText );
117         void hideProgressBar();
118
119 private:
120         
121         void createWeeklyView();
122         void createSettingsView();
123         void createRoomStatusIndicator();
124         void createPasswordDialog();
125         void createProgressBar();
126         void createMeetingInfoDialog();
127         
128 private:
129         Engine *iEngine;
130         WindowManager *iWindowManager;
131         
132         WeeklyViewWidget *iWeeklyView;
133         SettingsView *iSettingsView;
134         RoomStatusIndicatorWidget *iRoomStatusIndicator;
135         PasswordDialog *iPasswordDialog;
136         ProgressBar *iProgressBar;
137         MeetingInfoDialog *iMeetingInfo;
138 };
139
140 #endif /*UIMANAGER_H_*/