author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 19 Feb 2010 23:40:16 +0200 | |
branch | RCL_3 |
changeset 4 | 3b1da2848fc7 |
parent 3 | 41300fa6a67c |
child 33 | 3e2da88830cd |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtGui module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#ifndef QGESTURE_H |
|
43 |
#define QGESTURE_H |
|
44 |
||
45 |
#include <QtCore/qobject.h> |
|
46 |
#include <QtCore/qlist.h> |
|
47 |
#include <QtCore/qdatetime.h> |
|
48 |
#include <QtCore/qpoint.h> |
|
49 |
#include <QtCore/qrect.h> |
|
50 |
#include <QtCore/qmetatype.h> |
|
51 |
||
52 |
QT_BEGIN_HEADER |
|
53 |
||
54 |
Q_DECLARE_METATYPE(Qt::GestureState) |
|
55 |
||
56 |
QT_BEGIN_NAMESPACE |
|
57 |
||
58 |
QT_MODULE(Gui) |
|
59 |
||
60 |
class QGesturePrivate; |
|
61 |
class Q_GUI_EXPORT QGesture : public QObject |
|
62 |
{ |
|
63 |
Q_OBJECT |
|
64 |
Q_DECLARE_PRIVATE(QGesture) |
|
65 |
||
66 |
Q_PROPERTY(Qt::GestureState state READ state) |
|
67 |
Q_PROPERTY(Qt::GestureType gestureType READ gestureType) |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
68 |
Q_PROPERTY(QGesture::GestureCancelPolicy gestureCancelPolicy READ gestureCancelPolicy WRITE setGestureCancelPolicy) |
0 | 69 |
Q_PROPERTY(QPointF hotSpot READ hotSpot WRITE setHotSpot RESET unsetHotSpot) |
70 |
Q_PROPERTY(bool hasHotSpot READ hasHotSpot) |
|
71 |
||
72 |
public: |
|
73 |
explicit QGesture(QObject *parent = 0); |
|
74 |
~QGesture(); |
|
75 |
||
76 |
Qt::GestureType gestureType() const; |
|
77 |
||
78 |
Qt::GestureState state() const; |
|
79 |
||
80 |
QPointF hotSpot() const; |
|
81 |
void setHotSpot(const QPointF &value); |
|
82 |
bool hasHotSpot() const; |
|
83 |
void unsetHotSpot(); |
|
84 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
85 |
enum GestureCancelPolicy { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
86 |
CancelNone = 0, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
87 |
CancelAllInContext |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
88 |
}; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
89 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
90 |
void setGestureCancelPolicy(GestureCancelPolicy policy); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
91 |
GestureCancelPolicy gestureCancelPolicy() const; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
92 |
|
0 | 93 |
protected: |
94 |
QGesture(QGesturePrivate &dd, QObject *parent); |
|
95 |
||
96 |
private: |
|
97 |
friend class QGestureEvent; |
|
98 |
friend class QGestureRecognizer; |
|
99 |
friend class QGestureManager; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
100 |
friend class QGraphicsScenePrivate; |
0 | 101 |
}; |
102 |
||
103 |
class QPanGesturePrivate; |
|
104 |
class Q_GUI_EXPORT QPanGesture : public QGesture |
|
105 |
{ |
|
106 |
Q_OBJECT |
|
107 |
Q_DECLARE_PRIVATE(QPanGesture) |
|
108 |
||
109 |
Q_PROPERTY(QPointF lastOffset READ lastOffset WRITE setLastOffset) |
|
110 |
Q_PROPERTY(QPointF offset READ offset WRITE setOffset) |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
111 |
Q_PROPERTY(QPointF delta READ delta STORED false) |
0 | 112 |
Q_PROPERTY(qreal acceleration READ acceleration WRITE setAcceleration) |
113 |
||
114 |
public: |
|
115 |
QPanGesture(QObject *parent = 0); |
|
116 |
||
117 |
QPointF lastOffset() const; |
|
118 |
QPointF offset() const; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
119 |
QPointF delta() const; |
0 | 120 |
qreal acceleration() const; |
121 |
||
122 |
void setLastOffset(const QPointF &value); |
|
123 |
void setOffset(const QPointF &value); |
|
124 |
void setAcceleration(qreal value); |
|
125 |
||
126 |
friend class QPanGestureRecognizer; |
|
127 |
friend class QWinNativePanGestureRecognizer; |
|
128 |
}; |
|
129 |
||
130 |
class QPinchGesturePrivate; |
|
131 |
class Q_GUI_EXPORT QPinchGesture : public QGesture |
|
132 |
{ |
|
133 |
Q_OBJECT |
|
134 |
Q_DECLARE_PRIVATE(QPinchGesture) |
|
135 |
||
136 |
public: |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
137 |
enum ChangeFlag { |
0 | 138 |
ScaleFactorChanged = 0x1, |
139 |
RotationAngleChanged = 0x2, |
|
140 |
CenterPointChanged = 0x4 |
|
141 |
}; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
142 |
Q_DECLARE_FLAGS(ChangeFlags, ChangeFlag) |
0 | 143 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
144 |
Q_PROPERTY(ChangeFlags totalChangeFlags READ totalChangeFlags WRITE setTotalChangeFlags) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
145 |
Q_PROPERTY(ChangeFlags changeFlags READ changeFlags WRITE setChangeFlags) |
0 | 146 |
|
147 |
Q_PROPERTY(qreal totalScaleFactor READ totalScaleFactor WRITE setTotalScaleFactor) |
|
148 |
Q_PROPERTY(qreal lastScaleFactor READ lastScaleFactor WRITE setLastScaleFactor) |
|
149 |
Q_PROPERTY(qreal scaleFactor READ scaleFactor WRITE setScaleFactor) |
|
150 |
||
151 |
Q_PROPERTY(qreal totalRotationAngle READ totalRotationAngle WRITE setTotalRotationAngle) |
|
152 |
Q_PROPERTY(qreal lastRotationAngle READ lastRotationAngle WRITE setLastRotationAngle) |
|
153 |
Q_PROPERTY(qreal rotationAngle READ rotationAngle WRITE setRotationAngle) |
|
154 |
||
155 |
Q_PROPERTY(QPointF startCenterPoint READ startCenterPoint WRITE setStartCenterPoint) |
|
156 |
Q_PROPERTY(QPointF lastCenterPoint READ lastCenterPoint WRITE setLastCenterPoint) |
|
157 |
Q_PROPERTY(QPointF centerPoint READ centerPoint WRITE setCenterPoint) |
|
158 |
||
159 |
public: |
|
160 |
QPinchGesture(QObject *parent = 0); |
|
161 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
ChangeFlags totalChangeFlags() const; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
163 |
void setTotalChangeFlags(ChangeFlags value); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
164 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
165 |
ChangeFlags changeFlags() const; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
166 |
void setChangeFlags(ChangeFlags value); |
0 | 167 |
|
168 |
QPointF startCenterPoint() const; |
|
169 |
QPointF lastCenterPoint() const; |
|
170 |
QPointF centerPoint() const; |
|
171 |
void setStartCenterPoint(const QPointF &value); |
|
172 |
void setLastCenterPoint(const QPointF &value); |
|
173 |
void setCenterPoint(const QPointF &value); |
|
174 |
||
175 |
qreal totalScaleFactor() const; |
|
176 |
qreal lastScaleFactor() const; |
|
177 |
qreal scaleFactor() const; |
|
178 |
void setTotalScaleFactor(qreal value); |
|
179 |
void setLastScaleFactor(qreal value); |
|
180 |
void setScaleFactor(qreal value); |
|
181 |
||
182 |
qreal totalRotationAngle() const; |
|
183 |
qreal lastRotationAngle() const; |
|
184 |
qreal rotationAngle() const; |
|
185 |
void setTotalRotationAngle(qreal value); |
|
186 |
void setLastRotationAngle(qreal value); |
|
187 |
void setRotationAngle(qreal value); |
|
188 |
||
189 |
friend class QPinchGestureRecognizer; |
|
190 |
}; |
|
191 |
||
192 |
QT_END_NAMESPACE |
|
193 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
194 |
Q_DECLARE_METATYPE(QPinchGesture::ChangeFlags) |
0 | 195 |
|
196 |
QT_BEGIN_NAMESPACE |
|
197 |
||
198 |
class QSwipeGesturePrivate; |
|
199 |
class Q_GUI_EXPORT QSwipeGesture : public QGesture |
|
200 |
{ |
|
201 |
Q_OBJECT |
|
202 |
Q_DECLARE_PRIVATE(QSwipeGesture) |
|
203 |
Q_ENUMS(SwipeDirection) |
|
204 |
||
205 |
Q_PROPERTY(SwipeDirection horizontalDirection READ horizontalDirection STORED false) |
|
206 |
Q_PROPERTY(SwipeDirection verticalDirection READ verticalDirection STORED false) |
|
207 |
Q_PROPERTY(qreal swipeAngle READ swipeAngle WRITE setSwipeAngle) |
|
208 |
||
209 |
public: |
|
210 |
enum SwipeDirection { NoDirection, Left, Right, Up, Down }; |
|
211 |
QSwipeGesture(QObject *parent = 0); |
|
212 |
||
213 |
SwipeDirection horizontalDirection() const; |
|
214 |
SwipeDirection verticalDirection() const; |
|
215 |
||
216 |
qreal swipeAngle() const; |
|
217 |
void setSwipeAngle(qreal value); |
|
218 |
||
219 |
friend class QSwipeGestureRecognizer; |
|
220 |
}; |
|
221 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
222 |
class QTapGesturePrivate; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
223 |
class Q_GUI_EXPORT QTapGesture : public QGesture |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
224 |
{ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
225 |
Q_OBJECT |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
226 |
Q_DECLARE_PRIVATE(QTapGesture) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
227 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
228 |
Q_PROPERTY(QPointF position READ position WRITE setPosition) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
229 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
230 |
public: |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
231 |
QTapGesture(QObject *parent = 0); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
232 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
233 |
QPointF position() const; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
234 |
void setPosition(const QPointF &pos); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
235 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
236 |
friend class QTapGestureRecognizer; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
237 |
}; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
238 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
239 |
class QTapAndHoldGesturePrivate; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
240 |
class Q_GUI_EXPORT QTapAndHoldGesture : public QGesture |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
241 |
{ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
242 |
Q_OBJECT |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
243 |
Q_DECLARE_PRIVATE(QTapAndHoldGesture) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
244 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
245 |
Q_PROPERTY(QPointF position READ position WRITE setPosition) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
246 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
247 |
public: |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
248 |
QTapAndHoldGesture(QObject *parent = 0); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
249 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
250 |
QPointF position() const; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
251 |
void setPosition(const QPointF &pos); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
252 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
253 |
friend class QTapAndHoldGestureRecognizer; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
254 |
}; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
255 |
|
0 | 256 |
QT_END_NAMESPACE |
257 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
258 |
Q_DECLARE_METATYPE(QGesture::GestureCancelPolicy) |
0 | 259 |
QT_END_HEADER |
260 |
||
261 |
#endif // QGESTURE_H |