86 // ----------------------------------------------------------------------------- |
87 // ----------------------------------------------------------------------------- |
87 // |
88 // |
88 void CTsEventControler::HandleTouchGestureL( |
89 void CTsEventControler::HandleTouchGestureL( |
89 AknTouchGestureFw::MAknTouchGestureFwEvent& aEvent) |
90 AknTouchGestureFw::MAknTouchGestureFwEvent& aEvent) |
90 { |
91 { |
91 if (AknTouchGestureFwEventDrag(aEvent)) |
92 if ( iHandleEvents ) |
92 { |
93 { |
93 HandleDragEventL(*AknTouchGestureFwEventDrag(aEvent)); |
94 if (AknTouchGestureFwEventDrag(aEvent)) |
94 } |
95 { |
95 else if (AknTouchGestureFwEventTap(aEvent)) |
96 HandleDragEventL(*AknTouchGestureFwEventDrag(aEvent)); |
96 { |
97 } |
97 HandleTapEventL(*AknTouchGestureFwEventTap(aEvent)); |
98 else if (AknTouchGestureFwEventTap(aEvent)) |
98 } |
99 { |
99 //ignore flick and pinch events |
100 HandleTapEventL(*AknTouchGestureFwEventTap(aEvent)); |
|
101 } |
|
102 //ignore flick and pinch events |
|
103 } |
100 } |
104 } |
101 |
105 |
102 // ----------------------------------------------------------------------------- |
106 // ----------------------------------------------------------------------------- |
103 // HandleTapEventL |
107 // HandleTapEventL |
104 // ----------------------------------------------------------------------------- |
108 // ----------------------------------------------------------------------------- |
112 } |
116 } |
113 else if(EAknTouchGestureFwTap == aEvent.Type()) |
117 else if(EAknTouchGestureFwTap == aEvent.Type()) |
114 { |
118 { |
115 if( IsPhysicsRunning() ) |
119 if( IsPhysicsRunning() ) |
116 { |
120 { |
117 TBool forwardTap = iPhysicsHelper->IsDragging(); |
|
118 iPhysicsHelper->Stop(); |
121 iPhysicsHelper->Stop(); |
119 if ( forwardTap ) |
|
120 { |
|
121 iObserver.TapL(aEvent.Position()); |
|
122 } |
|
123 } |
122 } |
124 else |
123 else |
125 { |
124 { |
126 iObserver.TapL(aEvent.Position()); |
125 iObserver.TapL(aEvent.Position()); |
127 } |
126 } |
134 // |
133 // |
135 void CTsEventControler::HandleDragEventL( |
134 void CTsEventControler::HandleDragEventL( |
136 MAknTouchGestureFwDragEvent& aEvent) |
135 MAknTouchGestureFwDragEvent& aEvent) |
137 { |
136 { |
138 iObserver.DragL(aEvent); |
137 iObserver.DragL(aEvent); |
139 iPhysicsHelper->HandleDragEvent(aEvent); |
138 if ( iHandleEvents ) |
|
139 { |
|
140 iPhysicsHelper->HandleDragEvent(aEvent); |
|
141 } |
140 } |
142 } |
141 |
143 |
142 // ----------------------------------------------------------------------------- |
144 // ----------------------------------------------------------------------------- |
143 // PhysicEmulationEnded |
145 // PhysicEmulationEnded |
144 // ----------------------------------------------------------------------------- |
146 // ----------------------------------------------------------------------------- |
145 // |
147 // |
146 void CTsEventControler::ViewPositionChanged(const TPoint& aNewPosition, |
148 void CTsEventControler::ViewPositionChanged(const TPoint& aNewPosition, |
147 TBool /*aDrawNow*/, |
149 TBool aDrawNow, |
148 TUint /*aFlags*/) |
150 TUint /*aFlags*/) |
149 { |
151 { |
150 iObserver.MoveOffset(aNewPosition); |
152 iObserver.MoveOffset(aNewPosition, aDrawNow); |
151 } |
153 } |
152 |
154 |
153 // ----------------------------------------------------------------------------- |
155 // ----------------------------------------------------------------------------- |
154 // PhysicEmulationEnded |
156 // PhysicEmulationEnded |
155 // ----------------------------------------------------------------------------- |
157 // ----------------------------------------------------------------------------- |
203 void CTsEventControler::StopAnimation() |
205 void CTsEventControler::StopAnimation() |
204 { |
206 { |
205 iPhysicsHelper->Stop(); |
207 iPhysicsHelper->Stop(); |
206 } |
208 } |
207 |
209 |
|
210 |
|
211 // ----------------------------------------------------------------------------- |
|
212 // EnableEventHandling |
|
213 // ----------------------------------------------------------------------------- |
|
214 // |
|
215 void CTsEventControler::EnableEventHandling( TBool aEnable ) |
|
216 { |
|
217 iHandleEvents = aEnable; |
|
218 if ( !aEnable && IsPhysicsRunning() ) |
|
219 { |
|
220 iPhysicsHelper->Stop(); |
|
221 } |
|
222 } |
|
223 |
208 // end of file |
224 // end of file |