diff -r 000000000000 -r d0791faffa3f backupandrestore/backupengine/inc/sbedataowner.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backupandrestore/backupengine/inc/sbedataowner.h Tue Feb 02 01:11:40 2010 +0200 @@ -0,0 +1,476 @@ +/** +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Declaration of CDataOwner +* +* +*/ + + + +/** + @file +*/ +#ifndef __DATAOWNER_H__ +#define __DATAOWNER_H__ + +/// System +#include +#include +#include +#include // MContentHandler mix in class + +// Other +#include "sbeparserproxy.h" +#include "sbebufferhandler.h" +#include "sbedataownermanager.h" + +using namespace Xml; + +namespace conn + { + + void CleanupRPointerArray(TAny* aPtr); + + /** Name of Central Repository Server + @internalTechnology + */ + + _LIT(KCentRepProcessName, "centralrepositorysrv.exe"); + _LIT8(KYes, "yes"); + + // Forwards + class CABServer; + class CDataOwnerManager; + class CBufferFileWriter; + class CBufferFileReader; + class CBufferSnapshotWriter; + class CBufferSnapshotReader; + + /** Enumeration to specify if a selection should be included or excluded + @internalComponent + */ + enum TSelectionType + { + EInclude, /* RSelections; + + /** Simple class to store passive information + @internalComponent + */ + class TPassiveInformation + { + public: + TPassiveInformation() : + iSupported(EFalse), + iSupportsSelective(EFalse), + iDeleteBeforeRestore(EFalse), + iBaseBackupOnly(EFalse) + /** C++ Constructor + */ + {} + public: + TUint8 iSupported; /*& aExclude, + const TTransferDataType aTransferType, + const TBool aIsPublic, + RSnapshots* apSnapshots, + RFileArray* apFileEntries, + CDesCArray* apFileNames); + TBool IsExcluded(const TBool aIsPublic, const TDesC& aFileName, const RArray& aExclude); + void IsNewerL(const TDesC& aFileName, const TEntry& aFile, const RSnapshots* aSnapshots, TBool& aNewer); + RSnapshots* FindSnapshot(TDriveNumber aDriveNumber); + void ResetState(); + TDataOwnerStateByDrive& StateByDriveL(TDriveNumber& aDrive); + TProxyStateByDrive& ProxyStateByDriveL(TDriveNumber& aDrive, TInt aProxy); + void CleanupBeforeRestoreL(TDriveNumber& aDriveNumber); + + // Supply + void SupplyPassiveSnapshotDataL(TDriveNumber aDriveNumber, TDesC8& aBuffer, TBool aLastSection); + void SupplyPassiveBaseDataL(TDriveNumber aDriveNumber, TDesC8& aBuffer, TBool aLastSection); + + // Request + void RequestPassiveSnapshotDataL(TDriveNumber aDriveNumber, TPtr8& aBuffer, TBool& aLastSection); + void RequestPassiveDataL(TTransferDataType aTransferType, TDriveNumber aDriveNumber, TPtr8& aBuffer, TBool& aLastSection); + void ProcessRequestDataL(TDriveNumber aDriveNumber, TTransferDataType aTransferType, + TPtr8& aBuffer, TBool& aLastSection); + void ProcessSupplyDataL(TDriveNumber aDriveNumber, TTransferDataType aTransferType, + TDesC8& aBuffer, TBool aLastSection); + TInt AddProxyToList(TProxyInformation aProxy); + + + // private methods for parsing + private: + // Element handlers + void HandleBackupRegistrationL(const RAttributeArray& aAttributes); + void HandlePathL(const TSelectionType aType, const RAttributeArray& aAttributes, const TBool aDir); + TInt HandlePassiveBackup(const RAttributeArray& aAttributes); + TInt HandlePublicBackup(const RAttributeArray& aAttributes); + TInt HandleSystemBackup(const RAttributeArray& aAttributes); + TInt HandleCenrepBackup(const RAttributeArray& aAttributes); + TInt HandleProxyDataManager(const RAttributeArray& aAttributes); + TInt HandleDBMSBackupL(const RAttributeArray& aAttributes); + TInt HandleActiveBackupL(const RAttributeArray& aAttributes); + TInt HandleRestore(const RAttributeArray& aAttributes); + private: + // Internal + TDOState iState; /* iProxyInformationArray; /*!< The various proxies that we support */ + TBufC iName; /* iStateByDrive; /* iProxyStateByDrive; /* iDBMSSelections; /* iSnapshots; /* iPublicDirStack; /* iPublicDirNameStack; /* iPublicExcludes; /*