50 static CGestureHelperImpl* NewL( MGestureObserver& aObserver ); |
46 static CGestureHelperImpl* NewL( MGestureObserver& aObserver ); |
51 |
47 |
52 /** Destructor */ |
48 /** Destructor */ |
53 ~CGestureHelperImpl(); |
49 ~CGestureHelperImpl(); |
54 |
50 |
55 void InitAlfredPointerCaptureL( CAlfEnv& aEnv, CAlfDisplay& aDisplay, |
|
56 TInt aFreeControlGroupId ); |
|
57 |
51 |
58 /** See @ref CGestureHelper::SetHoldingEnabled */ |
52 /** See @ref CGestureHelper::SetHoldingEnabled */ |
59 void SetHoldingEnabled( TBool aEnabled ); |
53 void SetHoldingEnabled( TBool aEnabled ); |
60 /** See @ref CGestureHelper::IsHoldingEnabled */ |
54 /** See @ref CGestureHelper::IsHoldingEnabled */ |
61 TBool IsHoldingEnabled() const; |
55 TBool IsHoldingEnabled() const; |
63 void SetDoubleTapEnabled( TBool aEnabled ); |
57 void SetDoubleTapEnabled( TBool aEnabled ); |
64 /** See @ref CGestureHelper::IsDoubleTapEnabled */ |
58 /** See @ref CGestureHelper::IsDoubleTapEnabled */ |
65 TBool IsDoubleTapEnabled() const; |
59 TBool IsDoubleTapEnabled() const; |
66 /** See @ref CGestureHelper::HandlePointerEventL */ |
60 /** See @ref CGestureHelper::HandlePointerEventL */ |
67 TBool HandlePointerEventL( const TPointerEvent& aEvent ); |
61 TBool HandlePointerEventL( const TPointerEvent& aEvent ); |
68 /** See @ref CGestureHelper::OfferEventL */ |
62 |
69 TBool OfferEventL( const TAlfEvent& aEvent ); |
|
70 /** Reset helper state */ |
63 /** Reset helper state */ |
71 void Reset(); |
64 void Reset(); |
72 |
65 |
73 void SetLastEventTime() {iLastEventTime.HomeTime(); } /*CCoeEnv::Static()->LastEvent().Time();*/ |
66 void SetLastEventTime() {iLastEventTime.HomeTime(); } /*CCoeEnv::Static()->LastEvent().Time();*/ |
74 |
67 |
76 TTime GetLastEventTime() const { return iLastEventTime; } |
69 TTime GetLastEventTime() const { return iLastEventTime; } |
77 private: |
70 private: |
78 /** Constructor */ |
71 /** Constructor */ |
79 CGestureHelperImpl( MGestureObserver& aObserver ); |
72 CGestureHelperImpl( MGestureObserver& aObserver ); |
80 |
73 |
81 /** |
74 |
82 * Analyse how the pointer event affects the current gesture, and potentially |
|
83 * notify the observer. |
|
84 * @param aVisual visual on which the event fell on or NULL if not known |
|
85 * @return ETrue if the event was consumed |
|
86 */ |
|
87 TBool HandlePointerEventL( const TPointerEvent& aEvent, CAlfVisual* aVisual ); |
|
88 |
75 |
89 TBool noneAlf_HandlePointerEventL( const TPointerEvent& aEvent); |
76 TBool noneAlf_HandlePointerEventL( const TPointerEvent& aEvent); |
90 |
77 |
91 /** @return ETrue if the helper has not started processing a gesture */ |
78 /** @return ETrue if the helper has not started processing a gesture */ |
92 inline TBool IsIdle() const; |
79 inline TBool IsIdle() const; |
97 /** Activates holding and notifies observer that holding has been started */ |
84 /** Activates holding and notifies observer that holding has been started */ |
98 void StartHoldingL(); |
85 void StartHoldingL(); |
99 /* Set previous tag gesture to null (and recycle the gesture object) */ |
86 /* Set previous tag gesture to null (and recycle the gesture object) */ |
100 static void RecyclePreviousTapGesture( TAny* aSelf ); |
87 static void RecyclePreviousTapGesture( TAny* aSelf ); |
101 /** Emits a tap event since second tap of a double tap was not received within timeout */ |
88 /** Emits a tap event since second tap of a double tap was not received within timeout */ |
102 void EmitFirstTapEventL(); |
89 void EmitFirstTapEvent(); |
103 /** Emit the start gesture event that aGesture would have produced */ |
90 /** Emit the start gesture event that aGesture would have produced */ |
104 void EmitStartEventL( const CGesture& aGesture ); |
91 void EmitStartEventL( const CGesture& aGesture ); |
105 /** |
92 /** |
106 * Send code event if not holding. Also sets the event to released and emits again. |
93 * Send code event if not holding. Also sets the event to released and emits again. |
107 * Modifies aGesture! |
94 * Modifies aGesture! |
108 */ |
95 */ |
109 void CompleteAndEmitL( CGesture& aGesture ); |
96 void CompleteAndEmit( CGesture& aGesture ); |
110 /** |
97 /** |
111 * Send cancel event about the latest gesture client was notified about |
98 * Send cancel event about the latest gesture client was notified about |
112 * Sets the latest gesture to Cancelled. |
99 * Sets the latest gesture to Cancelled. |
113 */ |
100 */ |
114 void EmitCancelEventL(); |
101 void EmitCancelEvent(); |
115 |
102 |
116 /** |
103 /** |
117 * Send Released event |
104 * Send Released event |
118 */ |
105 */ |
119 void EmitReleasedEventL(); |
106 void EmitReleasedEvent(); |
120 |
107 |
121 /** Notify observer of the gesture */ |
108 /** Notify observer of the gesture */ |
122 void EmitEventL( const CGesture& aGesture ); |
109 void EmitEvent( const CGesture& aGesture ); |
123 /** |
110 /** |
124 * (re)start holding timer at the current point. |
111 * (re)start holding timer at the current point. |
125 * Does not restart holding if the point (in aEvent) is near enough to where holding |
112 * Does not restart holding if the point (in aEvent) is near enough to where holding |
126 * was started earlier. (Allows small movement but still starting holding. |
113 * was started earlier. (Allows small movement but still starting holding. |
127 */ |
114 */ |
136 CGesture* NewGesture(); |
123 CGesture* NewGesture(); |
137 /** Move the gesture into the gesture pool, and set aGesturePointer to null */ |
124 /** Move the gesture into the gesture pool, and set aGesturePointer to null */ |
138 void RecycleGesture( CGesture*& aGesturePointer ); |
125 void RecycleGesture( CGesture*& aGesturePointer ); |
139 |
126 |
140 |
127 |
141 void HandleTouchUpL(const TPointerEvent& aEvent); |
128 void HandleTouchUp(const TPointerEvent& aEvent); |
142 void HandleTouchDownL(const TPointerEvent& aEvent); |
129 void HandleTouchDownL(const TPointerEvent& aEvent); |
143 void HandleMoveL(const TPointerEvent& aEvent); |
130 void HandleMoveL(const TPointerEvent& aEvent); |
144 void HandleLongTouchL(); |
131 void HandleLongTouch(); |
145 void EmitDoubleTapEventL(); |
132 void EmitDoubleTapEvent(); |
146 TBool IsMovementGesture(TGestureCode aCode); |
133 TBool IsMovementGesture(TGestureCode aCode); |
147 |
134 |
148 private: |
135 private: |
149 /// Gesture is the logical representation of a sequence of points arriving |
136 /// Gesture is the logical representation of a sequence of points arriving |
150 /// at certain times |
137 /// at certain times |