b2ef8e59fcd44f44d29c72d6802d696377d2915b
[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         //! Shows the progress bar.
56         /*!
57          * Shows the progress bar with given text.
58          */
59         void showProgressBar( QString aText );
60
61 signals:
62         
63 public slots:
64
65         //! Handles setting view request.
66         /*!
67          * Handles request to show settings view. Makes the
68          * view visible and stops the idle time counter.
69          */
70         void settingsViewRequest();
71         //! Handles setting views ok clicked.
72         /*!
73          * Handles the setting views Ok button clicked
74          * signal. Sets the weekly view visible and starts
75          * the idle time counter.
76          */
77         void settingsOkClicked();
78         //! Handles room status indicator view request.
79         /*!
80          * Handles the request to show room status indicator
81          * view. Sets the view visible and stops the idle
82          * time counter. The WindowManager handles restoring
83          * what ever view was previously visible.
84          */
85         void roomStatusIndicatorRequested();
86         //! Handles previousViewRestored signal.
87         /*!
88          * Handles the restoring of previous view. This is usually
89          * signaled by WindowManager when room status indicator
90          * view is being hidden.
91          */
92         void previousViewRestored();
93         //! Handle change mode order.
94         /*!
95          * Handles change mode order. Displays the password query dialog
96          * and waits for its response.
97          */
98         void changeModeOrdered( DeviceManager::OperationMode aMode );
99         //! Handles select room change.
100         /*!
101          * Handles the changing of currently select room. Engine is requested
102          * to start fetching new meetings for currently shown week.
103          */
104         void currentRoomChanged( Room *aRoom );
105         
106 private slots:
107
108         void meetingsFetched( const QList<Meeting*> &aMeetings );
109         void meetingDetailsFetched( Meeting &aDetailedMeeting );
110         void progressBarCancelled();
111         void updateTime( QDateTime aDateTime );
112         void passwordEntered( PasswordDialog::PasswordStatus aStatus );
113         void showMeetingProgressBar( Meeting *aMeeting );
114         void updateProgressBarText( const QString &aText );
115         void hideProgressBar();
116
117 private:
118         
119         void createWeeklyView();
120         void createSettingsView();
121         void createRoomStatusIndicator();
122         void createPasswordDialog();
123         void createProgressBar();
124         void createMeetingInfoDialog();
125         
126 private:
127         Engine *iEngine;
128         WindowManager *iWindowManager;
129         
130         WeeklyViewWidget *iWeeklyView;
131         SettingsView *iSettingsView;
132         RoomStatusIndicatorWidget *iRoomStatusIndicator;
133         PasswordDialog *iPasswordDialog;
134         ProgressBar *iProgressBar;
135         MeetingInfoDialog *iMeetingInfo;
136 };
137
138 #endif /*UIMANAGER_H_*/