videocollection/hgmyvideos/inc/vcxhgmyvideosvideocopier.h
branchRCL_3
changeset 57 befca0ec475f
parent 0 96612d01cf9f
equal deleted inserted replaced
56:839377eedc2b 57:befca0ec475f
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:      Class for handling move/copy related notes and operations.*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef VCXHGMYVIDEOSVIDEOCOPIER_H
       
    21 #define VCXHGMYVIDEOSVIDEOCOPIER_H
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include <e32base.h>
       
    25 #include <AknProgressDialog.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CVcxHgMyVideosVideoListImpl;
       
    29 class CVcxHgMyVideosVideoModelHandler;
       
    30 class CVcxHgMyVideosModel;
       
    31 class CAknWaitDialog;
       
    32 
       
    33 /**
       
    34  * Class for handling move/copy related notes and operations.
       
    35  * 
       
    36  * @lib vcxhgmyvideos.lib 
       
    37  */
       
    38 NONSHARABLE_CLASS( CVcxHgMyVideosVideoCopier ) : public CBase,
       
    39                                                  public MProgressDialogCallback
       
    40     {
       
    41     public:
       
    42 
       
    43         /**
       
    44          * Two-phased constructor.
       
    45          * 
       
    46          * @param aVideoList Video list implementation.
       
    47          * @param aVideoModel Video model handler.
       
    48          * @param aModel Component's model.
       
    49          */
       
    50         static CVcxHgMyVideosVideoCopier* NewL( CVcxHgMyVideosVideoListImpl& aVideoList,
       
    51                                                 CVcxHgMyVideosVideoModelHandler& aVideoModel,
       
    52                                                 CVcxHgMyVideosModel& aModel );
       
    53 
       
    54         /**
       
    55          * Destructor.
       
    56          */
       
    57         virtual ~CVcxHgMyVideosVideoCopier();
       
    58     
       
    59         /**
       
    60          * Cheks status of currently selected items and UI list. Returns
       
    61          * flags that tell which move/copy realted menu items can be shown. 
       
    62          * 
       
    63          * @param aOperationTargets List of operation targets on UI.
       
    64          * @param aShowMoveAndCopySubmenu On return, ETrue if move/copy submenu can be shown.
       
    65          * @param aShowCopy On return, ETrue if copy menu item can be shown.
       
    66          * @param aShowMove On return, ETrue if move menu item can be shown.
       
    67          */
       
    68         void ShowMenuItemsL( 
       
    69                 const RArray<TInt>& aOperationTargets,
       
    70                 TBool& aShowMoveAndCopySubmenu,
       
    71                 TBool& aShowCopy,
       
    72                 TBool& aShowMove );
       
    73 
       
    74         /**
       
    75          * Moves or copies videos. Also shows memory selection dialog and
       
    76          * move/copy wait note.
       
    77          *
       
    78          * @param aOperationTargets List of operation targets on UI.
       
    79          * @param aCopy ETrue for copy operation, EFalse for move. 
       
    80          */        
       
    81         void MoveOrCopyL( 
       
    82                 const RArray<TInt>& aOperationTargets,
       
    83                 TBool aCopy );
       
    84 
       
    85         /**
       
    86          * Called by video list impl when move or copy command is completed.
       
    87          * 
       
    88          * @param aFailedCount Count of items that could not be moved/copied.
       
    89          * @param aFailedName Name of video where move/copy failed, if there was only one.
       
    90          */
       
    91         void VideoMoveOrCopyCompletedL( TInt aFailedCount, const TDesC& aFailedName );           
       
    92 
       
    93     public: // From MProgressDialogCallback
       
    94 
       
    95         /**
       
    96          * Called when (move/copy) wait dialog is dismissed.
       
    97          *
       
    98          * @aButtonId Button with which dialog was dismissed.
       
    99          */     
       
   100         void DialogDismissedL( TInt aButtonId );           
       
   101         
       
   102     protected:
       
   103 
       
   104         CVcxHgMyVideosVideoCopier( CVcxHgMyVideosVideoListImpl& aVideoList,
       
   105                                    CVcxHgMyVideosVideoModelHandler& aVideoModel,
       
   106                                    CVcxHgMyVideosModel& aModel );                
       
   107 
       
   108         void ConstructL();
       
   109 
       
   110         /**
       
   111          * Queries user for target drive.
       
   112          * 
       
   113          * @param aCopy ETrue for copy operation, EFalse for move.
       
   114          * @param aTargetDrive On return, target drive.
       
   115          * @return ETrue if user accepted target.
       
   116          */
       
   117         TBool QueryTargetDriveL( TBool aCopy, TInt& aTargetDrive );
       
   118         
       
   119         /**
       
   120          * Opens the move/copy wait note.
       
   121          * 
       
   122          * @param aOperationTargets Operation targets.
       
   123          * @param aCopy ETrue for copy operation, EFalse for move.
       
   124          */
       
   125         void OpenMoveCopyWaitNoteL( const RArray<TInt>& aOperationTargets,
       
   126                                     TBool aCopy );
       
   127 
       
   128         /**
       
   129          * Closes the move/copy wait note.
       
   130          */
       
   131         void CloseMoveCopyWaitNote();         
       
   132 
       
   133     protected: // data
       
   134 
       
   135         /**
       
   136          * Reference to video list implementation.
       
   137          * Not own.
       
   138          */
       
   139         CVcxHgMyVideosVideoListImpl& iVideoList;
       
   140         
       
   141         /**
       
   142          * Reference to video model handler.
       
   143          * Not own.
       
   144          */        
       
   145         CVcxHgMyVideosVideoModelHandler& iVideoModel;
       
   146         
       
   147         /**
       
   148          * Reference to component's model.
       
   149          * Not own.
       
   150          */
       
   151         CVcxHgMyVideosModel& iModel;
       
   152 
       
   153         /**
       
   154          * Move/copy wait dialog.
       
   155          * Own.
       
   156          */
       
   157         CAknWaitDialog* iMoveCopyWaitDialog;
       
   158         
       
   159         /**
       
   160          * Flag telling if latest operation was copy (ETrue) or move (EFalse).
       
   161          */
       
   162         TBool iCopy;
       
   163     };
       
   164 
       
   165 #endif // VCXHGMYVIDEOSVIDEOCOPIER_H