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 advanced pointer multitouch service. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CMULTITOUCHPOINTEREVENTHANDLER_H |
|
19 #define CMULTITOUCHPOINTEREVENTHANDLER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <HtiServicePluginInterface.h> |
|
23 |
|
24 // CONSTANTS |
|
25 |
|
26 // MACROS |
|
27 |
|
28 // DATA TYPES |
|
29 |
|
30 // FUNCTION PROTOTYPES |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 |
|
34 // CLASS DECLARATION |
|
35 class CMultiTouchPointerEvent; |
|
36 |
|
37 /** |
|
38 * Observer interface for Multi touch event. |
|
39 */ |
|
40 class MHtiMultiTouchObserver |
|
41 { |
|
42 public: |
|
43 /** |
|
44 * Notify multi touch event completed |
|
45 */ |
|
46 virtual void NotifyMultiTouchComplete() = 0; |
|
47 |
|
48 }; |
|
49 /** |
|
50 * Functional implentation of pointer event service. |
|
51 */ |
|
52 class CMultiTouchPointerEventHandler: public CBase |
|
53 { |
|
54 public: |
|
55 /** |
|
56 * Two-phased constructor. |
|
57 */ |
|
58 static CMultiTouchPointerEventHandler* NewL(MHtiMultiTouchObserver& aObserver); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CMultiTouchPointerEventHandler(); |
|
64 |
|
65 |
|
66 TBool HandleMultiTouchL( const TDesC8& aData ); |
|
67 |
|
68 /** |
|
69 * Callback function called by CMultiTouchPointerEvent to notify CMultiTouchPointerEventHandler |
|
70 * that this touch action(pointer sequence) is conpleted. |
|
71 * @param aTouchNumber touch number ordinal |
|
72 */ |
|
73 void NotifyTouchComplete(TUint8 aTouchNumber); |
|
74 |
|
75 void SimulateEvent(TUint8 aTouchNumber,TInt aX, TInt aY, TInt aZ, TRawEvent::TType aEventType); |
|
76 |
|
77 void Clear(); |
|
78 |
|
79 private: |
|
80 |
|
81 /** |
|
82 * C++ default constructor. |
|
83 */ |
|
84 CMultiTouchPointerEventHandler(MHtiMultiTouchObserver& aObserver); |
|
85 |
|
86 /** |
|
87 * 2nd phase constructor. |
|
88 */ |
|
89 void ConstructL(); |
|
90 |
|
91 TBool ParsePoint( const TDesC8& aData, TInt& aoffset, |
|
92 TInt& aX, TInt& aY, TInt& aZ, |
|
93 TTimeIntervalMicroSeconds32& aWait, TTimeIntervalMicroSeconds32& aHold ); |
|
94 |
|
95 TBool ParseMove( const TDesC8& aData, TInt& aoffset, |
|
96 TTimeIntervalMicroSeconds32& aDragTime, TInt& aStepCount ); |
|
97 |
|
98 private: // data |
|
99 RWsSession iWsSession; |
|
100 RPointerArray<CMultiTouchPointerEvent> iTouchPointerArray; |
|
101 TUint8 iFinishedCount; |
|
102 |
|
103 MHtiMultiTouchObserver& iObserver; |
|
104 }; |
|
105 |
|
106 #endif // CKEYEVENTHANDLER_H |
|