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 __LOGSERVDATABASEDRIVER_H__ sl@0: #define __LOGSERVDATABASEDRIVER_H__ sl@0: sl@0: #include sl@0: #include "LogServTaskInterface.h" sl@0: #include "LogServBackupObserver.h" sl@0: sl@0: // Classes referenced sl@0: class CLogEvent; sl@0: class CLogEventType; sl@0: class CLogAddEvent; sl@0: class CLogMaintenance; sl@0: class CLogChangeEvent; sl@0: class CLogGetEvent; sl@0: class CLogDeleteEvent; sl@0: class CLogChangeConfig; sl@0: class MLogServDatabaseTransactionInterface; sl@0: class MLogServBackupInterface; sl@0: class CLogServRecentListManager; sl@0: class CLogServResourceInterpreter; sl@0: class CLogServViewWindowFetcher; sl@0: sl@0: /** sl@0: Implements MLogServTaskInterface and MLogServBackupObserver. sl@0: Maintains a list of hitters, i.e. objects that will execute the requested by the client operation - add event, etc. sl@0: Every time, when one of the implemented TaskEventAddL(), TaskEventChangeL() etc. methods is called, that method sl@0: will read the client data and call the StartL() method of the hitter suitable for that operation. sl@0: sl@0: @see MLogServTaskInterface sl@0: @see MLogServBackupObserver sl@0: @see CLogAddEvent; sl@0: @see CLogGetEvent; sl@0: @see CLogChangeEvent; sl@0: @see CLogDeleteEvent; sl@0: @see CLogChangeConfig; sl@0: @see CLogMaintenance; sl@0: sl@0: @internalComponent sl@0: */ sl@0: class CLogServDatabaseDriver : public CBase, public MLogServTaskInterface, public MLogServBackupObserver sl@0: { sl@0: public: sl@0: static CLogServDatabaseDriver* NewL(MLogServBackupInterface& aBackupInterface, MLogServDatabaseTransactionInterface& aDatabase, CLogServResourceInterpreter& aResourceInterface, CLogServRecentListManager& aRecentListManager, TInt aHitterPriorities); sl@0: ~CLogServDatabaseDriver(); sl@0: sl@0: private: sl@0: CLogServDatabaseDriver(MLogServBackupInterface& aBackupInterface, MLogServDatabaseTransactionInterface& aDatabase, CLogServResourceInterpreter& aResourceInterface, CLogServRecentListManager& aRecentListManager, TInt aHitterPriorities); sl@0: void ConstructL(); sl@0: sl@0: private: // FROM MLogServBackupObserver sl@0: void BOHandleEventL(TLogServBackupEvent aEvent); sl@0: sl@0: private: // FROM MLogServTaskInterface sl@0: void TaskEventAddL(TRequestStatus& aStatus, CLogEvent& aEvent, const RMessage2& aMessage); sl@0: void TaskEventChangeL(TRequestStatus& aStatus, const CLogEvent& aEvent, const RMessage2& aMessage); sl@0: void TaskEventGetL(TRequestStatus& aStatus, CLogEvent& aEvent, const RMessage2& aMessage); sl@0: void TaskEventDeleteL(TRequestStatus& aStatus, TLogId aId, const RMessage2& aMessage); sl@0: // sl@0: void TaskEventTypeAddL(TRequestStatus& aStatus, const CLogEventType& aEventType); sl@0: void TaskEventTypeGetL(TRequestStatus& aStatus, const CLogEventType*& aEventType, TUid aUid); sl@0: void TaskEventTypeChangeL(TRequestStatus& aStatus, const CLogEventType& aEventType); sl@0: void TaskEventTypeDeleteL(TRequestStatus& aStatus, TUid aType); sl@0: // sl@0: void TaskConfigGetL(TRequestStatus& aStatus, TLogConfig& aConfig); sl@0: void TaskConfigChangeL(TRequestStatus& aStatus, const TLogConfig& aConfig); sl@0: // sl@0: void TaskClearLogL(TRequestStatus& aStatus, const TTime& aDate sl@0: #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM sl@0: , TSimId aSimId sl@0: #endif sl@0: ); sl@0: void TaskClearRecentL(TRequestStatus& aStatus, TInt aRecentList sl@0: #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM sl@0: , TSimId aSimId sl@0: #endif sl@0: ); sl@0: // sl@0: void TaskMaintenanceStartL(TRequestStatus& aStatus, TBool aPurge); sl@0: // sl@0: void TaskBuildWindowL(TRequestStatus& aStatus, const CLogServViewBase& aView, const TLogTransferWindow& aWindow, const RMessage2& aMessage); sl@0: // sl@0: void TaskCancelCurrent(); sl@0: sl@0: private: sl@0: void DestroyHitters(); sl@0: void CreateHittersL(); sl@0: sl@0: private: sl@0: TInt iHitterPriorities;//The active object priority used for all objects which hit the database sl@0: MLogServBackupInterface& iBackupInterface;//The interface to the backup manager sl@0: MLogServDatabaseTransactionInterface& iDatabase;//Access the database sl@0: CLogServResourceInterpreter& iResourceInterface;//Access resource files sl@0: CLogServRecentListManager& iRecentListManager;//Access recent list sl@0: // The hitters - named as such because they all hit the database in some sl@0: // way (e.g. read or write from/to it). sl@0: CLogAddEvent* iAddEvent; sl@0: CLogGetEvent* iGetEvent; sl@0: CLogChangeEvent* iChangeEvent; sl@0: CLogDeleteEvent* iDeleteEvent; sl@0: CLogChangeConfig* iChangeConfig; sl@0: CLogMaintenance* iMaintainer; sl@0: CLogServViewWindowFetcher* iWindowFetcher; sl@0: sl@0: }; sl@0: sl@0: #endif sl@0: