os/persistentdata/loggingservices/eventlogger/LogServ/inc/LOGCHNGE.H
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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 __LOGCHNGE_H__
    17 #define __LOGCHNGE_H__
    18 
    19 #include <logwrap.h>
    20 
    21 // Classes referenced
    22 class TLogConfig;
    23 class CLogServRecentList;
    24 class CLogServRecentListManager;
    25 class MLogServDatabaseTransactionInterface;
    26 class CLogDuplicate;
    27 class CLogFilter;
    28 class RLogEventDbTable;
    29 
    30  
    31 /**
    32 This class provides functions for updating properties of particular event.
    33 The database record holding the event data will be updated.
    34  
    35 @see MLogServDatabaseTransactionInterface
    36 @see CLogServRecentList
    37 @see CLogDuplicate
    38 @see CLogEvent
    39 @internalComponent
    40 */
    41 class CLogChangeEvent : public CLogActive
    42 	{
    43 public:
    44 	static CLogChangeEvent* NewL(MLogServDatabaseTransactionInterface& aDatabase, TInt aPriority);
    45 	~CLogChangeEvent();
    46 	//
    47 public:
    48 	void StartL(const CLogEvent& aEvent, 
    49 	            const CLogServRecentList* aRecentList, 
    50 	            TRequestStatus& aStatus, 
    51 	            const RMessage2& aMessage);
    52 	//
    53 private:
    54 	CLogChangeEvent(MLogServDatabaseTransactionInterface& aDatabase, TInt aPriority);
    55 	void ConstructL();
    56 	//
    57 	void DoRunL();
    58 	void DoComplete(TInt& aStatus);
    59 	void ResetDuplicatesL();
    60 	void UpdateDuplicateEventsL();
    61 	void DoChangeEventL();
    62 	void DoChangeL(RLogEventDbTable& aTbl, TLogStringId aDirectionId, TLogStringId aStatusId);
    63 	//
    64 	enum TLogChangeState
    65 		{
    66 		ELogNone = 0,
    67 		ELogChangeEvent,
    68 		ELogPurgeRecent
    69 		};
    70 	//
    71 private:
    72 	MLogServDatabaseTransactionInterface& iDatabase;
    73 	CLogEvent* iEvent;
    74 	TLogChangeState iState;
    75 	const CLogServRecentList* iRecentList;
    76 	TInt iOldRecentList;
    77 	//
    78 	CLogDuplicate* iDuplicate;
    79 	CLogFilter* iDuplicateFilter;
    80 	//
    81 	const RMessage2* iMessage;
    82 	};
    83 
    84 
    85 
    86 
    87 
    88 
    89 
    90 
    91 
    92 
    93 
    94 //**********************************
    95 // CLogChangeConfig
    96 //**********************************
    97 
    98 class CLogChangeConfig : public CLogActive
    99 /**
   100 @internalComponent
   101 */
   102 	{
   103 public:
   104 	static CLogChangeConfig* NewL(MLogServDatabaseTransactionInterface& aDatabase, const CLogServRecentListManager& aRecentSetup, TInt aPriority);
   105 	~CLogChangeConfig();
   106 	//
   107 public:
   108 	void StartL(const TLogConfig& aConfig, TRequestStatus& aStatus);
   109 	//
   110 private:
   111 	CLogChangeConfig(MLogServDatabaseTransactionInterface& aDatabase, const CLogServRecentListManager& aRecentSetup, TInt aPriority);
   112 	//
   113 	void DoRunL();
   114 	void DoComplete(TInt& aStatus);
   115 	//
   116 	enum TLogChangeState
   117 		{
   118 		ELogNone,
   119 		ELogChange,
   120 		ELogPurgeRecent
   121 		};
   122 	//
   123 private:
   124 	MLogServDatabaseTransactionInterface& iDatabase;
   125 	const TLogConfig* iConfig;
   126 	const CLogServRecentListManager& iRecentSetup;
   127 	TLogChangeState iState;
   128 	TInt iRecent;
   129 	
   130 	};
   131 
   132 #endif