Update contrib.
1 // Copyright (c) 2002-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __LOGBACKUP_H__
17 #define __LOGBACKUP_H__
20 #include "LogServBackupInterface.h"
21 #include "LogServBackupObserver.h"
24 /////////////////////////////////////////////////////////////////////////////////////////
25 // -----> CLogServBackupManagerManager (header)
26 /////////////////////////////////////////////////////////////////////////////////////////
30 class CLogServBackupManager : public CTimer, public MBackupObserver, public MLogServBackupInterface
33 static CLogServBackupManager* NewL(TInt aPriority = CActive::EPriorityStandard);
34 ~CLogServBackupManager();
37 CLogServBackupManager(TInt aPriority);
40 public: // From MLogServBackupInterface
41 void BIObserverAddL(MLogServBackupObserver& aObserver, TLogServBackupPriority aPriority);
42 void BIObserverRemove(MLogServBackupObserver& aObserver);
44 TLogServBackupState BIState() const;
45 TInt BIErrorValueForCurrentState() const;
47 void BISetDatabaseNameL(const TDesC& aDatabaseName);
49 private: // From CActive
51 TInt RunError(TInt aError);
53 private: // Internal structs
54 struct TLogBackupNotificationEntry
57 inline TLogBackupNotificationEntry(MLogServBackupObserver& aObserver, TLogServBackupPriority aPriority) : iObserver(aObserver), iPriority(aPriority) { };
60 MLogServBackupObserver& iObserver;
61 TLogServBackupPriority iPriority;
65 TInt NotifyObservers(MLogServBackupObserver::TLogServBackupEvent aEvent);
66 void ChangeFileLockL(const TDesC& aFileName,TFileLockFlags aFlags);
67 CBaBackupSessionWrapper* CreateBackupL(const TDesC& aLogDatabaseFileName);
68 static TInt CompareEntries(const TLogBackupNotificationEntry& aLeft, const TLogBackupNotificationEntry& aRight);
72 * So we can check we only act upon the correct backup event... essentially
73 * we are not trusting the backup server to do the right thing.
78 * Interface to the backup server
80 CBaBackupSessionWrapper* iBackup;
85 TLogServBackupState iState;
88 * Backup notification queue
90 RArray<TLogBackupNotificationEntry> iObservers;