sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __T_BACKUPSRVDEFECTS_H__ sl@0: #define __T_BACKUPSRVDEFECTS_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: enum BUDefectTestMachineStates sl@0: { sl@0: EMachineStart, sl@0: EMachineCloseAllsEndSameClient, sl@0: EMachineCloseAllsEndOtherClient, sl@0: EMachineCloseAllsEndCloseFile, sl@0: EMachineCloseFileEnd, sl@0: }; sl@0: class CBackupFileObserver; sl@0: sl@0: // The class to schedule the CBaBackupSessionWrapper requests for the Backup server defect tests. sl@0: class CBUDefectTestMachine : public CActive sl@0: { sl@0: public: sl@0: static CBUDefectTestMachine* NewL(); sl@0: ~CBUDefectTestMachine(); sl@0: void RunL(); sl@0: void DoCancel(); sl@0: void Complete(); sl@0: void SetFileObserver(CBackupFileObserver* aBackupFileObserver); sl@0: private: sl@0: CBUDefectTestMachine(); sl@0: void ConstructL(); sl@0: sl@0: private: sl@0: CBaBackupSessionWrapper* iWrapper; sl@0: CBackupFileObserver* iBackupFileObserver; sl@0: sl@0: public: sl@0: BUDefectTestMachineStates iNextState; sl@0: }; sl@0: sl@0: sl@0: class CBackupFileObserver : public CActive, public MBackupObserver sl@0: { sl@0: public: sl@0: static CBackupFileObserver* NewL(CBUDefectTestMachine& aTestMachine, const TDesC& aLockedFileName); sl@0: ~CBackupFileObserver(); sl@0: void RunL(); sl@0: void DoCancel(); sl@0: void ChangeFileLockL(const TDesC& aFileName,TFileLockFlags aFlags); sl@0: void CloseAll(MBackupObserver::TFileLockFlags aFlags); sl@0: void CloseFileL(const TDesC& aFileName,MBackupObserver::TFileLockFlags aFlags); sl@0: sl@0: private: sl@0: CBackupFileObserver(CBUDefectTestMachine& aTestMachine, const TDesC& aLockedFileName); sl@0: void ConstructL(); sl@0: private: sl@0: CBUDefectTestMachine& iTestMachine; sl@0: CBaBackupSessionWrapper* iWrapper; sl@0: const TDesC& iLockedFileName; sl@0: }; sl@0: #endif // __T_BACKUPSRVDEFECTS_H__