videocollection/mpxmyvideoscollection/inc/vcxmyvideosactivetask.h
branchRCL_3
changeset 16 67eb01668b0e
parent 0 96612d01cf9f
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosactivetask.h	Tue May 25 12:44:54 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosactivetask.h	Wed Jun 09 09:44:23 2010 +0300
@@ -28,11 +28,22 @@
 NONSHARABLE_CLASS( MVcxMyVideosActiveTaskObserver )
     {
 public:
+    
+    enum TStepResult
+        {
+        EMoreToCome,
+        EDone,
+        /**
+         * Observer is responsible for calling Done or ContinueStepping if returning this.
+         */
+        EStopStepping
+        };
+    
     /**
     * Handle the execution of a step
-    * @return ETrue if complete, EFalse if more to do
+    * @return TStepResult
     */
-    virtual TBool HandleStepL() = 0;
+    virtual TStepResult HandleStepL() = 0;
     /**
     * Handle the completion of the operation
     */
@@ -84,6 +95,30 @@
     */
     CMPXCommand& GetCommand();
 
+    /**
+    * Get the command for the current task.
+    * @return the current command, ownership does not move.
+    */        
+    CMPXMedia* Command();
+    
+    /**
+     * If observer returns EStopStepping from HandleStepL, then observer must call
+     * this or ContinueStepping when sub operation is finished.
+     * Can be used to run async operations.
+     */
+    void Done();
+
+    /**
+     * If observer returns EStopStepping from HandleStepL, then observer must call
+     * this or Done when sub operation is finished.
+     * Can be used to run async operations.
+     */
+    void ContinueStepping();
+
+    /**
+     * Add some functionality to CActive::Cancel
+     */
+    void Cancel();
 
 protected: // From base class
 
@@ -91,7 +126,7 @@
     * From CActive
     */
     void RunL();
-
+    
     /**
     * From CActive
     */
@@ -114,6 +149,13 @@
     */
     void ConstructL();
 
+public:
+    /**
+     * Set to ETrue when stepping is stopped.
+     * Cancel or Done has to be called.
+     */
+    TBool iStopped;
+
 private: // data
 
     CMPXCommand*  iCurCommand;  // Current Command