--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosasyncfileoperations.h Mon Mar 15 12:40:47 2010 +0200
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosasyncfileoperations.h Wed Mar 31 21:34:36 2010 +0300
@@ -33,6 +33,7 @@
// FORWARD DECLARATIONS
class CVcxMyVideosCollectionPlugin;
+class CVcxMyVideosAsyncFileCopy;
// CONSTANTS
@@ -92,9 +93,8 @@
*
* @param aMdsId MDS id of the item to be moved.
* @param aTargetDrive Target drive.
- * @param aMove If ETrue, the source file is deleted.
*/
- void MoveOrCopyVideoL( TUint32 aMdsId, TInt aTargetDrive, TBool aMove );
+ void MoveOrCopyVideoL( TUint32 aMdsId, TInt aTargetDrive );
/**
* Generates and sends resp message for Move,Copy and Delete operations.
@@ -143,6 +143,29 @@
void GenerateTargetPathForMoveOrCopyL(
const TDesC& aSourcePath, TDes& aTargetPath, TInt aTargetDrive );
+ /**
+ * Initializes member variables for the Copy or Move operations.
+ *
+ * @param aCmd Command received from collection client.
+ */
+ void InitMoveOrCopyOperationsL( CMPXMedia& aCmd );
+
+ /**
+ * Called when file copying completes in Move or Copy operations.
+ *
+ * @param aErr Result code of the file copy.
+ */
+ void HandleFileCopyCompletedL( TInt aErr );
+
+ /**
+ * Initializes MDS and collection cache before the actual file copy.
+ * Does some sanity checks also.
+ *
+ * @param aMdsId MDS ID of the video being moved/copied.
+ * @param aTargetDrive Target drive.
+ */
+ void InitSingleMoveOrCopyL( TUint32 aMdsId, TInt aTargetDrive );
+
public:
/**
@@ -174,9 +197,51 @@
TInt iTargetDrive;
/**
+ * Set to ETrue if current operation is Move.
+ */
+ TBool IsMoveOperation;
+
+ /**
* Owner of this class.
*/
CVcxMyVideosCollectionPlugin& iCollection;
+
+ /**
+ * Performs single file copy in multiple steps.
+ * Used to avoid long blockings when copying large files.
+ * Own.
+ */
+ CVcxMyVideosAsyncFileCopy* iFileCopier;
+
+ /**
+ * New media which is created to collection cache in copy operation.
+ * It is stored in memeber variable in case that file operations
+ * fail and we have to roll MDS and cache back. Own.
+ */
+ CMPXMedia* iMediaForCopyOp;
+
+ /**
+ * Updated media which is changed in move operation.
+ * It is stored in memeber variable in case that file operations
+ * fail and we have to roll MDS and cache back. Own.
+ */
+ CMPXMedia* iMediaForMoveOp;
+
+ /**
+ * Source path for move or copy operation.
+ */
+ TFileName iSourcePath;
+
+ /**
+ * Target path for move or copy operation.
+ */
+ TFileName iTargetPath;
+
+ /**
+ * Flag for move operation is stored just to avoid accessing
+ * CMPXMedia object too much.
+ */
+ TBool iIsMoveOperation;
};