17 #ifndef UBUNTU_TOUCH_DISPATCHER_H
18 #define UBUNTU_TOUCH_DISPATCHER_H
20 #include "UbuntuGesturesQmlGlobal.h"
32 class UBUNTUGESTURESQML_EXPORT TouchDispatcher {
36 void setTargetItem(QQuickItem *target);
37 QQuickItem *targetItem() {
return m_targetItem; }
39 void dispatch(QTouchDevice *device,
40 Qt::KeyboardModifiers modifiers,
41 const QList<QTouchEvent::TouchPoint> &touchPoints,
49 DeliveringTouchEvents,
50 DeliveringMouseEvents,
54 void dispatchTouchBegin(
56 Qt::KeyboardModifiers modifiers,
57 const QList<QTouchEvent::TouchPoint> &touchPoints,
60 void dispatchAsTouch(QEvent::Type eventType,
62 Qt::KeyboardModifiers modifiers,
63 const QList<QTouchEvent::TouchPoint> &touchPoints,
68 Qt::KeyboardModifiers modifiers,
69 const QList<QTouchEvent::TouchPoint> &touchPoints,
72 static void transformTouchPoints(QList<QTouchEvent::TouchPoint> &touchPoints,
const QTransform &transform);
73 QTouchEvent *createQTouchEvent(QEvent::Type eventType,
75 Qt::KeyboardModifiers modifiers,
76 const QList<QTouchEvent::TouchPoint> &touchPoints,
79 QMouseEvent *touchToMouseEvent(QEvent::Type type,
const QTouchEvent::TouchPoint &p,
80 ulong timestamp, Qt::KeyboardModifiers modifiers,
bool transformNeeded =
true);
82 bool checkIfDoubleClicked(ulong newPressEventTimestamp);
84 void setStatus(Status status);
86 static QEvent::Type resolveEventType(
const QList<QTouchEvent::TouchPoint> &touchPoints);
88 QPointer<QQuickItem> m_targetItem;
93 ulong m_touchMousePressTimestamp;
96 #endif // UBUNTU_TOUCH_DISPATCHER_H