htiui/HtiServicePlugins/HtiKeyEventServicePlugin/inc/PointerEventHandler.h
branchRCL_3
changeset 3 2703485a934c
parent 0 d6fe6244b863
child 11 4df3a095718c
equal deleted inserted replaced
0:d6fe6244b863 3:2703485a934c
    13 *
    13 *
    14 * Description:  Functional implentation of pointer event service.
    14 * Description:  Functional implentation of pointer event service.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
       
    19 #ifndef CPOINTEREVENTHANDLER_H
    18 #ifndef CPOINTEREVENTHANDLER_H
    20 #define CPOINTEREVENTHANDLER_H
    19 #define CPOINTEREVENTHANDLER_H
    21 
    20 
    22 // INCLUDES
    21 // INCLUDES
    23 #include <HTIServicePluginInterface.h>
    22 #include <HtiServicePluginInterface.h>
    24 #include <w32std.h>
    23 #include <w32std.h>
    25 
    24 
    26 // CONSTANTS
    25 // CONSTANTS
    27 
    26 
    28 // MACROS
    27 // MACROS
    32 // FUNCTION PROTOTYPES
    31 // FUNCTION PROTOTYPES
    33 
    32 
    34 // FORWARD DECLARATIONS
    33 // FORWARD DECLARATIONS
    35 
    34 
    36 // CLASS DECLARATION
    35 // CLASS DECLARATION
       
    36 
    37 
    37 
    38 /**
    38 /**
    39 *  Functional implentation of pointer event service.
    39 *  Functional implentation of pointer event service.
    40 */
    40 */
    41 class CPointerEventHandler : public CActive
    41 class CPointerEventHandler : public CActive
    55             ETapScreen = 0x10,
    55             ETapScreen = 0x10,
    56             ETapAndDrag = 0x11,
    56             ETapAndDrag = 0x11,
    57             ETapAndDragMultipoint = 0x12,
    57             ETapAndDragMultipoint = 0x12,
    58             EPressPointerDown = 0x13,
    58             EPressPointerDown = 0x13,
    59             ELiftPointerUp = 0x14,
    59             ELiftPointerUp = 0x14,
       
    60 			EAdvancedTapScreen = 0x15, //for advanced
       
    61 			EPinchZoom = 0x16, //for advanced
    60             EResultOk = 0xFF // only for response message
    62             EResultOk = 0xFF // only for response message
    61             };
    63             };
    62 
    64 
    63         enum TPointerState
    65         enum TPointerState
    64             {
    66             {
    65             EPointerUp,
    67             EPointerUp,
    66             EPointerDown,
    68             EPointerDown,
    67             EPointerMoving
    69             EPointerMoving
    68             };
    70             };
       
    71 
       
    72         struct TAdvancedPointer
       
    73             {
       
    74             TUint8 PointerNum;
       
    75             TInt   X;
       
    76             TInt   Y;
       
    77             TInt   Z;            
       
    78             };			
       
    79 
       
    80 			
    69 
    81 
    70         /**
    82         /**
    71         * Two-phased constructor.
    83         * Two-phased constructor.
    72         */
    84         */
    73         static CPointerEventHandler* NewL();
    85         static CPointerEventHandler* NewL();
   115         // Helper methods
   127         // Helper methods
   116         void HandleTapScreenL( const TDesC8& aData );
   128         void HandleTapScreenL( const TDesC8& aData );
   117         void HandleTapAndDragL( const TDesC8& aData );
   129         void HandleTapAndDragL( const TDesC8& aData );
   118         void HandleTapAndDragMultipointL( const TDesC8& aData );
   130         void HandleTapAndDragMultipointL( const TDesC8& aData );
   119         void HandlePointerDownOrUpL( const TDesC8& aData );
   131         void HandlePointerDownOrUpL( const TDesC8& aData );
       
   132 		void HandleAdvancedTapScreenL( const TDesC8& aData ); //for advanced
       
   133         void HandlePinchZoomL( const TDesC8& aData ); //for advanced
   120 
   134 
   121         void SendOkMsgL();
   135         void SendOkMsgL();
   122         void SendErrorMessageL( TInt aError, const TDesC8& aDescription );
   136         void SendErrorMessageL( TInt aError, const TDesC8& aDescription );
   123 
   137 
   124         void ChangePointerStateL();
   138         void ChangePointerStateL();
   125         void MoveToNextPointL();
   139         void MoveToNextPointL();
   126         void PointerDown();
   140         void PointerDown();
   127         void PointerUp();
   141         void PointerUp();
   128         void PointerMove();
   142         void PointerMove();
   129         void SimulatePointerEvent( TRawEvent::TType aType );
   143         void SimulatePointerEvent( TRawEvent::TType aType );
       
   144         TBool IsMultitouch();
       
   145         void AdvanceAddMiddlePointL(TInt aPointNumber,TInt aX1,TInt aY1, TInt aZ1,TInt aX2,TInt aY2, TInt aZ2 , TInt aStepCount );
       
   146         void AdvancedAddDelayArray(TTimeIntervalMicroSeconds32 aDelay , TInt aStepCount );
       
   147         TBool AdvancedStartDelay();
   130 
   148 
   131 
   149 
   132     private: // data
   150     private: // data
   133 
   151 
   134         RWsSession iWsSession;
   152         RWsSession iWsSession;
   142         TInt   iTapCount;
   160         TInt   iTapCount;
   143         TTimeIntervalMicroSeconds32 iEventDelay;
   161         TTimeIntervalMicroSeconds32 iEventDelay;
   144         TTimeIntervalMicroSeconds32 iActionDelay;
   162         TTimeIntervalMicroSeconds32 iActionDelay;
   145         TPointerState iState;
   163         TPointerState iState;
   146         RArray<TInt>* iCoords;
   164         RArray<TInt>* iCoords;
   147     };
   165 		RPointerArray<TAdvancedPointer> iAdvancedPointers;
       
   166 		
       
   167 		RPointerArray<TAdvancedPointer> iAdvPointerMoveArray;
       
   168 		RPointerArray<TTimeIntervalMicroSeconds32> iDelayArray;
       
   169 		};
   148 
   170 
   149 #endif // CKEYEVENTHANDLER_H
   171 #endif // CKEYEVENTHANDLER_H