Merge branch 'dev_itkonma'
[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 setting views cancel clicked.
74         /*!
75          * Handles the setting views Cancel button clicked
76          * signal. Sets the weekly view visible and starts
77          * the idle time counter.
78          */
79         void settingsCancelClicked();
80         //! Handles room status indicator view request.
81         /*!
82          * Handles the request to show room status indicator
83          * view. Sets the view visible and stops the idle
84          * time counter. The WindowManager handles restoring
85          * what ever view was previously visible.
86          */
87         void roomStatusIndicatorRequested();
88         //! Handles previousViewRestored signal.
89         /*!
90          * Handles the restoring of previous view. This is usually
91          * signaled by WindowManager when room status indicator
92          * view is being hidden.
93          */
94         void previousViewRestored();
95         //! Handle change mode order.
96         /*!
97          * Handles change mode order. Displays the password query dialog
98          * and waits for its response.
99          */
100         void changeModeOrdered( DeviceManager::OperationMode aMode );
101         //! Handles select room change.
102         /*!
103          * Handles the changing of currently select room. Engine is requested
104          * to start fetching new meetings for currently shown week.
105          */
106         void currentRoomChanged( Room *aRoom );
107
108         //! Shows any view specific indicators for connection error
109         void connectionLost();
110         
111         //! Removes any view specific indicators for connection error
112         void connectionEstablished();
113         
114         
115 private slots:
116
117         void meetingsFetched( const QList<Meeting*> &aMeetings );
118         void meetingDetailsFetched( Meeting &aDetailedMeeting );
119         void progressBarCancelled();
120         void updateTime( QDateTime aDateTime );
121         void passwordEntered( PasswordDialog::PasswordStatus aStatus );
122         void showMeetingProgressBar( Meeting *aMeeting );
123         void updateProgressBarText( const QString &aText );
124         void hideProgressBar();
125
126 private:
127         
128         void createWeeklyView();
129         void createSettingsView();
130         void createRoomStatusIndicator();
131         void createPasswordDialog();
132         void createProgressBar();
133         void createMeetingInfoDialog();
134         
135 private:
136         Engine *iEngine;
137         WindowManager *iWindowManager;
138         
139         WeeklyViewWidget *iWeeklyView;
140         SettingsView *iSettingsView;
141         RoomStatusIndicatorWidget *iRoomStatusIndicator;
142         PasswordDialog *iPasswordDialog;
143         ProgressBar *iProgressBar;
144         MeetingInfoDialog *iMeetingInfo;
145 };
146
147 #endif /*UIMANAGER_H_*/