messagingfw/msgsrvnstore/server/inc/CMsvBackupHandler.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #include <babackup.h>
       
    18 #include <f32file.h>
       
    19 
       
    20 class CMsvServer;
       
    21 
       
    22 class CMsvBackupHandler : public CBase, public MBackupObserver
       
    23 /**
       
    24 @internalComponent
       
    25 @released
       
    26 */
       
    27 	{
       
    28 public:
       
    29 	static CMsvBackupHandler* NewL(CMsvServer &aServer);
       
    30 	~CMsvBackupHandler();
       
    31 	// from MBackupObserver
       
    32 	virtual void ChangeFileLockL(const TDesC& aFileAffected, TFileLockFlags aFlags);
       
    33 	TBool Locked();
       
    34 private:
       
    35 	void ConstructL();
       
    36 	CMsvBackupHandler(CMsvServer &aServer);
       
    37 	TBool DetachFromFile(TInt aErrorState);
       
    38 	void ReloadContextL();
       
    39 	
       
    40 private:
       
    41 	enum TFileState {
       
    42 		EHaveLock=0,
       
    43 		EReleasedForBackup,
       
    44 		EReleasedForRestore
       
    45 	};
       
    46 	CMsvServer &iServer;
       
    47 	CBaBackupSessionWrapper *iBackup;
       
    48 	TFileState iState;
       
    49 	TFileName iFileName;	
       
    50 	TEntry iEntry;
       
    51 	};
       
    52