|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Concrete touch gesture event classes. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef T_AKNTOUCHGESTUREFWEVENT_H |
|
19 #define T_AKNTOUCHGESTUREFWEVENT_H |
|
20 |
|
21 #include <akntouchgesturefwevents.h> |
|
22 |
|
23 namespace AknTouchGestureFw { |
|
24 |
|
25 /** |
|
26 * Unknown touch gesture event class. |
|
27 */ |
|
28 NONSHARABLE_CLASS( TAknTouchGestureFwUnknownEvent ) |
|
29 : public MAknTouchGestureFwEvent |
|
30 { |
|
31 |
|
32 public: // From base class MAknTouchGestureFwEvent. |
|
33 |
|
34 /** |
|
35 * Returns the gesture group of the event. |
|
36 * |
|
37 * @return EAknTouchGestureFwNoGroup |
|
38 */ |
|
39 TAknTouchGestureFwGroup Group() const; |
|
40 |
|
41 /** |
|
42 * Returns the gesture type of the event. |
|
43 * |
|
44 * @return EAknTouchGestureFwUnknown |
|
45 */ |
|
46 TAknTouchGestureFwType Type() const; |
|
47 |
|
48 private: // From base class MAknTouchGestureFwEvent. |
|
49 |
|
50 /** |
|
51 * Virtual method provided to allow extensibility. |
|
52 * |
|
53 * @param aInterface Extension UID. |
|
54 * @param aParam Parameter for the extension. |
|
55 * |
|
56 * @return KErrNotSupported as not currently implemented. |
|
57 */ |
|
58 TInt Extension( TUid aInterface, TAny* aParam ); |
|
59 }; |
|
60 |
|
61 |
|
62 /** |
|
63 * Tap touch gesture event class. |
|
64 */ |
|
65 NONSHARABLE_CLASS( TAknTouchGestureFwTapEvent ) |
|
66 : public MAknTouchGestureFwTapEvent |
|
67 { |
|
68 |
|
69 public: |
|
70 |
|
71 /** |
|
72 * Sets the tap type. |
|
73 * |
|
74 * @param aType Type of the tap gesture. |
|
75 */ |
|
76 void SetType( const TAknTouchGestureFwType aType ); |
|
77 |
|
78 /** |
|
79 * Sets the tap position. |
|
80 * |
|
81 * @param aPosition The position at which the tap was received. |
|
82 */ |
|
83 void SetPosition( const TPoint& aPosition ); |
|
84 |
|
85 public: // From base class MAknTouchGestureFwTapEvent. |
|
86 |
|
87 /** |
|
88 * Returns the gesture group of the event. |
|
89 * |
|
90 * @return EAknTouchGestureFwGroupTap |
|
91 */ |
|
92 TAknTouchGestureFwGroup Group() const; |
|
93 |
|
94 /** |
|
95 * Returns the gesture type of the event. |
|
96 * |
|
97 * @return Gesture type. |
|
98 */ |
|
99 TAknTouchGestureFwType Type() const; |
|
100 |
|
101 /** |
|
102 * Returns the tap event position. |
|
103 * |
|
104 * @return Tap event position. |
|
105 */ |
|
106 TPoint Position() const; |
|
107 |
|
108 private: // From base class MAknTouchGestureFwTapEvent. |
|
109 |
|
110 /** |
|
111 * Virtual method provided to allow extensibility. |
|
112 * |
|
113 * @param aInterface Extension UID. |
|
114 * @param aParam Parameter for the extension. |
|
115 * |
|
116 * @return KErrNotSupported as not currently implemented. |
|
117 */ |
|
118 TInt Extension( TUid aInterface, TAny* aParam ); |
|
119 |
|
120 private: |
|
121 |
|
122 /** |
|
123 * Gesture type. |
|
124 */ |
|
125 TAknTouchGestureFwType iType; |
|
126 |
|
127 /** |
|
128 * Tap position. |
|
129 */ |
|
130 TPoint iPosition; |
|
131 }; |
|
132 |
|
133 |
|
134 /** |
|
135 * Drag touch gesture event class. |
|
136 */ |
|
137 NONSHARABLE_CLASS( TAknTouchGestureFwDragEvent ) |
|
138 : public MAknTouchGestureFwDragEvent |
|
139 { |
|
140 |
|
141 public: |
|
142 |
|
143 /** |
|
144 * Sets the state of the drag gesture. |
|
145 * |
|
146 * @param aState State of the drag gesture. |
|
147 */ |
|
148 void SetState( TAknTouchGestureFwState aState ); |
|
149 |
|
150 /** |
|
151 * Sets the drag start position. |
|
152 * |
|
153 * @param aStartPosition Start position of the drag gesture. |
|
154 */ |
|
155 void SetStartPosition( const TPoint& aStartPosition ); |
|
156 |
|
157 /** |
|
158 * Sets the current position of the drag gesture. |
|
159 * |
|
160 * @param aCurrentPosition Current position in the drag gesture. |
|
161 */ |
|
162 void SetCurrentPosition( const TPoint& aCurrentPosition ); |
|
163 |
|
164 /** |
|
165 * Sets previous position of the drag gesture. |
|
166 * |
|
167 * @param aPreviousPosition Previous position in the drag gesture. |
|
168 */ |
|
169 void SetPreviousPosition( const TPoint& aPreviousPosition ); |
|
170 |
|
171 public: // From base class MAknTouchGestureFwDragEvent. |
|
172 |
|
173 /** |
|
174 * Returns the gesture group of the event. |
|
175 * |
|
176 * @return EAknTouchGestureFwGroupDrag |
|
177 */ |
|
178 TAknTouchGestureFwGroup Group() const; |
|
179 |
|
180 /** |
|
181 * Returns the gesture type of the event. |
|
182 * |
|
183 * @return EAknTouchGestureFwDrag |
|
184 */ |
|
185 TAknTouchGestureFwType Type() const; |
|
186 |
|
187 /** |
|
188 * Returns the gesture state of the event. |
|
189 * |
|
190 * State can be one of the following values: |
|
191 * - EAknTouchGestureFwStart, sent at the beginning of the gesture. |
|
192 * - EAknTouchGestureFwStop, sent at the end of the gesture. |
|
193 * - EAknTouchGestureFwOn, sent during the gesture recognition. |
|
194 * |
|
195 * @return Gesture state. |
|
196 */ |
|
197 TAknTouchGestureFwState State() const; |
|
198 |
|
199 /** |
|
200 * Returns the drag event start position. |
|
201 * |
|
202 * @return Drag event start position. |
|
203 */ |
|
204 TPoint StartPosition() const; |
|
205 |
|
206 /** |
|
207 * Returns the drag event current position. |
|
208 * |
|
209 * @return Drag event current position. |
|
210 */ |
|
211 TPoint CurrentPosition() const; |
|
212 |
|
213 /** |
|
214 * Returns the drag event previous position. |
|
215 * |
|
216 * @return Drag event previous position. |
|
217 */ |
|
218 TPoint PreviousPosition() const; |
|
219 |
|
220 private: // From base class MAknTouchGestureFwDragEvent. |
|
221 |
|
222 /** |
|
223 * Virtual method provided to allow extensibility. |
|
224 * |
|
225 * @param aInterface Extension UID. |
|
226 * @param aParam Parameter for the extension. |
|
227 * |
|
228 * @return KErrNotSupported as not currently implemented. |
|
229 */ |
|
230 TInt Extension( TUid aInterface, TAny* aParam ); |
|
231 |
|
232 private: |
|
233 |
|
234 /** |
|
235 * Gesture state. |
|
236 */ |
|
237 TAknTouchGestureFwState iState; |
|
238 |
|
239 /** |
|
240 * Drag start position. |
|
241 */ |
|
242 TPoint iStartPosition; |
|
243 |
|
244 /** |
|
245 * Drag current position. |
|
246 */ |
|
247 TPoint iCurrentPosition; |
|
248 |
|
249 /** |
|
250 * Drag previous position. |
|
251 */ |
|
252 TPoint iPreviousPosition; |
|
253 }; |
|
254 |
|
255 |
|
256 /** |
|
257 * Flick touch gesture event class. |
|
258 */ |
|
259 NONSHARABLE_CLASS( TAknTouchGestureFwFlickEvent ) |
|
260 : public MAknTouchGestureFwFlickEvent |
|
261 { |
|
262 |
|
263 public: |
|
264 |
|
265 /** |
|
266 * Sets the flick type. |
|
267 * |
|
268 * @param aType Type of the flick gesture. |
|
269 */ |
|
270 void SetType( TAknTouchGestureFwType aType ); |
|
271 |
|
272 /** |
|
273 * Sets the flick position. |
|
274 * |
|
275 * @param aFlickPosition Position of the flick. |
|
276 */ |
|
277 void SetPosition( const TPoint& aFlickPosition ); |
|
278 |
|
279 /** |
|
280 * Sets the flick speed. |
|
281 * |
|
282 * @param aSpeed Speed of the flick. |
|
283 */ |
|
284 void SetSpeed( const TPoint& aSpeed ); |
|
285 |
|
286 public: // From base class MAknTouchGestureFwFlickEvent. |
|
287 |
|
288 /** |
|
289 * Returns the gesture group of the event. |
|
290 * |
|
291 * @return EAknTouchGestureFwGroupFlick |
|
292 */ |
|
293 TAknTouchGestureFwGroup Group() const; |
|
294 |
|
295 /** |
|
296 * Returns the gesture type of the event. |
|
297 * |
|
298 * @return Gesture type. |
|
299 */ |
|
300 TAknTouchGestureFwType Type() const; |
|
301 |
|
302 /** |
|
303 * Returns the flick position, which is the |
|
304 * position where pointer was released with speed. |
|
305 * |
|
306 * @return Flick position. |
|
307 */ |
|
308 TPoint Position() const; |
|
309 |
|
310 /** |
|
311 * Flick speed in pixels per second. |
|
312 * |
|
313 * @return Flick speed. |
|
314 */ |
|
315 TPoint Speed() const; |
|
316 |
|
317 private: // From base class MAknTouchGestureFwFlickEvent. |
|
318 |
|
319 /** |
|
320 * Virtual method provided to allow extensibility. |
|
321 * |
|
322 * @param aInterface Extension UID. |
|
323 * @param aParam Parameter for the extension. |
|
324 * |
|
325 * @return KErrNotSupported as not currently implemented. |
|
326 */ |
|
327 TInt Extension( TUid aInterface, TAny* aParam ); |
|
328 |
|
329 private: |
|
330 |
|
331 /** |
|
332 * Gesture type. |
|
333 */ |
|
334 TAknTouchGestureFwType iType; |
|
335 |
|
336 /** |
|
337 * Flick position. |
|
338 */ |
|
339 TPoint iFlickPosition; |
|
340 |
|
341 /** |
|
342 * Flick speed. |
|
343 */ |
|
344 TPoint iSpeed; |
|
345 }; |
|
346 |
|
347 |
|
348 /** |
|
349 * Pinch touch gesture event class. |
|
350 */ |
|
351 NONSHARABLE_CLASS( TAknTouchGestureFwPinchEvent ) |
|
352 : public MAknTouchGestureFwPinchEvent |
|
353 { |
|
354 |
|
355 public: |
|
356 |
|
357 /** |
|
358 * Sets the pinch state. |
|
359 * |
|
360 * @param aState State of the pinch gesture. |
|
361 */ |
|
362 void SetState( TAknTouchGestureFwState aState ); |
|
363 |
|
364 /** |
|
365 * Sets the pinch movement. |
|
366 * |
|
367 * @param aMovement The pinch movement in percents. |
|
368 */ |
|
369 void SetMovement( TInt aMovement ); |
|
370 |
|
371 public: // From base class MAknTouchGestureFwPinchEvent. |
|
372 |
|
373 /** |
|
374 * Returns the gesture group of the event. |
|
375 * |
|
376 * @return EAknTouchGestureFwGroupPinch |
|
377 */ |
|
378 TAknTouchGestureFwGroup Group() const; |
|
379 |
|
380 /** |
|
381 * Returns the gesture type of the event. |
|
382 * |
|
383 * @return EAknTouchGestureFwPinch |
|
384 */ |
|
385 TAknTouchGestureFwType Type() const; |
|
386 |
|
387 /** |
|
388 * Returns the gesture state of the event. |
|
389 * |
|
390 * State can be one of the following values: |
|
391 * - EAknTouchGestureFwStart, sent at the beginning of the gesture. |
|
392 * - EAknTouchGestureFwStop, sent at the end of the gesture. |
|
393 * - EAknTouchGestureFwOn, sent during the gesture recognition. |
|
394 * |
|
395 * @return Gesture state. |
|
396 */ |
|
397 TAknTouchGestureFwState State() const; |
|
398 |
|
399 /** |
|
400 * Returns pinch percent value, range is non-negative. |
|
401 * |
|
402 * @return Pinch percent value. |
|
403 */ |
|
404 TInt Movement() const; |
|
405 |
|
406 private: // From base class MAknTouchGestureFwPinchEvent. |
|
407 |
|
408 /** |
|
409 * Virtual method provided to allow extensibility. |
|
410 * |
|
411 * @param aInterface Extension UID. |
|
412 * @param aParam Parameter for the extension. |
|
413 * |
|
414 * @return KErrNotSupported as not currently implemented. |
|
415 */ |
|
416 TInt Extension( TUid aInterface, TAny* aParam ); |
|
417 |
|
418 private: |
|
419 |
|
420 /** |
|
421 * Pinch state. |
|
422 */ |
|
423 TAknTouchGestureFwState iState; |
|
424 |
|
425 /** |
|
426 * Pinch movement. |
|
427 */ |
|
428 TInt iMovement; |
|
429 }; |
|
430 |
|
431 } // namespace AknTouchGestureFw |
|
432 |
|
433 #endif // T_AKNTOUCHGESTUREFWEVENT_H |
|
434 |
|
435 // End of File |