1 #ifndef OBSERVEDWIDGET_H_
2 #define OBSERVEDWIDGET_H_
12 //! Userinterface class. Provides event monitoring.
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.
17 class ObservedWidget : public QWidget
24 * Constructor to initialize ObserverWidget instance.
25 * \param aParent The pointer to the parent widget. Optional.
27 ObservedWidget( QWidget *aParent = 0 );
29 virtual ~ObservedWidget();
31 //! Enables/disables monitoring of the key events.
33 * Enables/disables monitoring of the key events. Enables if the flag is true; otherwise, disables.
34 * \param aIsMonitored The flag.
36 void setKeyEventsMonitored( bool aIsMonitored );
37 //! Enables/disables monitoring of the mouse events.
39 * Enables/disables monitoring of the mouse events. Enables if the flag is true; otherwise, disables.
40 * \param aIsMonitored The flag.
42 void setMouseEventsMonitored( bool aIsMonitored );
43 //! Enables/disables monitoring of the tablet events.
45 * Enables/disables monitoring of the tablet events. Enables if the flag is true; otherwise, disables.
46 * \param aIsMonitored The flag.
48 void setTabletEventsMonitored( bool aIsMonitored );
51 //! Signals if any of the monitored events is detected..
53 * Signal. Emitted if any of the monitored events is detected.
55 void observedEventDetected();
58 //! Filters the detected events. ( TODO: improve event filtering!!! )
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.
66 virtual bool eventFilter( QObject* aWatched_object, QEvent* aEvent );
69 bool iKeyEventsMonitored;
70 bool iMouseEventsMonitored;
71 bool iTabletEventsMonitored;
75 #endif /*OBSERVEDWIDGET_H_*/