os/persistentdata/loggingservices/eventlogger/LogServ/inc/LOGADD.H
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __LOGADD_H__
    17 #define __LOGADD_H__
    18 
    19 #include <logcli.h>
    20 #include <logcntmodel.h>
    21 
    22 // Forward declarations
    23 class CLogDuplicate;
    24 class CLogServRecentList;
    25 class MLogServDatabaseTransactionInterface;
    26 class RLogEventDbTable;
    27 class CRepository;
    28 
    29 /**
    30 CLogAddEvent class controls the operations with LogEng database - adding/removing events.
    31 It uses the a plug-in to the contacts implementation when it needs to add
    32 a contact name to the LogEng record being prepared. 
    33 There is no need to monitor contacts database events such as backup&restore events, because the
    34 contacts implementation environment will handle them for itself.
    35 @internalComponent
    36 */
    37 class CLogAddEvent : public CLogActive
    38 	{
    39 public:
    40 	static CLogAddEvent* NewL(MLogServDatabaseTransactionInterface& aDatabase, TInt aPriority);
    41 	~CLogAddEvent();
    42 
    43 public:
    44 	void StartL(CLogEvent& aEvent, const CLogServRecentList* aRecentList, TRequestStatus& aStatus, const RMessage2& aMessage);
    45 
    46 private:
    47 	CLogAddEvent(MLogServDatabaseTransactionInterface& aDatabase, TInt aPriority);
    48 	void ConstructL();
    49 	TBool PerformContactMatchL();
    50 
    51 	void DoRunL();
    52 	
    53 	void DoAddEventL(RLogEventDbTable& aTbl, TLogTypeId aTypeId, TLogStringId aDirectionId, TLogStringId aStatusId);
    54 	void DoComplete(TInt& aStatus);
    55 	void DoCancel();
    56 	
    57 	void OpenContactsL();
    58 	void CloseContactsPlugin();
    59 
    60 	enum TLogState
    61 		{
    62 		ELogNone,
    63 		ELogSetContactAndRemoteParty,
    64 		ELogAddEvent,
    65 		ELogPurgeRecent
    66 		};
    67 
    68     void SetEventContact();
    69     void SetRemoteParty();
    70     void GetConfigL();
    71     TLogTypeId SetDescriptionL();
    72     TBool DetectDuplicateEventsL();
    73 	
    74 private:
    75 	MLogServDatabaseTransactionInterface& iDatabase;
    76 
    77 	TBool iEventAdded;
    78 	CLogEvent* iEvent;
    79 	TLogState iState;
    80 	const CLogServRecentList* iRecentList;
    81 	CLogFilter* iDuplicateFilter;
    82 	TLogConfig iConfig;
    83 
    84 	CLogDuplicate* iDuplicate;
    85 	CLogCntModel* iContactPlugin;
    86 	
    87 	TInt iContactMatchCount;
    88 	//iContactNameFormat gets its value from logserv resource file and determines the 
    89 	//order in the logs of {given_name,family_name} strings pair.
    90 	TLogContactNameFormat iContactNameFormat;
    91 	};
    92 
    93 #endif