qtmeetings sources to Maemo garage
[qtmeetings] / src / UserInterface / Components / ObservedWidget.h
1 #ifndef OBSERVEDWIDGET_H_
2 #define OBSERVEDWIDGET_H_
3
4 #include <QWidget>
5
6 class QKeyEvent;
7 class QTabletEvent;
8 class QMouseEvent;
9 class QMouseEvent;
10 class QMouseEvent;
11
12 //! Userinterface class. Provides event monitoring.
13 /*!
14  * UserInterface class. Provides event monitoring. The observed events are mouse, key and
15  * tablet events. They are used to detect user interadtion with the specified UI element.
16  */
17 class ObservedWidget : public QWidget
18 {
19         Q_OBJECT
20
21 public:
22         //! Constructor.
23         /*!
24          * Constructor to initialize ObserverWidget instance.
25          * \param aParent The pointer to the parent widget. Optional.
26          */
27         ObservedWidget( QWidget *aParent = 0 );
28         //! Destructor.
29         virtual ~ObservedWidget();
30
31         //! Enables/disables monitoring of the key events.
32         /*!
33          * Enables/disables monitoring of the key events. Enables if the flag is true; otherwise, disables.
34          * \param aIsMonitored The flag.
35          */
36         void setKeyEventsMonitored( bool aIsMonitored );
37         //! Enables/disables monitoring of the mouse events.
38         /*!
39          * Enables/disables monitoring of the mouse events. Enables if the flag is true; otherwise, disables.
40          * \param aIsMonitored The flag.
41          */
42         void setMouseEventsMonitored( bool aIsMonitored );
43         //! Enables/disables monitoring of the tablet events.
44         /*!
45          * Enables/disables monitoring of the tablet events. Enables if the flag is true; otherwise, disables.
46          * \param aIsMonitored The flag.
47          */
48         void setTabletEventsMonitored( bool aIsMonitored );
49
50 signals:
51         //! Signals if any of the monitored events is detected..
52         /*!
53          * Signal. Emitted if any of the monitored events is detected.
54          */
55         void observedEventDetected();
56
57 protected:
58         //! Filters the detected events. ( TODO: improve event filtering!!! )
59         /*!
60          * Filters the detected events. If an event is being filtered, nothing else can see/detect it anymore,
61          * it is like if it did not even exist.
62          * \param aWatched_object The watched object.
63          * \param aEvent The event which is being filtered.
64          * \return True if the event was filtered; otherwise, false.
65          */
66         virtual bool eventFilter( QObject* aWatched_object, QEvent* aEvent );
67
68 private:
69         bool iKeyEventsMonitored;
70         bool iMouseEventsMonitored;
71         bool iTabletEventsMonitored;
72
73 };
74
75 #endif /*OBSERVEDWIDGET_H_*/