remotestoragefw/remotefileengine/inc/rsfwrenamefilestatemachine.h
changeset 13 6b4fc789785b
parent 2 c32dc0be5eb4
equal deleted inserted replaced
2:c32dc0be5eb4 13:6b4fc789785b
     1 /*
       
     2 * Copyright (c) 2005-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:  State machine for renaming files
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_RSFW_RENAMEFILESTATEMACHINE_H
       
    20 #define C_RSFW_RENAMEFILESTATEMACHINE_H
       
    21 
       
    22 #include "rsfwrfestatemachine.h"
       
    23 
       
    24 /**
       
    25  *  Renames a file
       
    26  *
       
    27  *  State machine for renaming a file. Re-acquires possible lock.
       
    28  *
       
    29  */
       
    30  class CRsfwRenameFileStateMachine : public CRsfwRfeStateMachine
       
    31     {
       
    32 public:
       
    33     CRsfwRenameFileStateMachine();
       
    34     ~CRsfwRenameFileStateMachine();
       
    35         
       
    36 public: 
       
    37     class TRenameFileState : public CRsfwRenameFileStateMachine::TState
       
    38         {
       
    39     public:
       
    40         TRenameFileState(CRsfwRenameFileStateMachine *aOperation);
       
    41         void EnterL();
       
    42         TState* CompleteL();
       
    43         TState* ErrorL(TInt aCode);
       
    44     private:
       
    45         CRsfwRenameFileStateMachine* iOperation;    
       
    46         };
       
    47         
       
    48     class TAcquireLockState : public CRsfwRenameFileStateMachine::TState
       
    49         {
       
    50     public:
       
    51         TAcquireLockState(CRsfwRenameFileStateMachine *aOperation);
       
    52         void EnterL();
       
    53         TState* CompleteL();
       
    54         TState* ErrorL(TInt aCode);
       
    55     private:
       
    56         CRsfwRenameFileStateMachine* iOperation;
       
    57     private:
       
    58         TBool iRequestedLock; 
       
    59         };
       
    60              
       
    61 public:
       
    62     TState* CompleteRequestL(TInt aError);
       
    63         
       
    64 public:
       
    65     // rename or replace
       
    66     TBool iOverWrite;
       
    67     
       
    68     TPtrC iDstKidName;
       
    69         
       
    70     CRsfwFileEntry* iDstParentFep;
       
    71     CRsfwFileEntry* iSrcKidFep;
       
    72     CRsfwFileEntry* iDstKidFep;
       
    73         
       
    74     TBool iSrcKidCreated;
       
    75     TBool iDstKidCreated;
       
    76         
       
    77     CRsfwDirEntAttr* iDirEntAttr;    
       
    78     TDesC8* iLockToken;
       
    79     };
       
    80 
       
    81 
       
    82 #endif // C_RSFW_RENAMEFILESTATEMACHINE_H