sl@0: // Copyright (c) 2002-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 __LOGNOTIFY_H__ sl@0: #define __LOGNOTIFY_H__ sl@0: sl@0: #include sl@0: #include "LogServBackupObserver.h" sl@0: #include "LogServDatabaseChangeObserver.h" sl@0: sl@0: // Classes referenced sl@0: class MLogServBackupInterface; sl@0: class MLogServDatabaseChangeInterface; sl@0: sl@0: /** sl@0: Uses the previous classes to provide change notifications sl@0: @internalComponent sl@0: */ sl@0: class CLogNotify : public CTimer, public MLogServBackupObserver, public MLogServDatabaseChangeObserver sl@0: { sl@0: public: sl@0: static CLogNotify* NewL(MLogServBackupInterface& aBackupInterface, MLogServDatabaseChangeInterface& aChangeInterface, TInt aPriority); sl@0: ~CLogNotify(); sl@0: sl@0: private: sl@0: CLogNotify(MLogServBackupInterface& aBackupInterface, MLogServDatabaseChangeInterface& aChangeInterface, TInt aPriority); sl@0: void ConstructL(); sl@0: sl@0: public: sl@0: void Notify(TTimeIntervalMicroSeconds32 aDelay, const RMessage2& aMessage); sl@0: sl@0: sl@0: private: // FROM MLogServDatabaseChangeObserver sl@0: void DCOHandleChangeEventsL(const CLogChangeDefinition& aChanges); sl@0: sl@0: private: // FROM MLogServBackupObserver sl@0: void BOHandleEventL(TLogServBackupEvent aEvent); sl@0: sl@0: public: // FROM CActive sl@0: void Cancel(); sl@0: sl@0: private: // FROM CActive sl@0: void RunL(); sl@0: void DoCancel(); sl@0: sl@0: private: // Internal sl@0: void CheckForChanges(); sl@0: void CompleteClientRequest(TInt aCompletionCode); sl@0: sl@0: private: sl@0: sl@0: /** sl@0: * So this object knows when a backup is starting. Have to cancel the delay timer sl@0: * during this period. sl@0: */ sl@0: MLogServBackupInterface& iBackupInterface; sl@0: sl@0: /** sl@0: * The change interface sl@0: */ sl@0: MLogServDatabaseChangeInterface& iChangeInterface; sl@0: sl@0: /** sl@0: * Counters for change tracking sl@0: */ sl@0: TUint iLastCommit; sl@0: TUint iCommit; sl@0: sl@0: /** sl@0: * The client-side outstanding notification request sl@0: */ sl@0: sl@0: RMessagePtr2 iMessagePtr; sl@0: sl@0: /** sl@0: * Used as a flag to indicate whether the client-side message should sl@0: * be completed sl@0: */ sl@0: TBool iCompleteClientMessage; sl@0: sl@0: #ifdef LOGGING_ENABLED sl@0: public: sl@0: TName iClientThreadName; sl@0: inline void SetClientThreadName(const TDesC& aName) { iClientThreadName = aName; } sl@0: #endif sl@0: }; sl@0: sl@0: #endif