taskswitcher/taskswitcherui/taskswitcherapp/src/tseventcontroler.cpp
branchRCL_3
changeset 16 9674c1a575e9
parent 15 ff572dfe6d86
child 30 b8fae6b8a148
--- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tseventcontroler.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tseventcontroler.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -65,7 +65,8 @@
     MTsEventControlerObserver& aObserver)
     :
     CBase(),
-    iObserver(aObserver)
+    iObserver(aObserver),
+    iHandleEvents(ETrue)
     {
     }
 
@@ -88,15 +89,18 @@
 void CTsEventControler::HandleTouchGestureL(
     AknTouchGestureFw::MAknTouchGestureFwEvent& aEvent)
     {
-    if (AknTouchGestureFwEventDrag(aEvent))
+    if ( iHandleEvents )
         {
-        HandleDragEventL(*AknTouchGestureFwEventDrag(aEvent));
+        if (AknTouchGestureFwEventDrag(aEvent))
+            {
+            HandleDragEventL(*AknTouchGestureFwEventDrag(aEvent));
+            }
+        else if (AknTouchGestureFwEventTap(aEvent))
+            {
+            HandleTapEventL(*AknTouchGestureFwEventTap(aEvent));
+            }
+        //ignore flick and pinch events
         }
-    else if (AknTouchGestureFwEventTap(aEvent))
-        {
-        HandleTapEventL(*AknTouchGestureFwEventTap(aEvent));
-        }
-    //ignore flick and pinch events
     }
 
 // -----------------------------------------------------------------------------
@@ -114,12 +118,7 @@
         {
         if( IsPhysicsRunning() )
             {
-            TBool forwardTap = iPhysicsHelper->IsDragging();
             iPhysicsHelper->Stop();
-            if ( forwardTap )
-                {
-                iObserver.TapL(aEvent.Position());
-                }
             }
         else
             {
@@ -136,7 +135,10 @@
     MAknTouchGestureFwDragEvent& aEvent)
     {
     iObserver.DragL(aEvent);
-    iPhysicsHelper->HandleDragEvent(aEvent);
+    if ( iHandleEvents )
+        {
+        iPhysicsHelper->HandleDragEvent(aEvent);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -144,10 +146,10 @@
 // -----------------------------------------------------------------------------
 //
 void CTsEventControler::ViewPositionChanged(const TPoint& aNewPosition,
-    TBool /*aDrawNow*/,
+    TBool aDrawNow,
     TUint /*aFlags*/)
     {
-    iObserver.MoveOffset(aNewPosition);
+    iObserver.MoveOffset(aNewPosition, aDrawNow);
     }
 
 // -----------------------------------------------------------------------------
@@ -205,4 +207,18 @@
     iPhysicsHelper->Stop();
     }
 
+
+// -----------------------------------------------------------------------------
+// EnableEventHandling
+// -----------------------------------------------------------------------------
+//
+void CTsEventControler::EnableEventHandling( TBool aEnable )
+    {
+    iHandleEvents = aEnable;
+    if ( !aEnable && IsPhysicsRunning() )
+        {
+        iPhysicsHelper->Stop();
+        }
+    }
+
 // end of file