summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qgesturerecognizer.h
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-02 18:26:44 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-03 10:26:08 (GMT)
commit93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827 (patch)
treeb4e677abcb3b69dc602e29fe113041895f1e0e5f /src/gui/kernel/qgesturerecognizer.h
parentcfcfae65778f2e1e7fc3936c66689e3685f1cc77 (diff)
downloadQt-93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827.zip
Qt-93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827.tar.gz
Qt-93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827.tar.bz2
Gesture api review.
Changes to the gesture api after the review. Reviewed-by: Jasmin Blanchette
Diffstat (limited to 'src/gui/kernel/qgesturerecognizer.h')
-rw-r--r--src/gui/kernel/qgesturerecognizer.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/gui/kernel/qgesturerecognizer.h b/src/gui/kernel/qgesturerecognizer.h
index a3c990d..4eebf7c 100644
--- a/src/gui/kernel/qgesturerecognizer.h
+++ b/src/gui/kernel/qgesturerecognizer.h
@@ -43,6 +43,7 @@
#define QGESTURERECOGNIZER_H
#include <QtCore/qglobal.h>
+#include <QtCore/qnamespace.h>
QT_BEGIN_HEADER
@@ -58,30 +59,34 @@ class Q_GUI_EXPORT QGestureRecognizer
public:
enum ResultFlag
{
- Ignore = 0x0001,
- NotGesture = 0x0002,
- MaybeGesture = 0x0004,
- GestureTriggered = 0x0008, // Gesture started or updated
- GestureFinished = 0x0010,
+ Ignore = 0x0001,
- ResultState_Mask = 0x00ff,
+ MayBeGesture = 0x0002,
+ TriggerGesture = 0x0004,
+ FinishGesture = 0x0008,
+ CancelGesture = 0x0010,
+
+ ResultState_Mask = 0x00ff,
ConsumeEventHint = 0x0100,
// StoreEventHint = 0x0200,
// ReplayStoredEventsHint = 0x0400,
// DiscardStoredEventsHint = 0x0800,
- ResultHint_Mask = 0xff00
+ ResultHint_Mask = 0xff00
};
Q_DECLARE_FLAGS(Result, ResultFlag)
QGestureRecognizer();
virtual ~QGestureRecognizer();
- virtual QGesture *createGesture(QObject *target);
- virtual QGestureRecognizer::Result filterEvent(QGesture *state, QObject *watched, QEvent *event) = 0;
-
+ virtual QGesture *create(QObject *target);
+ virtual Result recognize(QGesture *state, QObject *watched,
+ QEvent *event) = 0;
virtual void reset(QGesture *state);
+
+ static Qt::GestureType registerRecognizer(QGestureRecognizer *recognizer);
+ static void unregisterRecognizer(Qt::GestureType type);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QGestureRecognizer::Result)