voicerecorder/UtilsInc/TVRRename.h
branchRCL_3
changeset 20 072a5fa0c63b
parent 19 2f5c9ee7098c
child 21 c6bafb5162d8
equal deleted inserted replaced
19:2f5c9ee7098c 20:072a5fa0c63b
     1 /*
       
     2 * Copyright (c) 2002-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: 
       
    15 *     This class encapsulates the functionality associated with renaming
       
    16 *     files in different situation. The implementation is made according
       
    17 *     to the Folders v.4.0 specification.
       
    18 *
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 #ifndef __TVRRENAME_H
       
    24 #define __TVRRENAME_H
       
    25 
       
    26 //  INCLUDES
       
    27 #include <e32base.h>
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  This class provides functionality to use in renaming operations
       
    33 */
       
    34 class TVRRename
       
    35     {
       
    36     public:  // Constructors and destructor
       
    37         
       
    38         /**
       
    39         * C++ constructor.
       
    40 		* @param aFs A reference to an open file server session.
       
    41         */
       
    42         IMPORT_C TVRRename( RFs& aFs );
       
    43 
       
    44     public: // New functions
       
    45         
       
    46         /**
       
    47         * This method executes a set of operations to do a file renaming operation
       
    48 		* according to the Folders specification v.4.0. The method doesn't do the
       
    49 		* actual renaming of the file, but returns the result path.
       
    50 		*
       
    51         * @param aOldName A descriptor containing path to the file to be renamed.
       
    52 		* @param aNewName A descriptor with a size of atleast KMaxFileName. The
       
    53 		*        new path for the renamed is stored here. Do not rely on the contents
       
    54 		*        of this descriptor if the method returns EFalse.
       
    55         * @param aPrompt A resource id to a string that is used as a prompt for the
       
    56 		*        name query dialog.
       
    57         * @return (TBool) ETrue if the user confirmed the operation. 
       
    58 		*         EFalse if the user canceled the operation.
       
    59         */
       
    60 		IMPORT_C TBool GetNewNameL( const TDesC& aOldName, TDes& aNewName, const TInt aPrompt );
       
    61 
       
    62         /**
       
    63         * This method executes a set of operations to do a file renaming operation
       
    64 		* according to the Folders specification v.4.0. This method carries out
       
    65 		* the actual renaming of the file.
       
    66 		*
       
    67         * @param aName A descriptor containing path to the file to be renamed.
       
    68         * @param aPrompt A resource id to a string that is used as a prompt for the
       
    69 		*        name query dialog.
       
    70         * @return (TBool) ETrue if the user confirmed the operation. 
       
    71 		*         EFalse if the user canceled the operation.
       
    72         */
       
    73 		IMPORT_C TBool RenameL( TDes& aName, const TInt aPrompt );
       
    74 
       
    75         /**
       
    76         * This method executes a set of operations to do a file renaming operation
       
    77 		* according to the Folders specification v.4.0. This method carries out
       
    78 		* the actual renaming of the file.
       
    79 		*
       
    80         * @param aFile A handle to the file to be renamed
       
    81         * @param aPrompt A resource id to a string that is used as a prompt for the
       
    82 		*        name query dialog.
       
    83         * @return (TBool) ETrue if the user confirmed the operation. 
       
    84 		*         EFalse if the user canceled the operation.
       
    85         */
       
    86 		IMPORT_C TBool RenameL( RFile& aFile, const TInt aPrompt );
       
    87 
       
    88     private:    // Data
       
    89 
       
    90 		// A reference to an open file server session
       
    91         RFs& iFs;
       
    92 
       
    93     };
       
    94 
       
    95 #endif     // __TVRRENAME_H  
       
    96             
       
    97 // End of File