|
1 /* |
|
2 * Copyright (c) 2008 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: Gesture helper constant definitions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _XNGESTUREDEFS_H_ |
|
20 #define _XNGESTUREDEFS_H_ |
|
21 |
|
22 // System includes |
|
23 #include <e32std.h> |
|
24 |
|
25 /** |
|
26 * This flag controls whether helpers emits a double tap or a tap gesture |
|
27 * for a second tap |
|
28 */ |
|
29 #define _GESTURE_DOUBLE_TAP_SUPPORT |
|
30 |
|
31 /** |
|
32 * XnGestureHelper namespace |
|
33 * Used for the whole gesture family - Gesture recognizer, gesture helper, |
|
34 * Point array |
|
35 */ |
|
36 namespace XnGestureHelper |
|
37 { |
|
38 /** time to hold the stylus in the same position to activate |
|
39 * holding, in microseconds |
|
40 */ |
|
41 const TInt KHoldDuration = 500000; |
|
42 |
|
43 /** |
|
44 * time to tap again for the second tap to be a double tap, in |
|
45 * microseconds |
|
46 */ |
|
47 const TInt KMaxDoubleTapDuration = 400000; |
|
48 |
|
49 /** |
|
50 * time in which speed becomes zero if user stops stylus movement before |
|
51 * lifting the pointer, in microseconds |
|
52 */ |
|
53 const TInt KSpeedStopTime = 100000; |
|
54 |
|
55 /** |
|
56 * tolerance in degrees to either side of an angle, for direction to be |
|
57 * the same as reference angle |
|
58 */ |
|
59 const TReal KAngleTolerance = 25; |
|
60 |
|
61 /** |
|
62 * maximum pointer movement from pointer down position for a gesture be |
|
63 * a tap or hold gesture |
|
64 */ |
|
65 const TInt KSamePointTolerance = 3; |
|
66 |
|
67 /** |
|
68 * minimum length of a valid swipe in pixels. should be larger than |
|
69 * KTapTolerance |
|
70 */ |
|
71 const TReal KMinSwipeLength = 5; |
|
72 |
|
73 /** Nth pointer event before the latest point */ |
|
74 const TInt KPreviousPointOffset = 3; |
|
75 |
|
76 |
|
77 /** |
|
78 * Panic codes |
|
79 */ |
|
80 enum TGesturePanic |
|
81 { |
|
82 EGesturePanicIllegalLogic |
|
83 }; |
|
84 |
|
85 /** |
|
86 * Panics the thread |
|
87 * |
|
88 * @param aReason Panic reason |
|
89 */ |
|
90 inline void Panic( TGesturePanic aReason ) |
|
91 { |
|
92 _LIT( KComponentName, "XnGestureHelper" ); |
|
93 User::Panic( KComponentName, aReason ); |
|
94 } |
|
95 } // namespace XnGestureHelper |
|
96 |
|
97 #endif // _XNGESTUREDEFS_H_ |