| 1 | // Copyright (C) 2016 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 QSTANDARDGESTURES_P_H |
| 5 | #define QSTANDARDGESTURES_P_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 for the convenience |
| 12 | // of other Qt classes. 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 <QtWidgets/private/qtwidgetsglobal_p.h> |
| 19 | #include "qgesturerecognizer.h" |
| 20 | #include "private/qgesture_p.h" |
| 21 | |
| 22 | #ifndef QT_NO_GESTURES |
| 23 | |
| 24 | QT_BEGIN_NAMESPACE |
| 25 | |
| 26 | class QPanGestureRecognizer : public QGestureRecognizer |
| 27 | { |
| 28 | public: |
| 29 | explicit QPanGestureRecognizer(int pointCount = 2) : m_pointCount(pointCount) {} |
| 30 | |
| 31 | QGesture *create(QObject *target) override; |
| 32 | QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override; |
| 33 | void reset(QGesture *state) override; |
| 34 | |
| 35 | private: |
| 36 | const int m_pointCount; |
| 37 | }; |
| 38 | |
| 39 | class QPinchGestureRecognizer : public QGestureRecognizer |
| 40 | { |
| 41 | public: |
| 42 | QPinchGestureRecognizer(); |
| 43 | |
| 44 | QGesture *create(QObject *target) override; |
| 45 | QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override; |
| 46 | void reset(QGesture *state) override; |
| 47 | }; |
| 48 | |
| 49 | class QSwipeGestureRecognizer : public QGestureRecognizer |
| 50 | { |
| 51 | public: |
| 52 | QSwipeGestureRecognizer(); |
| 53 | |
| 54 | QGesture *create(QObject *target) override; |
| 55 | QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override; |
| 56 | void reset(QGesture *state) override; |
| 57 | }; |
| 58 | |
| 59 | class QTapGestureRecognizer : public QGestureRecognizer |
| 60 | { |
| 61 | public: |
| 62 | QTapGestureRecognizer(); |
| 63 | |
| 64 | QGesture *create(QObject *target) override; |
| 65 | QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override; |
| 66 | void reset(QGesture *state) override; |
| 67 | }; |
| 68 | |
| 69 | class QTapAndHoldGestureRecognizer : public QGestureRecognizer |
| 70 | { |
| 71 | public: |
| 72 | QTapAndHoldGestureRecognizer(); |
| 73 | |
| 74 | QGesture *create(QObject *target) override; |
| 75 | QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override; |
| 76 | void reset(QGesture *state) override; |
| 77 | }; |
| 78 | |
| 79 | QT_END_NAMESPACE |
| 80 | |
| 81 | #endif // QT_NO_GESTURES |
| 82 | |
| 83 | #endif // QSTANDARDGESTURES_P_H |
| 84 | |