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 __LOGADD_H__ sl@0: #define __LOGADD_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: // Forward declarations sl@0: class CLogDuplicate; sl@0: class CLogServRecentList; sl@0: class MLogServDatabaseTransactionInterface; sl@0: class RLogEventDbTable; sl@0: class CRepository; sl@0: sl@0: /** sl@0: CLogAddEvent class controls the operations with LogEng database - adding/removing events. sl@0: It uses the a plug-in to the contacts implementation when it needs to add sl@0: a contact name to the LogEng record being prepared. sl@0: There is no need to monitor contacts database events such as backup&restore events, because the sl@0: contacts implementation environment will handle them for itself. sl@0: @internalComponent sl@0: */ sl@0: class CLogAddEvent : public CLogActive sl@0: { sl@0: public: sl@0: static CLogAddEvent* NewL(MLogServDatabaseTransactionInterface& aDatabase, TInt aPriority); sl@0: ~CLogAddEvent(); sl@0: sl@0: public: sl@0: void StartL(CLogEvent& aEvent, const CLogServRecentList* aRecentList, TRequestStatus& aStatus, const RMessage2& aMessage); sl@0: sl@0: private: sl@0: CLogAddEvent(MLogServDatabaseTransactionInterface& aDatabase, TInt aPriority); sl@0: void ConstructL(); sl@0: TBool PerformContactMatchL(); sl@0: sl@0: void DoRunL(); sl@0: sl@0: void DoAddEventL(RLogEventDbTable& aTbl, TLogTypeId aTypeId, TLogStringId aDirectionId, TLogStringId aStatusId); sl@0: void DoComplete(TInt& aStatus); sl@0: void DoCancel(); sl@0: sl@0: void OpenContactsL(); sl@0: void CloseContactsPlugin(); sl@0: sl@0: enum TLogState sl@0: { sl@0: ELogNone, sl@0: ELogSetContactAndRemoteParty, sl@0: ELogAddEvent, sl@0: ELogPurgeRecent sl@0: }; sl@0: sl@0: void SetEventContact(); sl@0: void SetRemoteParty(); sl@0: void GetConfigL(); sl@0: TLogTypeId SetDescriptionL(); sl@0: TBool DetectDuplicateEventsL(); sl@0: sl@0: private: sl@0: MLogServDatabaseTransactionInterface& iDatabase; sl@0: sl@0: TBool iEventAdded; sl@0: CLogEvent* iEvent; sl@0: TLogState iState; sl@0: const CLogServRecentList* iRecentList; sl@0: CLogFilter* iDuplicateFilter; sl@0: TLogConfig iConfig; sl@0: sl@0: CLogDuplicate* iDuplicate; sl@0: CLogCntModel* iContactPlugin; sl@0: sl@0: TInt iContactMatchCount; sl@0: //iContactNameFormat gets its value from logserv resource file and determines the sl@0: //order in the logs of {given_name,family_name} strings pair. sl@0: TLogContactNameFormat iContactNameFormat; sl@0: }; sl@0: sl@0: #endif