mulwidgets/gesturehelper/src/gesturedefs.h
changeset 0 e83bab7cf002
child 17 514d98f21c43
equal deleted inserted replaced
-1:000000000000 0:e83bab7cf002
       
     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 #ifndef _GESTUREDEFS_H_
       
    19 #define _GESTUREDEFS_H
       
    20 
       
    21 
       
    22 namespace GestureHelper
       
    23 {
       
    24 
       
    25 /// time to hold the stylus in the same position to activate holding
       
    26 const TInt KHoldDuration = 1000000; // microseconds 
       
    27 
       
    28 /// time to tap again for the second tap to be a double tap
       
    29 const TInt KMaxDoubleTapDuration = 400000; // microseconds 
       
    30 
       
    31 /// time in which speed becomes zero if user stops stylus movement before
       
    32 /// lifting the pointer
       
    33 const TInt KSpeedStopTime = 100000; // microseconds
       
    34 
       
    35 /// tolerance in degrees to either side of an angle, for direction to be the 
       
    36 /// same as reference angle
       
    37 const TReal KAngleTolerance = 25;
       
    38 
       
    39 /// Nth pointer event before the latest point
       
    40 const TInt KPreviousPointOffset = 3;
       
    41 
       
    42 /// Tolerance for ignoring small movements, percent of longer screen edge
       
    43 const TInt KGestureTolerancePercent = 4; // of 100
       
    44 
       
    45 /// Tolerance for considering it as pinch gesture for the first time
       
    46 const TInt KInitialPinchTolerance = 20; // Pixels
       
    47 
       
    48 /// Tolerance for considering it as pinch gesture after a pinch is detected
       
    49 const TInt KPinchTolerance = 5; // Pixels
       
    50 
       
    51 /** 
       
    52  * Panic codes 
       
    53  */
       
    54 enum TGesturePanic
       
    55     {
       
    56     EGesturePanicIllegalLogic
       
    57     };  
       
    58 
       
    59 /** Panics the thread */
       
    60 inline void Panic( TGesturePanic aReason )
       
    61     {
       
    62      _LIT( KComponentName, "GestureHelper" );
       
    63     User::Panic( KComponentName, aReason );
       
    64     }
       
    65 
       
    66 } // namespace GestureHelper
       
    67 
       
    68 #endif // _GESTUREDEFS_H