Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/handlers/qquickpinchhandler_p.h |
Source code | Switch to Preprocessed file |
Line | Source | Count |
---|---|---|
1 | /**************************************************************************** | - |
2 | ** | - |
3 | ** Copyright (C) 2016 The Qt Company Ltd. | - |
4 | ** Contact: https://www.qt.io/licensing/ | - |
5 | ** | - |
6 | ** This file is part of the QtQuick module of the Qt Toolkit. | - |
7 | ** | - |
8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
9 | ** Commercial License Usage | - |
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
11 | ** accordance with the commercial license agreement provided with the | - |
12 | ** Software or, alternatively, in accordance with the terms contained in | - |
13 | ** a written agreement between you and The Qt Company. For licensing terms | - |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - |
15 | ** information use the contact form at https://www.qt.io/contact-us. | - |
16 | ** | - |
17 | ** GNU Lesser General Public License Usage | - |
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
19 | ** General Public License version 3 as published by the Free Software | - |
20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - |
21 | ** packaging of this file. Please review the following information to | - |
22 | ** ensure the GNU Lesser General Public License version 3 requirements | - |
23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - |
24 | ** | - |
25 | ** GNU General Public License Usage | - |
26 | ** Alternatively, this file may be used under the terms of the GNU | - |
27 | ** General Public License version 2.0 or (at your option) the GNU General | - |
28 | ** Public license version 3 or any later version approved by the KDE Free | - |
29 | ** Qt Foundation. The licenses are as published by the Free Software | - |
30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - |
31 | ** included in the packaging of this file. Please review the following | - |
32 | ** information to ensure the GNU General Public License requirements will | - |
33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - |
34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - |
35 | ** | - |
36 | ** $QT_END_LICENSE$ | - |
37 | ** | - |
38 | ****************************************************************************/ | - |
39 | - | |
40 | #ifndef QQUICKPINCHHANDLER_H | - |
41 | #define QQUICKPINCHHANDLER_H | - |
42 | - | |
43 | // | - |
44 | // W A R N I N G | - |
45 | // ------------- | - |
46 | // | - |
47 | // This file is not part of the Qt API. It exists purely as an | - |
48 | // implementation detail. This header file may change from version to | - |
49 | // version without notice, or even be removed. | - |
50 | // | - |
51 | // We mean it. | - |
52 | // | - |
53 | - | |
54 | #include "qquickitem.h" | - |
55 | #include "qevent.h" | - |
56 | #include "qquickmultipointhandler_p.h" | - |
57 | #include <private/qquicktranslate_p.h> | - |
58 | - | |
59 | QT_BEGIN_NAMESPACE | - |
60 | - | |
61 | class Q_AUTOTEST_EXPORT QQuickPinchHandler : public QQuickMultiPointHandler | - |
62 | { | - |
63 | Q_OBJECT | - |
64 | Q_PROPERTY(qreal minimumScale READ minimumScale WRITE setMinimumScale NOTIFY minimumScaleChanged) | - |
65 | Q_PROPERTY(qreal maximumScale READ maximumScale WRITE setMaximumScale NOTIFY maximumScaleChanged) | - |
66 | Q_PROPERTY(qreal minimumRotation READ minimumRotation WRITE setMinimumRotation NOTIFY minimumRotationChanged) | - |
67 | Q_PROPERTY(qreal maximumRotation READ maximumRotation WRITE setMaximumRotation NOTIFY maximumRotationChanged) | - |
68 | Q_PROPERTY(PinchOrigin pinchOrigin READ pinchOrigin WRITE setPinchOrigin NOTIFY pinchOriginChanged) | - |
69 | Q_PROPERTY(qreal scale READ scale NOTIFY updated) | - |
70 | Q_PROPERTY(qreal activeScale READ activeScale NOTIFY updated) | - |
71 | Q_PROPERTY(qreal rotation READ rotation NOTIFY updated) | - |
72 | Q_PROPERTY(QVector2D translation READ translation NOTIFY updated) | - |
73 | Q_PROPERTY(qreal minimumX READ minimumX WRITE setMinimumX NOTIFY minimumXChanged) | - |
74 | Q_PROPERTY(qreal maximumX READ maximumX WRITE setMaximumX NOTIFY maximumXChanged) | - |
75 | Q_PROPERTY(qreal minimumY READ minimumY WRITE setMinimumY NOTIFY minimumYChanged) | - |
76 | Q_PROPERTY(qreal maximumY READ maximumY WRITE setMaximumY NOTIFY maximumYChanged) | - |
77 | - | |
78 | public: | - |
79 | enum PinchOrigin { | - |
80 | FirstPoint, PinchCenter, TargetCenter | - |
81 | }; | - |
82 | Q_ENUM(PinchOrigin) | - |
83 | - | |
84 | explicit QQuickPinchHandler(QObject *parent = nullptr); | - |
85 | ~QQuickPinchHandler(); | - |
86 | - | |
87 | qreal minimumScale() const { return m_minimumScale; } never executed: return m_minimumScale; | 0 |
88 | void setMinimumScale(qreal minimumScale); | - |
89 | - | |
90 | qreal maximumScale() const { return m_maximumScale; } never executed: return m_maximumScale; | 0 |
91 | void setMaximumScale(qreal maximumScale); | - |
92 | - | |
93 | qreal minimumRotation() const { return m_minimumRotation; } never executed: return m_minimumRotation; | 0 |
94 | void setMinimumRotation(qreal minimumRotation); | - |
95 | - | |
96 | qreal maximumRotation() const { return m_maximumRotation; } never executed: return m_maximumRotation; | 0 |
97 | void setMaximumRotation(qreal maximumRotation); | - |
98 | - | |
99 | PinchOrigin pinchOrigin() const { return m_pinchOrigin; } never executed: return m_pinchOrigin; | 0 |
100 | void setPinchOrigin(PinchOrigin pinchOrigin); | - |
101 | - | |
102 | QVector2D translation() const { return m_activeTranslation; } never executed: return m_activeTranslation; | 0 |
103 | qreal scale() const { return m_accumulatedScale; } never executed: return m_accumulatedScale; | 0 |
104 | qreal activeScale() const { return m_activeScale; } executed 2 times by 1 test: return m_activeScale; Executed by:
| 2 |
105 | qreal rotation() const { return m_activeRotation; } executed 8 times by 1 test: return m_activeRotation; Executed by:
| 8 |
106 | qreal minimumX() const { return m_minimumX; } never executed: return m_minimumX; | 0 |
107 | void setMinimumX(qreal minX); | - |
108 | qreal maximumX() const { return m_maximumX; } never executed: return m_maximumX; | 0 |
109 | void setMaximumX(qreal maxX); | - |
110 | qreal minimumY() const { return m_minimumY; } never executed: return m_minimumY; | 0 |
111 | void setMinimumY(qreal minY); | - |
112 | qreal maximumY() const { return m_maximumY; } never executed: return m_maximumY; | 0 |
113 | void setMaximumY(qreal maxY); | - |
114 | - | |
115 | signals: | - |
116 | void minimumScaleChanged(); | - |
117 | void maximumScaleChanged(); | - |
118 | void minimumRotationChanged(); | - |
119 | void maximumRotationChanged(); | - |
120 | void minimumXChanged(); | - |
121 | void maximumXChanged(); | - |
122 | void minimumYChanged(); | - |
123 | void maximumYChanged(); | - |
124 | void pinchOriginChanged(); | - |
125 | void updated(); | - |
126 | - | |
127 | protected: | - |
128 | bool wantsPointerEvent(QQuickPointerEvent *event) override; | - |
129 | void onActiveChanged() override; | - |
130 | void handlePointerEventImpl(QQuickPointerEvent *event) override; | - |
131 | - | |
132 | private: | - |
133 | // properties | - |
134 | qreal m_activeScale; | - |
135 | qreal m_accumulatedScale; | - |
136 | qreal m_activeRotation; | - |
137 | QVector2D m_activeTranslation; | - |
138 | - | |
139 | qreal m_minimumScale; | - |
140 | qreal m_maximumScale; | - |
141 | - | |
142 | qreal m_minimumRotation; | - |
143 | qreal m_maximumRotation; | - |
144 | - | |
145 | qreal m_minimumX; | - |
146 | qreal m_maximumX; | - |
147 | qreal m_minimumY; | - |
148 | qreal m_maximumY; | - |
149 | - | |
150 | PinchOrigin m_pinchOrigin; | - |
151 | - | |
152 | // internal | - |
153 | qreal m_startScale; | - |
154 | qreal m_startRotation; | - |
155 | qreal m_startDistance; | - |
156 | QPointF m_startPos; | - |
157 | - | |
158 | QVector<PointData> m_startAngles; | - |
159 | QMatrix4x4 m_startMatrix; | - |
160 | QQuickMatrix4x4 m_transform; | - |
161 | - | |
162 | }; | - |
163 | - | |
164 | QT_END_NAMESPACE | - |
165 | - | |
166 | QML_DECLARE_TYPE(QQuickPinchHandler) | - |
167 | - | |
168 | #endif // QQUICKPINCHHANDLER_H | - |
Source code | Switch to Preprocessed file |