htiui/HtiServicePlugins/HtiKeyEventServicePlugin/inc/MultiTouchPointerEvent.h
branchRCL_3
changeset 20 48060abbbeaf
parent 19 d40e813b23c0
child 21 b3cee849fa46
equal deleted inserted replaced
19:d40e813b23c0 20:48060abbbeaf
     1 /*
       
     2 * Copyright (c) 2009 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:  Functional implementation of one touch(pointer sequence) event service.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CMULTITOUCHPOINTER_UNIT_H
       
    19 #define CMULTITOUCHPOINTER_UNIT_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <HtiServicePluginInterface.h>
       
    23 #include <w32std.h>
       
    24 
       
    25 // CONSTANTS
       
    26 
       
    27 // MACROS
       
    28 
       
    29 // DATA TYPES
       
    30 
       
    31 // FUNCTION PROTOTYPES
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 
       
    35 // CLASS DECLARATION
       
    36 class CMultiTouchPointerEventHandler;
       
    37 
       
    38 /**
       
    39 *  Functional implentation of pointer event service.
       
    40 */
       
    41 class CMultiTouchPointerEvent : public CActive
       
    42     {
       
    43     public:
       
    44 
       
    45         /**
       
    46         * Two-phased constructor.
       
    47         */
       
    48         static CMultiTouchPointerEvent* NewL(TUint8 aTouchNumber,
       
    49                 CMultiTouchPointerEventHandler* aEventHandler);
       
    50 
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54         virtual ~CMultiTouchPointerEvent();       
       
    55 
       
    56 
       
    57         /**
       
    58          * Touch active object start function
       
    59          * @param aDelayTime initial wait time to start "finger" down for touch
       
    60          */
       
    61         void StartTouch();
       
    62         
       
    63         void AddPointL(TTimeIntervalMicroSeconds32 aTime,
       
    64         		TInt aX, TInt aY, TInt aZ, TRawEvent::TType aEventType);
       
    65         
       
    66         void PrintInfo();
       
    67         
       
    68         /**
       
    69          * Insert a dragging event between two given pointers
       
    70          * Interpolate pointer sequence with step aStepCount and dragging time.
       
    71          * @param aX1, aY1, aZ1 3D coordinate of start point
       
    72          * @param aX2, aY2, aZ2 3D coordinate of end point
       
    73          * @param aDragTime dragging time between start point and end point
       
    74          * @param aStepCount step count between two points
       
    75          */
       
    76         void InterpolatePointL(TInt aX1,TInt aY1, TInt aZ1, TInt aX2,TInt aY2, TInt aZ2, 
       
    77                 TTimeIntervalMicroSeconds32 aDragTime, TInt aStepCount);
       
    78         
       
    79     protected: // Functions from base classes
       
    80 
       
    81         // From CActive
       
    82         void RunL();
       
    83         TInt RunError(TInt aError);
       
    84         void DoCancel();
       
    85 
       
    86     private:
       
    87 
       
    88         /**
       
    89         * C++ default constructor.
       
    90         */
       
    91         CMultiTouchPointerEvent(TUint8 aTouchNumber, CMultiTouchPointerEventHandler* aEventHandler);
       
    92 
       
    93         /**
       
    94         * 2nd phase constructor.
       
    95         */
       
    96         void ConstructL();
       
    97 
       
    98         void  SimulatePointerEvent();
       
    99         
       
   100         /**
       
   101          * Insert an advanced pointer to pointer sequence array for a touch
       
   102          * @param aX, aY, aZ pointer 3D coordinate
       
   103          * @param aEventType event type
       
   104          */
       
   105         void InsertPointArrayL(TInt aX, TInt aY, TInt aZ, TRawEvent::TType aEventType);
       
   106 
       
   107         /**
       
   108          * Insert time duration to time array
       
   109          * @param aDelayTime time duation to wait for
       
   110          */
       
   111         void InsertTimeArrayL(TTimeIntervalMicroSeconds32 aDelayTime); 
       
   112         
       
   113     private: // data
       
   114 
       
   115         struct TAdvancedPointer
       
   116             {
       
   117             TInt             X;
       
   118             TInt             Y;
       
   119             TInt             Z; 
       
   120             TRawEvent::TType EventType;
       
   121             };  
       
   122         
       
   123         CMultiTouchPointerEventHandler* iEventHandler;
       
   124         TUint8 iTouchNumber;
       
   125 
       
   126         RTimer iTimer;
       
   127 
       
   128 		RPointerArray<TAdvancedPointer> iAdvPointerArray;
       
   129 		RPointerArray<TTimeIntervalMicroSeconds32> iTimeArray;
       
   130 		};
       
   131 
       
   132 #endif // CMULTITOUCHPOINTER_UNIT_H