idlehomescreen/xmluirendering/uiengine/inc/xngesturehelper.h
branchRCL_3
changeset 12 9674c1a575e9
parent 0 f72a12da539e
equal deleted inserted replaced
11:ff572dfe6d86 12:9674c1a575e9
    20 #define _XNGESTUREHELPER_H_
    20 #define _XNGESTUREHELPER_H_
    21 
    21 
    22 // System includes
    22 // System includes
    23 #include <e32base.h>
    23 #include <e32base.h>
    24 
    24 
       
    25 // User includes
       
    26 #include "xngesturerecogniser.h"
       
    27 
    25 // Forward declarations
    28 // Forward declarations
    26 class CXnNode;
    29 class CXnNode;
    27 struct TPointerEvent;
    30 struct TPointerEvent;
    28 
       
    29 
       
    30 /**
       
    31  * Swipe directions (left, right, none)
       
    32  */
       
    33 enum TSwipeResult
       
    34     {
       
    35     ESwipeNone = 0,
       
    36     ESwipeLeft,
       
    37     ESwipeRight
       
    38     };
       
    39 
    31 
    40 /**
    32 /**
    41  * XnGestureHelper namespace
    33  * XnGestureHelper namespace
    42  * Used for the whole gesture family - Gesture recognizer, gesture helper, 
    34  * Used for the whole gesture family - Gesture recognizer, gesture helper, 
    43  * Point array
    35  * Point array
    48     // Forward declarations
    40     // Forward declarations
    49     class CHoldingTimer;
    41     class CHoldingTimer;
    50     class CXnGesture;
    42     class CXnGesture;
    51     
    43     
    52     // Constants
    44     // Constants
    53     const TReal32 KGestureMinSpeedX = 300;
    45     const TInt KGestureMinSpeed = 25;
    54     const TInt KGestureMinLengthX = 100;
    46     const TInt KGestureMinLength = 100;
    55     const TInt KGestureMaxDeltaY = 100;
    47         
    56     
       
    57     /**
    48     /**
    58      *  Implementation of CGestureHelper interface
    49      *  Implementation of CGestureHelper interface
    59      *
    50      *
    60      *  @ingroup group_xnlayoutengine
    51      *  @ingroup group_xnlayoutengine
    61      */
    52      */
   111         /** 
   102         /** 
   112          * See GestureHelper Handlepointervent
   103          * See GestureHelper Handlepointervent
   113          * 
   104          * 
   114          * @see CGestureHelper::HandlePointerEventL 
   105          * @see CGestureHelper::HandlePointerEventL 
   115          */ 
   106          */ 
   116         TSwipeResult HandlePointerEventL( const TPointerEvent& aEvent );
   107         TXnGestureCode HandlePointerEventL( const TPointerEvent& aEvent ); 
   117         
   108                     
   118         /** Reset helper state */
   109         /** Reset helper state */
   119         void Reset();
   110         void Reset();
   120 
   111 
   121     private:
   112     private:
   122         
   113         
   151         /** 
   142         /** 
   152          * Check if swipe if between defined values 
   143          * Check if swipe if between defined values 
   153          * 
   144          * 
   154          * @return Swiping left/right/none 
   145          * @return Swiping left/right/none 
   155          */
   146          */
   156         TSwipeResult ValidSwipe();
   147         TXnGestureCode ValidSwipe() const;
   157 
   148 
   158     private:
   149     private:
   159 
   150 
   160         /** 
   151         /** 
   161          * Gesture owner, Not owned.
   152          * Gesture owner, Not owned.
   176         CHoldingTimer* iHoldingTimer;
   167         CHoldingTimer* iHoldingTimer;
   177 
   168 
   178         /** 
   169         /** 
   179          * Gesture destination, Not owned.
   170          * Gesture destination, Not owned.
   180          */        
   171          */        
   181         CXnNode* iDestination;        
   172         CXnNode* iDestination;
       
   173         
       
   174         TXnGestureCode iDirection;
   182         };
   175         };
   183     } // GestureHelper
   176     } // GestureHelper
   184 
   177 
   185 #endif // _XNGESTUREHELPER_H_
   178 #endif // _XNGESTUREHELPER_H_