X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2FUserInterface%2FWindowManager.h;h=a3f7440e010efdd8ebd5450b617a71d5ec9698c1;hb=fca5bd9a27f0bbb3c60ae13218a503c5df26c897;hp=2f460505e0202ba82d1b59d412e40b994676322a;hpb=bd153701307613c96e7bdf070cf32b0cbc6ae834;p=qtmeetings diff --git a/src/UserInterface/WindowManager.h b/src/UserInterface/WindowManager.h index 2f46050..a3f7440 100644 --- a/src/UserInterface/WindowManager.h +++ b/src/UserInterface/WindowManager.h @@ -1,107 +1,114 @@ -#ifndef WINDOWMANAGER_H_ -#define WINDOWMANAGER_H_ - -#include -#include - -// Forward declarations -class ViewBase; -class QEvent; -class QSize; -class QDialog; -class QString; - -//! UserInterface class. Manages displayed views. -/*! - * UserInterface class. WindowManager class is responsible for displaying views that inherit the - * ViewBase class. It also handles dialog showing. Depending on the views type the WindowManager - * can track the views events and restore previous view if the current on is ObservedView. This - * is a handy mechanism for screensaver etc. - */ -class WindowManager : public QWidget -{ - Q_OBJECT - -public: - //! Constructor. - /*! - * Constructor of WindowManager. - */ - WindowManager( QWidget *aParent = 0 ); - //! Destructor. - virtual ~WindowManager(); - - virtual bool event(QEvent *event); - -signals: - //! Request current status of the room. - /*! - * Signal is emitted when there is need to check current status of room aRoom. - * \param aRoom Meetingroom which status is requested. - */ - void eventDetected(); - - //! The view size is changed. - /*! - * This signal is emitted when the window managers view changes, - * i.e. it received resized QEvent. - * \param The new view size. - */ - void viewResized(const QSize &newSize, const QSize &oldSize); - - //! Previous view is restored. - /*! - * This signal is emitted when previously stored view is - * restored. This happens when view with type ViewMode::ObservedView - * is shown and it receives an event that initiates the view - * restoring chain. - */ - void previousViewRestored(); - - void dialogActivated(); - void dialogDeactivated(); - -public slots: - //! Shows the view. - /*! - * Show view that inherits ViewBase class. If the views parent is not - * the WindowManager it will changed within this method. Depeding on the - * views type the currently active view might be stored and restored - * when specific event occurs in the view to be displayed. - */ - void showView( ViewBase *view ); - - //! Shows modal dialog. - /*! - * Shows modal dialog. Emits dialogActivated() signal prior calling - * QDialog's exec() method and emits dialogDeactivated signal when - * the exec() method returns. - */ - void showDialog( QDialog *aDialog, bool blocking = true, bool aSendSignal = true ); - - //! View event is detected. - /*! - * WindowManager connects this slot to ViewBase classes eventDetected() - * signal and either emits eventDetected() signal if the current views - * type is ViewMode::NormalView or restores possible previous view - * if the current views type is ViewMode::ObservedView. - */ - void viewEventDetected(); - - void setFullscreen(); - - void error( const QString &aErrorMessage ); - -private: - //! Name of the application. - QString iApplicationName; - - //! Currently active view. - ViewBase *iCurrentView; - - //! Stack of views previously displayed. - QStack iViewList; - -}; - -#endif /*WINDOWMANAGER_H_*/ +#ifndef WINDOWMANAGER_H_ +#define WINDOWMANAGER_H_ + +#include +#include + +// Forward declarations +class ViewBase; +class QEvent; +class QSize; +class QDialog; +class QString; + +//! UserInterface class. Manages displayed views. +/*! + * UserInterface class. WindowManager class is responsible for displaying views that inherit the + * ViewBase class. It also handles dialog showing. Depending on the views type the WindowManager + * can track the views events and restore previous view if the current on is ObservedView. This + * is a handy mechanism for screensaver etc. + */ +class WindowManager : public QWidget +{ + Q_OBJECT + +public: + //! Constructor. + /*! + * Constructor of WindowManager. + */ + WindowManager( QWidget *aParent = 0 ); + //! Destructor. + virtual ~WindowManager(); + + virtual bool event(QEvent *event); + + + //! Shows any view specific indicators for connection error + void connectionLost(); + + //! Removes any view specific indicators for connection error + void connectionEstablished(); + +signals: + //! Request current status of the room. + /*! + * Signal is emitted when there is need to check current status of room aRoom. + * \param aRoom Meetingroom which status is requested. + */ + void eventDetected(); + + //! The view size is changed. + /*! + * This signal is emitted when the window managers view changes, + * i.e. it received resized QEvent. + * \param The new view size. + */ + void viewResized(const QSize &newSize, const QSize &oldSize); + + //! Previous view is restored. + /*! + * This signal is emitted when previously stored view is + * restored. This happens when view with type ViewMode::ObservedView + * is shown and it receives an event that initiates the view + * restoring chain. + */ + void previousViewRestored(); + + void dialogActivated(); + void dialogDeactivated(); + +public slots: + //! Shows the view. + /*! + * Show view that inherits ViewBase class. If the views parent is not + * the WindowManager it will changed within this method. Depeding on the + * views type the currently active view might be stored and restored + * when specific event occurs in the view to be displayed. + */ + void showView( ViewBase *view ); + + //! Shows modal dialog. + /*! + * Shows modal dialog. Emits dialogActivated() signal prior calling + * QDialog's exec() method and emits dialogDeactivated signal when + * the exec() method returns. + */ + void showDialog( QDialog *aDialog, bool blocking = true, bool aSendSignal = true ); + + //! View event is detected. + /*! + * WindowManager connects this slot to ViewBase classes eventDetected() + * signal and either emits eventDetected() signal if the current views + * type is ViewMode::NormalView or restores possible previous view + * if the current views type is ViewMode::ObservedView. + */ + void viewEventDetected(); + + void setFullscreen(); + + void error( const QString &aErrorMessage ); + +private: + //! Name of the application. + QString iApplicationName; + + //! Currently active view. + ViewBase *iCurrentView; + + //! Stack of views previously displayed. + QStack iViewList; + +}; + +#endif /*WINDOWMANAGER_H_*/