mpxmusicplayer/inc/mpxsavehelper.h
changeset 0 ff3acec5bc43
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2006 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 "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:  MPX asynchronous save helper utility
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMPXSAVEHELPER_H
       
    21 #define CMPXSAVEHELPER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <f32file.h>
       
    25 #include <e32base.h>
       
    26 
       
    27 // INTERFACE DEFINITION
       
    28 /**
       
    29 *  Observer class for Async operation
       
    30 */
       
    31 NONSHARABLE_CLASS(MMPXSaveHelperObserver)
       
    32     {
       
    33 public:
       
    34     /**
       
    35     * 
       
    36     *  @param aBitmap a converted image.
       
    37     *  @param aErr error code
       
    38     */
       
    39     virtual void HandleSaveComplete( TInt aErr ) = 0;
       
    40     };
       
    41 
       
    42 
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 /**
       
    47 *  CMPXSaveHelper
       
    48 */
       
    49 NONSHARABLE_CLASS(CMPXSaveHelper) : public CActive
       
    50     {
       
    51     public:  // Constructors and destructor
       
    52         
       
    53         /**
       
    54         * Two-phased constructor.
       
    55         */
       
    56         IMPORT_C static CMPXSaveHelper* NewL( MMPXSaveHelperObserver* aObserver, MFileManObserver* aFMObserver );
       
    57                  
       
    58         /**
       
    59         * Destructor.
       
    60         */
       
    61         IMPORT_C virtual ~CMPXSaveHelper();
       
    62 
       
    63     public: // New functions
       
    64         
       
    65         /**
       
    66         * Starts async copy operation
       
    67         * @param anOld source
       
    68         * @param aNew target
       
    69         * @param aMove flag whether to move or just copy
       
    70         * @return void
       
    71         */
       
    72         IMPORT_C void StartCopyOperationL( const TDesC& anOld,
       
    73                                            const TDesC& aNew,
       
    74                                            TBool aMove=EFalse );
       
    75 
       
    76         /**
       
    77         * Starts async copy operation
       
    78         * @param anOldFile source
       
    79         * @param aNew target
       
    80         * @param aMove flag whether to move or just copy
       
    81         * @return void
       
    82         */
       
    83         IMPORT_C void StartCopyOperationL( RFile& anOldFile, 
       
    84                                            const TDesC& aNew,
       
    85                                            TBool aMove=EFalse,
       
    86                                            TBool aSync=EFalse );
       
    87 
       
    88    private: // Constructors
       
    89 
       
    90         /**
       
    91         * C++ default constructor.
       
    92         */
       
    93         CMPXSaveHelper( MMPXSaveHelperObserver* aObserver );
       
    94 
       
    95         /**
       
    96         * By default Symbian 2nd phase constructor is private.
       
    97         */
       
    98         void ConstructL( MFileManObserver* aFMObserver );
       
    99 
       
   100     private: 
       
   101         
       
   102         // From CActive
       
   103         
       
   104         /** @see CActive::RunL() */
       
   105         void RunL();
       
   106         
       
   107         /** @see CActive::DoCancel() */
       
   108         void DoCancel();
       
   109 
       
   110     private:    // Data
       
   111         CFileMan* iFileMan;
       
   112         MMPXSaveHelperObserver* iObserver; // not owned
       
   113     };
       
   114 
       
   115 #endif      // CMPXSAVEHELPER_H 
       
   116             
       
   117 // End of File