User interface update
[qtmeetings] / src / UserInterface / WindowManager.h
1 #ifndef WINDOWMANAGER_H_
2 #define WINDOWMANAGER_H_
3
4 #include <QMainWindow>
5 #include <QStack>
6
7 // Forward declarations
8 class ViewBase;
9 class QEvent;
10 class QSize;
11 class QDialog;
12 class QString;
13
14 //! UserInterface class. Manages displayed views.
15 /*!
16  * UserInterface class. WindowManager class is responsible for displaying views that inherit the
17  * ViewBase class. It also handles dialog showing. Depending on the views type the WindowManager
18  * can track the views events and restore previous view if the current on is ObservedView. This
19  * is a handy mechanism for screensaver etc.
20  */
21 class WindowManager : public QMainWindow
22 {
23         Q_OBJECT
24
25 public:
26         //! Constructor.
27         /*!
28          * Constructor of WindowManager.
29          */
30         WindowManager( QWidget *aParent = 0 );
31         //! Destructor.
32         virtual ~WindowManager();
33         
34         virtual bool event(QEvent *event);
35
36 signals:
37         //! Request current status of the room.
38         /*!
39          * Signal is emitted when there is need to check current status of room aRoom.
40          * \param aRoom Meetingroom which status is requested.
41          */
42         void eventDetected();
43         
44         //! The view size is changed.
45         /*!
46          * This signal is emitted when the window managers view changes,
47          * i.e. it received resized QEvent.
48          * \param The new view size.
49          */
50         void viewResized(const QSize &newSize, const QSize &oldSize);
51         
52         //! Previous view is restored.
53         /*!
54          * This signal is emitted when previously stored view is
55          * restored. This happens when view with type ViewMode::ObservedView
56          * is shown and it receives an event that initiates the view
57          * restoring chain.
58          */
59         void previousViewRestored();
60         
61         void showSettingsClicked();
62
63         void dialogActivated();
64         void dialogDeactivated();
65
66 public slots:
67         //! Shows the view.
68         /*!
69          * Show view that inherits ViewBase class. If the views parent is not
70          * the WindowManager it will changed within this method. Depeding on the
71          * views type the currently active view might be stored and restored
72          * when specific event occurs in the view to be displayed.
73          */
74         void showView( ViewBase *view );
75         
76         //! Shows modal dialog.
77         /*!
78          * Shows modal dialog. Emits dialogActivated() signal prior calling
79          * QDialog's exec() method and emits dialogDeactivated signal when
80          * the exec() method returns.
81          */
82         void showDialog( QDialog *aDialog, bool blocking = true, bool aSendSignal = true );
83         
84         //! View event is detected.
85         /*!
86          * WindowManager connects this slot to ViewBase classes eventDetected()
87          * signal and either emits eventDetected() signal if the current views
88          * type is ViewMode::NormalView or restores possible previous view
89          * if the current views type is ViewMode::ObservedView.
90          */
91         void viewEventDetected();
92         
93         void setFullscreen();
94         
95         void error( const QString &aErrorMessage );
96
97 private:
98         //! Name of the application.
99         QString iApplicationName;
100         
101         //! Currently active view.
102         ViewBase *iCurrentView;
103         
104         //! Stack of views previously displayed.
105         QStack<ViewBase *> iViewList;
106
107     QAction *settingsAction;
108 };
109
110 #endif /*WINDOWMANAGER_H_*/