1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/loggingservices/eventlogger/LogServ/inc/LOGADD.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,93 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __LOGADD_H__
1.20 +#define __LOGADD_H__
1.21 +
1.22 +#include <logcli.h>
1.23 +#include <logcntmodel.h>
1.24 +
1.25 +// Forward declarations
1.26 +class CLogDuplicate;
1.27 +class CLogServRecentList;
1.28 +class MLogServDatabaseTransactionInterface;
1.29 +class RLogEventDbTable;
1.30 +class CRepository;
1.31 +
1.32 +/**
1.33 +CLogAddEvent class controls the operations with LogEng database - adding/removing events.
1.34 +It uses the a plug-in to the contacts implementation when it needs to add
1.35 +a contact name to the LogEng record being prepared.
1.36 +There is no need to monitor contacts database events such as backup&restore events, because the
1.37 +contacts implementation environment will handle them for itself.
1.38 +@internalComponent
1.39 +*/
1.40 +class CLogAddEvent : public CLogActive
1.41 + {
1.42 +public:
1.43 + static CLogAddEvent* NewL(MLogServDatabaseTransactionInterface& aDatabase, TInt aPriority);
1.44 + ~CLogAddEvent();
1.45 +
1.46 +public:
1.47 + void StartL(CLogEvent& aEvent, const CLogServRecentList* aRecentList, TRequestStatus& aStatus, const RMessage2& aMessage);
1.48 +
1.49 +private:
1.50 + CLogAddEvent(MLogServDatabaseTransactionInterface& aDatabase, TInt aPriority);
1.51 + void ConstructL();
1.52 + TBool PerformContactMatchL();
1.53 +
1.54 + void DoRunL();
1.55 +
1.56 + void DoAddEventL(RLogEventDbTable& aTbl, TLogTypeId aTypeId, TLogStringId aDirectionId, TLogStringId aStatusId);
1.57 + void DoComplete(TInt& aStatus);
1.58 + void DoCancel();
1.59 +
1.60 + void OpenContactsL();
1.61 + void CloseContactsPlugin();
1.62 +
1.63 + enum TLogState
1.64 + {
1.65 + ELogNone,
1.66 + ELogSetContactAndRemoteParty,
1.67 + ELogAddEvent,
1.68 + ELogPurgeRecent
1.69 + };
1.70 +
1.71 + void SetEventContact();
1.72 + void SetRemoteParty();
1.73 + void GetConfigL();
1.74 + TLogTypeId SetDescriptionL();
1.75 + TBool DetectDuplicateEventsL();
1.76 +
1.77 +private:
1.78 + MLogServDatabaseTransactionInterface& iDatabase;
1.79 +
1.80 + TBool iEventAdded;
1.81 + CLogEvent* iEvent;
1.82 + TLogState iState;
1.83 + const CLogServRecentList* iRecentList;
1.84 + CLogFilter* iDuplicateFilter;
1.85 + TLogConfig iConfig;
1.86 +
1.87 + CLogDuplicate* iDuplicate;
1.88 + CLogCntModel* iContactPlugin;
1.89 +
1.90 + TInt iContactMatchCount;
1.91 + //iContactNameFormat gets its value from logserv resource file and determines the
1.92 + //order in the logs of {given_name,family_name} strings pair.
1.93 + TLogContactNameFormat iContactNameFormat;
1.94 + };
1.95 +
1.96 +#endif