videocollection/mpxmyvideoscollection/src/vcxmyvideosactivetask.cpp
changeset 34 bbb98528c666
parent 0 96612d01cf9f
child 17 69946d1824c4
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosactivetask.cpp	Thu Apr 01 23:13:36 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosactivetask.cpp	Thu Apr 01 23:22:15 2010 +0300
@@ -112,27 +112,62 @@
     }
 
 // ---------------------------------------------------------------------------
+// Get the current media
+// ---------------------------------------------------------------------------
+//
+CMPXMedia* CVcxMyVideosActiveTask::Command()
+    {
+    return iCurCommand;
+    }
+
+// ---------------------------------------------------------------------------
 // From CActive
 // ---------------------------------------------------------------------------
 //
 void CVcxMyVideosActiveTask::RunL()
     {
-    // ETrue is done, EFalse is more to do
-    //
-    if( iObserver.HandleStepL() )
+    switch ( iObserver.HandleStepL() )
         {
-        iObserver.HandleOperationCompleted( KErrNone );
-        delete iCurCommand;
-        iCurCommand = NULL;
+        case MVcxMyVideosActiveTaskObserver::EDone:
+            Done();
+            break;
+
+        case MVcxMyVideosActiveTaskObserver::EMoreToCome:
+            ContinueStepping();
+            break;
+
+        //observer is responsible for calling Done or ContinueStepping
+        case MVcxMyVideosActiveTaskObserver::EStopStepping:
+            break;
         }
-    else
-        {
-        ++iCurStep;
-        iStatus = KRequestPending;
-        SetActive();
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, KErrNone );
-        }
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosActiveTask::Done
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosActiveTask::Done()
+    {
+    MPX_DEBUG1("CVcxMyVideosActiveTask::Done() start");
+
+    iObserver.HandleOperationCompleted( KErrNone );
+    delete iCurCommand;
+    iCurCommand = NULL;
+
+    MPX_DEBUG1("CVcxMyVideosActiveTask::Done() exit");
+    }
+
+// ---------------------------------------------------------------------------
+// CVcxMyVideosActiveTask::ContinueStepping
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosActiveTask::ContinueStepping()
+    {
+    ++iCurStep;
+    iStatus = KRequestPending;
+    SetActive();
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
     }
 
 // ---------------------------------------------------------------------------