ImagePrint/ImagePrintEngine/DeviceProtocols/dpof/inc/cfilemanager.h
branchGCC_SURGE
changeset 25 59ea2209bb67
parent 23 08cc4cc059d4
parent 15 a92d00fca574
equal deleted inserted replaced
23:08cc4cc059d4 25:59ea2209bb67
     1 /*
       
     2 * Copyright (c) 2004-2007 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CFILEMANAGER_H
       
    20 #define CFILEMANAGER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 
       
    25 class CFileManager : public CActive
       
    26 	{
       
    27 	public:
       
    28 
       
    29 		static CFileManager* NewL( RFs& aFs );
       
    30 		~CFileManager();	
       
    31 		
       
    32 	public:
       
    33 	
       
    34 		TInt Copy( const TDesC& aFile, const TDesC& aDir, TRequestStatus& aStatus );
       
    35 		void CancelCopy();
       
    36 		TInt RmDir( const TDesC& aDir, TRequestStatus& aStatus );
       
    37 		void CancelRmDir();
       
    38 
       
    39 	private:
       
    40 
       
    41 		CFileManager( RFs& aFs );
       
    42 		void ConstructL();
       
    43 		
       
    44 	protected: // from CActive
       
    45 	
       
    46 		void DoCancel();
       
    47 		void RunL();
       
    48 		TInt RunError( TInt aError );
       
    49 		
       
    50 	private:
       
    51 	
       
    52 		void CloseCopy();
       
    53 		void InitCopyL( const TDesC& aFile, const TDesC& aDir );
       
    54 		
       
    55 	private:
       
    56 		
       
    57 		enum TOperation
       
    58 			{
       
    59 			EFileManCopy = 0,
       
    60 			EBufferCopy,
       
    61 			ERemoveDir
       
    62 			};
       
    63 				
       
    64 	private: // data
       
    65 	
       
    66 		RFs& iFs;
       
    67 		CFileMan* iFileMan;
       
    68 		TOperation iOperation;
       
    69 		TRequestStatus* iCallerStatus;		
       
    70 		RFile iSource;
       
    71 		RFile iDest;
       
    72 		HBufC8* iBuffer;
       
    73 		TInt iBytesLeft;
       
    74 		TInt iBytesNum;		
       
    75 	};
       
    76 
       
    77 
       
    78 #endif // CFILEMANAGER_H
       
    79 
       
    80 //  End of File