1 | // Copyright (C) 2018 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QQUICKPOINTERSINGLEHANDLER_H |
5 | #define QQUICKPOINTERSINGLEHANDLER_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include "qquickhandlerpoint_p.h" |
19 | #include "qquickpointerdevicehandler_p.h" |
20 | |
21 | QT_BEGIN_NAMESPACE |
22 | |
23 | class QQuickSinglePointHandlerPrivate; |
24 | |
25 | class Q_QUICK_PRIVATE_EXPORT QQuickSinglePointHandler : public QQuickPointerDeviceHandler |
26 | { |
27 | Q_OBJECT |
28 | Q_PROPERTY(QQuickHandlerPoint point READ point NOTIFY pointChanged FINAL) |
29 | |
30 | public: |
31 | explicit QQuickSinglePointHandler(QQuickItem *parent = nullptr); |
32 | |
33 | QQuickHandlerPoint point() const; |
34 | |
35 | Q_SIGNALS: |
36 | void pointChanged(); |
37 | |
38 | protected: |
39 | QQuickSinglePointHandler(QQuickSinglePointHandlerPrivate &dd, QQuickItem *parent); |
40 | |
41 | bool wantsPointerEvent(QPointerEvent *event) override; |
42 | void handlePointerEventImpl(QPointerEvent *event) override; |
43 | virtual void handleEventPoint(QPointerEvent *event, QEventPoint &point); |
44 | |
45 | QEventPoint ¤tPoint(QPointerEvent *ev); |
46 | void onGrabChanged(QQuickPointerHandler *grabber, QPointingDevice::GrabTransition transition, QPointerEvent *event, QEventPoint &point) override; |
47 | |
48 | void setIgnoreAdditionalPoints(bool v = true); |
49 | |
50 | void moveTarget(QPointF pos, QEventPoint &point); |
51 | |
52 | void setPointId(int id); |
53 | |
54 | Q_DECLARE_PRIVATE(QQuickSinglePointHandler) |
55 | }; |
56 | |
57 | QT_END_NAMESPACE |
58 | |
59 | #endif // QQUICKPOINTERSINGLEHANDLER_H |
60 |