webengine/webkitutils/stmgesturefw/inc/touchgesturerecogniser.h
changeset 42 d39add9822e2
equal deleted inserted replaced
38:6297cdf66332 42:d39add9822e2
       
     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: Touch Gesture Recogniser
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef TOUCHGESTURERECOGNISER_H_
       
    19 #define TOUCHGESTURERECOGNISER_H_
       
    20 
       
    21 #include "rt_gestureengineif.h"
       
    22 #include <rt_gestureif.h>
       
    23 #include <rt_gesturelistener.h>
       
    24 
       
    25 class CCoeControl ;
       
    26 
       
    27 namespace stmGesture
       
    28 {
       
    29 
       
    30 /*!
       
    31  * CTouchGestureRecogniser handles touch "gesture".  The purpose is to inform the app
       
    32  * that a touch has happened.  The gesture is never owned, since most of the gestures start with touch.
       
    33  * The app may define the area where to watch the gestures, or it can define empty area:
       
    34  * then the touch is recognised inside the window.
       
    35  *
       
    36  */
       
    37 NONSHARABLE_CLASS( CTouchGestureRecogniser ): public CGestureRecogniser
       
    38 {
       
    39 public:
       
    40     static const TGestureUid KUid = EGestureUidTouch;
       
    41 
       
    42     /** Two-phase constructor */
       
    43     static CTouchGestureRecogniser* NewL(MGestureListener* aListener);
       
    44     virtual ~CTouchGestureRecogniser();
       
    45 
       
    46     /*!
       
    47      * MGestureRecogniserIf methods
       
    48      */
       
    49     virtual TGestureRecognitionState recognise(int numOfActiveStreams, MGestureEngineIf* ge) ;
       
    50     virtual void release(MGestureEngineIf* ge) ;
       
    51 
       
    52     virtual TGestureUid gestureUid() const
       
    53         {
       
    54         return KUid;
       
    55         }
       
    56 
       
    57     /*!
       
    58      * Additional methods to set up edge scroll gesture recogniser:
       
    59      * define the rectangle where the touch is watched
       
    60      * \param theArea
       
    61      */
       
    62     void setArea(const TRect& theArea) ;
       
    63 
       
    64 private:
       
    65     CTouchGestureRecogniser(MGestureListener* aListener) ;
       
    66 
       
    67 private:
       
    68     TRect m_area ;
       
    69 };
       
    70 
       
    71 } // namespace
       
    72 
       
    73 #endif /* TOUCHGESTURERECOGNISER_H_ */