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(QEvent::Type eventType,
41 Qt::KeyboardModifiers modifiers,
42 const QList<QTouchEvent::TouchPoint> &touchPoints,
46 void dispatchTouchBegin(
48 Qt::KeyboardModifiers modifiers,
49 const QList<QTouchEvent::TouchPoint> &touchPoints,
52 void dispatchAsTouch(QEvent::Type eventType,
54 Qt::KeyboardModifiers modifiers,
55 const QList<QTouchEvent::TouchPoint> &touchPoints,
60 Qt::KeyboardModifiers modifiers,
61 const QList<QTouchEvent::TouchPoint> &touchPoints,
64 static void transformTouchPoints(QList<QTouchEvent::TouchPoint> &touchPoints,
const QTransform &transform);
65 QTouchEvent *createQTouchEvent(QEvent::Type eventType,
67 Qt::KeyboardModifiers modifiers,
68 const QList<QTouchEvent::TouchPoint> &touchPoints,
71 QMouseEvent *touchToMouseEvent(QEvent::Type type,
const QTouchEvent::TouchPoint &p,
72 ulong timestamp, Qt::KeyboardModifiers modifiers,
bool transformNeeded =
true);
74 bool checkIfDoubleClicked(ulong newPressEventTimestamp);
76 QPointer<QQuickItem> m_targetItem;
80 DeliveringTouchEvents,
81 DeliveringMouseEvents,
86 ulong m_touchMousePressTimestamp;
89 #endif // UBUNTU_TOUCH_DISPATCHER_H