63 Q_OBJECT |
63 Q_OBJECT |
64 Q_DECLARE_PRIVATE(QGesture) |
64 Q_DECLARE_PRIVATE(QGesture) |
65 |
65 |
66 Q_PROPERTY(Qt::GestureState state READ state) |
66 Q_PROPERTY(Qt::GestureState state READ state) |
67 Q_PROPERTY(Qt::GestureType gestureType READ gestureType) |
67 Q_PROPERTY(Qt::GestureType gestureType READ gestureType) |
|
68 Q_PROPERTY(QGesture::GestureCancelPolicy gestureCancelPolicy READ gestureCancelPolicy WRITE setGestureCancelPolicy) |
68 Q_PROPERTY(QPointF hotSpot READ hotSpot WRITE setHotSpot RESET unsetHotSpot) |
69 Q_PROPERTY(QPointF hotSpot READ hotSpot WRITE setHotSpot RESET unsetHotSpot) |
69 Q_PROPERTY(bool hasHotSpot READ hasHotSpot) |
70 Q_PROPERTY(bool hasHotSpot READ hasHotSpot) |
70 |
71 |
71 public: |
72 public: |
72 explicit QGesture(QObject *parent = 0); |
73 explicit QGesture(QObject *parent = 0); |
79 QPointF hotSpot() const; |
80 QPointF hotSpot() const; |
80 void setHotSpot(const QPointF &value); |
81 void setHotSpot(const QPointF &value); |
81 bool hasHotSpot() const; |
82 bool hasHotSpot() const; |
82 void unsetHotSpot(); |
83 void unsetHotSpot(); |
83 |
84 |
|
85 enum GestureCancelPolicy { |
|
86 CancelNone = 0, |
|
87 CancelAllInContext |
|
88 }; |
|
89 |
|
90 void setGestureCancelPolicy(GestureCancelPolicy policy); |
|
91 GestureCancelPolicy gestureCancelPolicy() const; |
|
92 |
84 protected: |
93 protected: |
85 QGesture(QGesturePrivate &dd, QObject *parent); |
94 QGesture(QGesturePrivate &dd, QObject *parent); |
86 |
95 |
87 private: |
96 private: |
88 friend class QGestureEvent; |
97 friend class QGestureEvent; |
89 friend class QGestureRecognizer; |
98 friend class QGestureRecognizer; |
90 friend class QGestureManager; |
99 friend class QGestureManager; |
|
100 friend class QGraphicsScenePrivate; |
91 }; |
101 }; |
92 |
102 |
93 class QPanGesturePrivate; |
103 class QPanGesturePrivate; |
94 class Q_GUI_EXPORT QPanGesture : public QGesture |
104 class Q_GUI_EXPORT QPanGesture : public QGesture |
95 { |
105 { |
96 Q_OBJECT |
106 Q_OBJECT |
97 Q_DECLARE_PRIVATE(QPanGesture) |
107 Q_DECLARE_PRIVATE(QPanGesture) |
98 |
108 |
99 Q_PROPERTY(QPointF totalOffset READ totalOffset WRITE setTotalOffset) |
|
100 Q_PROPERTY(QPointF lastOffset READ lastOffset WRITE setLastOffset) |
109 Q_PROPERTY(QPointF lastOffset READ lastOffset WRITE setLastOffset) |
101 Q_PROPERTY(QPointF offset READ offset WRITE setOffset) |
110 Q_PROPERTY(QPointF offset READ offset WRITE setOffset) |
|
111 Q_PROPERTY(QPointF delta READ delta STORED false) |
102 Q_PROPERTY(qreal acceleration READ acceleration WRITE setAcceleration) |
112 Q_PROPERTY(qreal acceleration READ acceleration WRITE setAcceleration) |
103 |
113 |
104 public: |
114 public: |
105 QPanGesture(QObject *parent = 0); |
115 QPanGesture(QObject *parent = 0); |
106 |
116 |
107 QPointF totalOffset() const; |
|
108 QPointF lastOffset() const; |
117 QPointF lastOffset() const; |
109 QPointF offset() const; |
118 QPointF offset() const; |
|
119 QPointF delta() const; |
110 qreal acceleration() const; |
120 qreal acceleration() const; |
111 |
121 |
112 void setTotalOffset(const QPointF &value); |
|
113 void setLastOffset(const QPointF &value); |
122 void setLastOffset(const QPointF &value); |
114 void setOffset(const QPointF &value); |
123 void setOffset(const QPointF &value); |
115 void setAcceleration(qreal value); |
124 void setAcceleration(qreal value); |
116 |
125 |
117 friend class QPanGestureRecognizer; |
126 friend class QPanGestureRecognizer; |
123 { |
132 { |
124 Q_OBJECT |
133 Q_OBJECT |
125 Q_DECLARE_PRIVATE(QPinchGesture) |
134 Q_DECLARE_PRIVATE(QPinchGesture) |
126 |
135 |
127 public: |
136 public: |
128 enum WhatChange { |
137 enum ChangeFlag { |
129 ScaleFactorChanged = 0x1, |
138 ScaleFactorChanged = 0x1, |
130 RotationAngleChanged = 0x2, |
139 RotationAngleChanged = 0x2, |
131 CenterPointChanged = 0x4 |
140 CenterPointChanged = 0x4 |
132 }; |
141 }; |
133 Q_DECLARE_FLAGS(WhatChanged, WhatChange) |
142 Q_DECLARE_FLAGS(ChangeFlags, ChangeFlag) |
134 |
143 |
135 Q_PROPERTY(WhatChanged whatChanged READ whatChanged WRITE setWhatChanged) |
144 Q_PROPERTY(ChangeFlags totalChangeFlags READ totalChangeFlags WRITE setTotalChangeFlags) |
|
145 Q_PROPERTY(ChangeFlags changeFlags READ changeFlags WRITE setChangeFlags) |
136 |
146 |
137 Q_PROPERTY(qreal totalScaleFactor READ totalScaleFactor WRITE setTotalScaleFactor) |
147 Q_PROPERTY(qreal totalScaleFactor READ totalScaleFactor WRITE setTotalScaleFactor) |
138 Q_PROPERTY(qreal lastScaleFactor READ lastScaleFactor WRITE setLastScaleFactor) |
148 Q_PROPERTY(qreal lastScaleFactor READ lastScaleFactor WRITE setLastScaleFactor) |
139 Q_PROPERTY(qreal scaleFactor READ scaleFactor WRITE setScaleFactor) |
149 Q_PROPERTY(qreal scaleFactor READ scaleFactor WRITE setScaleFactor) |
140 |
150 |
147 Q_PROPERTY(QPointF centerPoint READ centerPoint WRITE setCenterPoint) |
157 Q_PROPERTY(QPointF centerPoint READ centerPoint WRITE setCenterPoint) |
148 |
158 |
149 public: |
159 public: |
150 QPinchGesture(QObject *parent = 0); |
160 QPinchGesture(QObject *parent = 0); |
151 |
161 |
152 WhatChanged whatChanged() const; |
162 ChangeFlags totalChangeFlags() const; |
153 void setWhatChanged(WhatChanged value); |
163 void setTotalChangeFlags(ChangeFlags value); |
|
164 |
|
165 ChangeFlags changeFlags() const; |
|
166 void setChangeFlags(ChangeFlags value); |
154 |
167 |
155 QPointF startCenterPoint() const; |
168 QPointF startCenterPoint() const; |
156 QPointF lastCenterPoint() const; |
169 QPointF lastCenterPoint() const; |
157 QPointF centerPoint() const; |
170 QPointF centerPoint() const; |
158 void setStartCenterPoint(const QPointF &value); |
171 void setStartCenterPoint(const QPointF &value); |
204 void setSwipeAngle(qreal value); |
217 void setSwipeAngle(qreal value); |
205 |
218 |
206 friend class QSwipeGestureRecognizer; |
219 friend class QSwipeGestureRecognizer; |
207 }; |
220 }; |
208 |
221 |
|
222 class QTapGesturePrivate; |
|
223 class Q_GUI_EXPORT QTapGesture : public QGesture |
|
224 { |
|
225 Q_OBJECT |
|
226 Q_DECLARE_PRIVATE(QTapGesture) |
|
227 |
|
228 Q_PROPERTY(QPointF position READ position WRITE setPosition) |
|
229 |
|
230 public: |
|
231 QTapGesture(QObject *parent = 0); |
|
232 |
|
233 QPointF position() const; |
|
234 void setPosition(const QPointF &pos); |
|
235 |
|
236 friend class QTapGestureRecognizer; |
|
237 }; |
|
238 |
|
239 class QTapAndHoldGesturePrivate; |
|
240 class Q_GUI_EXPORT QTapAndHoldGesture : public QGesture |
|
241 { |
|
242 Q_OBJECT |
|
243 Q_DECLARE_PRIVATE(QTapAndHoldGesture) |
|
244 |
|
245 Q_PROPERTY(QPointF position READ position WRITE setPosition) |
|
246 |
|
247 public: |
|
248 QTapAndHoldGesture(QObject *parent = 0); |
|
249 |
|
250 QPointF position() const; |
|
251 void setPosition(const QPointF &pos); |
|
252 |
|
253 friend class QTapAndHoldGestureRecognizer; |
|
254 }; |
|
255 |
209 QT_END_NAMESPACE |
256 QT_END_NAMESPACE |
210 |
257 |
|
258 Q_DECLARE_METATYPE(QGesture::GestureCancelPolicy) |
211 QT_END_HEADER |
259 QT_END_HEADER |
212 |
260 |
213 #endif // QGESTURE_H |
261 #endif // QGESTURE_H |