54 class QEvent; |
55 class QEvent; |
55 class QGesture; |
56 class QGesture; |
56 class Q_GUI_EXPORT QGestureRecognizer |
57 class Q_GUI_EXPORT QGestureRecognizer |
57 { |
58 { |
58 public: |
59 public: |
59 enum ResultFlags |
60 enum ResultFlag |
60 { |
61 { |
61 Ignore = 0x0001, |
62 Ignore = 0x0001, |
62 NotGesture = 0x0002, |
|
63 MaybeGesture = 0x0004, |
|
64 GestureTriggered = 0x0008, // Gesture started or updated |
|
65 GestureFinished = 0x0010, |
|
66 |
63 |
67 ResultState_Mask = 0x00ff, |
64 MayBeGesture = 0x0002, |
|
65 TriggerGesture = 0x0004, |
|
66 FinishGesture = 0x0008, |
|
67 CancelGesture = 0x0010, |
|
68 |
|
69 ResultState_Mask = 0x00ff, |
68 |
70 |
69 ConsumeEventHint = 0x0100, |
71 ConsumeEventHint = 0x0100, |
70 // StoreEventHint = 0x0200, |
72 // StoreEventHint = 0x0200, |
71 // ReplayStoredEventsHint = 0x0400, |
73 // ReplayStoredEventsHint = 0x0400, |
72 // DiscardStoredEventsHint = 0x0800, |
74 // DiscardStoredEventsHint = 0x0800, |
73 |
75 |
74 ResultHint_Mask = 0xff00 |
76 ResultHint_Mask = 0xff00 |
75 }; |
77 }; |
76 Q_DECLARE_FLAGS(Result, ResultFlags) |
78 Q_DECLARE_FLAGS(Result, ResultFlag) |
77 |
79 |
78 QGestureRecognizer(); |
80 QGestureRecognizer(); |
79 virtual ~QGestureRecognizer(); |
81 virtual ~QGestureRecognizer(); |
80 |
82 |
81 virtual QGesture *createGesture(QObject *target); |
83 virtual QGesture *create(QObject *target); |
82 virtual QGestureRecognizer::Result filterEvent(QGesture *state, QObject *watched, QEvent *event) = 0; |
84 virtual Result recognize(QGesture *state, QObject *watched, |
|
85 QEvent *event) = 0; |
|
86 virtual void reset(QGesture *state); |
83 |
87 |
84 virtual void reset(QGesture *state); |
88 static Qt::GestureType registerRecognizer(QGestureRecognizer *recognizer); |
|
89 static void unregisterRecognizer(Qt::GestureType type); |
85 }; |
90 }; |
86 |
91 |
87 Q_DECLARE_OPERATORS_FOR_FLAGS(QGestureRecognizer::Result) |
92 Q_DECLARE_OPERATORS_FOR_FLAGS(QGestureRecognizer::Result) |
88 |
93 |
89 QT_END_NAMESPACE |
94 QT_END_NAMESPACE |