webengine/webkitutils/rt_gesturehelper/src/gesturedefs.h
changeset 65 5bfc169077b2
parent 0 dd21522fd290
equal deleted inserted replaced
42:d39add9822e2 65:5bfc169077b2
       
     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 the License "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 _GESTUREDEFS_H_
       
    20 #define _GESTUREDEFS_H
       
    21 
       
    22 #include <e32std.h> ///  @todo check this is correct
       
    23 
       
    24 namespace RT_GestureHelper
       
    25 {
       
    26 
       
    27 /// time to hold the stylus in the same position to activate holding
       
    28 const TInt KHoldDuration = 500000; // microseconds 
       
    29 
       
    30 /// time to tap again for the second tap to be a double tap
       
    31 const TInt KMaxDoubleTapDuration = 400000; // microseconds 
       
    32 
       
    33 /// time in which speed becomes zero if user stops stylus movement before
       
    34 /// lifting the pointer
       
    35 const TInt KSpeedStopTime = 150000; // microseconds
       
    36 
       
    37 /// tolerance in degrees to either side of an angle, for direction to be the 
       
    38 /// same as reference angle
       
    39 const TReal KAngleTolerance = 25;
       
    40 
       
    41 /// Nth pointer event before the latest point
       
    42 const TInt KPreviousPointOffset = 3;
       
    43 
       
    44 /// Tolerance for ignoring small movements, percent of longer screen edge
       
    45 const TInt KGestureTolerancePercent = 2; // of 100
       
    46 
       
    47 const TInt KFingerSize_mm = 8;
       
    48 
       
    49 const TInt KTwipsInInch = 1440;
       
    50 
       
    51 const TReal KTwipsInMm = 56.7;
       
    52 
       
    53 const TInt  KMaxTapDuration = 300000; //microseconds
       
    54 
       
    55 const TInt  KFlickSpeed = 500;
       
    56 
       
    57 const TInt KDoubleTapMaxActivationInterval = 500000;     // 500 ms
       
    58 
       
    59 const TInt KDoubleTapMinActivationInterval = 40000;   // 40 ms
       
    60 
       
    61 const TInt KDoubleTapIdleInterval = 700000;           // 700 ms, to prevent triple-tap effects
       
    62 
       
    63 const TInt KLongTapDuration = 2000000; //2 sec
       
    64 
       
    65 const TInt KMinTimeBetweenDrags = 20000; // 20 ms
       
    66 /** 
       
    67  * Panic codes 
       
    68  */
       
    69 enum TGesturePanic
       
    70     {
       
    71     EGesturePanicIllegalLogic
       
    72     };  
       
    73 
       
    74 /** Panics the thread */
       
    75 inline void Panic( TGesturePanic aReason )
       
    76     {
       
    77      _LIT( KComponentName, "GestureHelper" );
       
    78     User::Panic( KComponentName, aReason );
       
    79     }
       
    80 
       
    81 } // namespace GestureHelper
       
    82 
       
    83 #endif // _GESTUREDEFS_H