os/persistentdata/loggingservices/eventlogger/LogCli/src/LOGCLI.CPP
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/loggingservices/eventlogger/LogCli/src/LOGCLI.CPP	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,576 @@
     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 +// System includes
    1.20 +#include <bautils.h>
    1.21 +#include <barsc2.h> // For CResourceFile
    1.22 +#include <barsread2.h> // For RResourceReader
    1.23 +#include <logwrap.h>
    1.24 +
    1.25 +// User includes
    1.26 +#include <logcli.h>
    1.27 +#include "logservcli.h"
    1.28 +#include "LogServShared.h"
    1.29 +#include "logpackage.h"
    1.30 +#include "logclipanic.h"
    1.31 +#include "logclientop.h"
    1.32 +#include "LogClientObserver.h"
    1.33 +
    1.34 +//**********************************
    1.35 +// TLogConfig
    1.36 +//**********************************
    1.37 +
    1.38 +/** Sets the:
    1.39 +
    1.40 +maximum age of events to zero
    1.41 +
    1.42 +maximum number of events to appear in the log to zero
    1.43 +
    1.44 +maximum number of events to appear in a recent event list to zero */
    1.45 +EXPORT_C TLogConfig::TLogConfig()
    1.46 +: iMaxLogSize(0), iMaxRecentLogSize(0), iMaxEventAge(0)
    1.47 +	{
    1.48 +	}
    1.49 +
    1.50 +void TLogConfig::InternalizeL(RReadStream& aStream)
    1.51 +	{
    1.52 +	aStream >> iMaxLogSize;
    1.53 +	aStream >> iMaxRecentLogSize;
    1.54 +	aStream >> iMaxEventAge;
    1.55 +	}
    1.56 +
    1.57 +void TLogConfig::ExternalizeL(RWriteStream& aStream) const
    1.58 +	{
    1.59 +	aStream << iMaxLogSize;
    1.60 +	aStream << iMaxRecentLogSize;
    1.61 +	aStream << iMaxEventAge;
    1.62 +	}
    1.63 +
    1.64 +//**********************************
    1.65 +// CLogClient
    1.66 +//**********************************
    1.67 +
    1.68 +EXPORT_C CLogClient* CLogClient::NewL(RFs& aFs, TInt aPriority/* = CActive::EPriorityStandard*/)
    1.69 +	{
    1.70 +	CLogClient* self = new(ELeave)CLogClient(aFs, aPriority);
    1.71 +	CleanupStack::PushL(self);
    1.72 +	self->ConstructL();
    1.73 +	CleanupStack::Pop(); // self
    1.74 +	return self;
    1.75 +	}
    1.76 +
    1.77 +void CLogClient::ConstructL()
    1.78 +	{
    1.79 +	// Load resources
    1.80 +	LoadResourcesL(iFs);
    1.81 +
    1.82 +	iSession = new(ELeave)RLogSession;
    1.83 +	User::LeaveIfError(iSession->Connect());
    1.84 +	iPackage = CLogPackage::NewL();
    1.85 +
    1.86 +	iAddEvent = new(ELeave)CLogAddEventClientOp(*iSession, *iPackage, Priority());
    1.87 +	iChangeEvent = new(ELeave)CLogChangeEventClientOp(*iSession, *iPackage, Priority());
    1.88 +	iGetEvent = new(ELeave)CLogGetEventClientOp(*iSession, *iPackage, Priority());
    1.89 +	iDeleteEvent = new(ELeave)CLogDeleteEventClientOp(*iSession, *iPackage, Priority());
    1.90 +	iAddType = new(ELeave)CLogAddTypeClientOp(*iSession, *iPackage, Priority());
    1.91 +	iChangeType = new(ELeave)CLogChangeTypeClientOp(*iSession, *iPackage, Priority());
    1.92 +	iGetType = new(ELeave)CLogGetTypeClientOp(*iSession, *iPackage, Priority());
    1.93 +	iDeleteType = new(ELeave)CLogDeleteTypeClientOp(*iSession, *iPackage, Priority());
    1.94 +	iGetConfig = new(ELeave)CLogGetConfigClientOp(*iSession, *iPackage, Priority());
    1.95 +	iChangeConfig = new(ELeave)CLogChangeConfigClientOp(*iSession, *iPackage, Priority());
    1.96 +	iClearLog = new(ELeave)CLogClearLogClientOp(*iSession, *iPackage, Priority());
    1.97 +	iClearRecent = new(ELeave)CLogClearRecentClientOp(*iSession, *iPackage, Priority());
    1.98 +	}
    1.99 +
   1.100 +/** Frees all resources owned by the Log Engine object prior to its destruction. 
   1.101 +In particular, any outstanding asynchronous request is cancelled, the database, 
   1.102 +the database session and the resource file are all closed. */
   1.103 +EXPORT_C CLogClient::~CLogClient()
   1.104 +	{
   1.105 +	Cancel();
   1.106 +
   1.107 +	delete iChangeObserver;
   1.108 +	if (iSession && iSession->Handle())
   1.109 +		{
   1.110 +		// Complete change notification
   1.111 +		NotifyChangeCancel();
   1.112 +		iSession->Close();
   1.113 +		}
   1.114 +
   1.115 +	delete iSession;
   1.116 +	delete iPackage;
   1.117 +	delete iAddEvent;
   1.118 +	delete iChangeEvent;
   1.119 +	delete iGetEvent;
   1.120 +	delete iDeleteEvent;
   1.121 +	delete iAddType;
   1.122 +	delete iChangeType;
   1.123 +	delete iGetType;
   1.124 +	delete iDeleteType;
   1.125 +	delete iGetConfig;
   1.126 +	delete iChangeConfig;
   1.127 +	delete iClearLog;
   1.128 +	delete iClearRecent;
   1.129 +	}
   1.130 +
   1.131 +CLogClient::CLogClient(RFs& aFs, TInt aPriority)
   1.132 +: CLogBase(aPriority), iFs(aFs)
   1.133 +	{
   1.134 +	}
   1.135 +
   1.136 +/** Adds an event to the log database. This is an asynchronous request.
   1.137 +
   1.138 +There must be no asynchronous request outstanding when this function is called, 
   1.139 +otherwise the function raises a LogCli 0 panic.
   1.140 +
   1.141 +@param aEvent A log event detail object containing the attributes of the event 
   1.142 +to be added. The Log Engine sets the unique event ID, the UTC time and the event 
   1.143 +description, replacing any supplied values. The caller must ensure that this 
   1.144 +object remains in existence and valid until the request is complete.
   1.145 +@param aStatus The request status. On request completion,contains: KErrNone, 
   1.146 +if the event has been successfully added to the log database; KErrNotFound, 
   1.147 +if the event type is not registered with the Log Engine; KErrNotSupported, 
   1.148 +if the logging of events of this type has been disabled; otherwise, one of 
   1.149 +the other system wide error codes.
   1.150 +@capability Note For built-in event types, the required capability level is defined in
   1.151 +the event type's write access policy.
   1.152 +@see CLogEventType::SetLoggingEnabled() */
   1.153 +EXPORT_C void CLogClient::AddEvent(CLogEvent& aEvent, TRequestStatus& aStatus)
   1.154 +	{
   1.155 +	Queue(aStatus);
   1.156 +	iAddEvent->Start(aEvent, iStatus);
   1.157 +	SetActive();
   1.158 +	}
   1.159 +
   1.160 +/** Changes the details of an existing event. This is an asynchronous request.
   1.161 +
   1.162 +There must be no asynchronous request outstanding when this function is called, 
   1.163 +otherwise the function raises a LogCli 0 panic.
   1.164 +
   1.165 +Note that it is not possible to change the event type using this function.
   1.166 +
   1.167 +@param aEvent The event detail object containing the attributes of the event 
   1.168 +to be changed. Before calling the function, this object must contain the appropriate 
   1.169 +unique event ID; if no unique event ID is set, the function raises a LogCli 
   1.170 +13 panic. The caller must ensure that this object remains in existence and 
   1.171 +valid until the request is complete.
   1.172 +@param aStatus The request status. On request completion, contains:KErrNone, 
   1.173 +if successful; otherwise, one of the other system wide error codes.
   1.174 +@capability Note For built-in event types, the required capability level is defined in
   1.175 +the event type's write access policy.
   1.176 +@see TLogId */
   1.177 +EXPORT_C void CLogClient::ChangeEvent(const CLogEvent& aEvent, TRequestStatus& aStatus)
   1.178 +	{
   1.179 +	Queue(aStatus);
   1.180 +	iChangeEvent->Start(aEvent, iStatus);
   1.181 +	SetActive();
   1.182 +	}
   1.183 +
   1.184 +/** Gets the details of the specified event. This is an asynchronous request.
   1.185 +
   1.186 +There must be no asynchronous request outstanding when this function is called, 
   1.187 +otherwise the function raises a LogCli 0 panic.
   1.188 +
   1.189 +@param aEvent A reference to a log event detail object. Before calling the 
   1.190 +function, this object must contain the appropriate unique event ID; if no 
   1.191 +unique event ID is set, the function raises a LogServ 50 panic. The caller 
   1.192 +must ensure that this object remains in existence and valid until the request 
   1.193 +is complete. On successful completion of the request, it contains the appropriate 
   1.194 +log event detail.
   1.195 +@param aStatus The request status. On request completion, contains:KErrNone, 
   1.196 +if successful; otherwise, one of the other system wide error codes.
   1.197 +@capability Note For built-in event types, the required capability level is defined in
   1.198 +the event type's read access policy.
   1.199 +@see TLogId */
   1.200 +EXPORT_C void CLogClient::GetEvent(CLogEvent& aEvent, TRequestStatus& aStatus)
   1.201 +	{
   1.202 +	Queue(aStatus);
   1.203 +	iGetEvent->Start(aEvent, iStatus);
   1.204 +	SetActive();
   1.205 +	}
   1.206 +
   1.207 +/** Deletes the event with the specified unique event ID, from the main event log.
   1.208 +
   1.209 +@param aId The unique event ID of the event to be deleted. This must not be 
   1.210 +the null unique event ID, KLogNullId, otherwise the function raises a LogCli 
   1.211 +13 panic.
   1.212 +@param aStatus The request status. On request completion, contains:KErrNone, 
   1.213 +if successful; otherwise, one of the other system wide error codes. 
   1.214 +@capability Note For built-in event types, the required capability level is defined in
   1.215 +the event type's write access policy.
   1.216 +*/
   1.217 +EXPORT_C void CLogClient::DeleteEvent(TLogId aId, TRequestStatus& aStatus)
   1.218 +	{
   1.219 +	Queue(aStatus);
   1.220 +	iDeleteEvent->Start(aId, iStatus);
   1.221 +	SetActive();
   1.222 +	}
   1.223 +
   1.224 +/** Registers a new event type. This is an asynchronous request.
   1.225 +
   1.226 +There must be no asynchronous request outstanding when this function is called, 
   1.227 +otherwise the function raises a LogCli 0 panic.
   1.228 +
   1.229 +@param aType The event type detail object containing the attributes of the 
   1.230 +event type to be registered. The caller must ensure that this object remains 
   1.231 +in existence and valid until the request is complete.
   1.232 +@param aStatus The request status. On request completion, contains:KErrNone, 
   1.233 +if successful; otherwise, one of the other system wide error codes.
   1.234 +@capability WriteDeviceData
   1.235 +@see TUid */
   1.236 +EXPORT_C void CLogClient::AddEventType(const CLogEventType& aType, TRequestStatus& aStatus)
   1.237 +	{
   1.238 +	Queue(aStatus);
   1.239 +	iAddType->Start(aType, iStatus);
   1.240 +	SetActive();
   1.241 +	}
   1.242 +
   1.243 +/** Gets the details of an event type. This is an asynchronous request.
   1.244 +
   1.245 +There must be no asynchronous request outstanding when this function is called, 
   1.246 +otherwise the function raises a LogCli 0 panic.
   1.247 +
   1.248 +@param aType A reference to an event type detail object. Before calling the 
   1.249 +function, this object must contain the UID identifying the event type; if 
   1.250 +no UID is set, the function raises a LogCli 13 panic. The caller must ensure 
   1.251 +that this object remains in existence and valid until the request is complete. 
   1.252 +On successful completion of the request, it contains the appropriate event 
   1.253 +type detail.
   1.254 +@param aStatus The request status. On request completion, contains: KErrNone, 
   1.255 +if successful; otherwise one of the other system wide error codes.
   1.256 +@capability Note None required.
   1.257 +@see TUid */
   1.258 +EXPORT_C void CLogClient::GetEventType(CLogEventType& aType, TRequestStatus& aStatus)
   1.259 +	{
   1.260 +	Queue(aStatus);
   1.261 +	iGetType->Start(aType, iStatus);
   1.262 +	SetActive();
   1.263 +	}
   1.264 +
   1.265 +/** Changes the details of an existing event type. This is an asynchronous request.
   1.266 +
   1.267 +There must be no asynchronous request outstanding when this function is called, 
   1.268 +otherwise the function raises a LogCli 0 panic.
   1.269 +
   1.270 +@param aType The event type detail object containing the attributes of the 
   1.271 +event type to be changed. Before calling the function, this object must contain 
   1.272 +the UID identifying the event type; if no UID is set, the function raises 
   1.273 +a LogCli 13 panic. The caller must ensure that this object remains in existence 
   1.274 +and valid until the request is complete.
   1.275 +@param aStatus The request status. On request completion, contains: KErrNone, 
   1.276 +if successful; otherwise, one of the other system wide error codes.
   1.277 +@capability WriteDeviceData
   1.278 +@see TUid */
   1.279 +EXPORT_C void CLogClient::ChangeEventType(const CLogEventType& aType, TRequestStatus& aStatus)
   1.280 +	{
   1.281 +	Queue(aStatus);
   1.282 +	iChangeType->Start(aType, iStatus);
   1.283 +	SetActive();
   1.284 +	}
   1.285 +
   1.286 +/** Removes an existing event type. This is an asynchronous request.
   1.287 +
   1.288 +There must be no asynchronous request outstanding when this function is called, 
   1.289 +otherwise the function raises a LogCli 0 panic.
   1.290 +
   1.291 +Note that this function does not remove events from the event log, so it is 
   1.292 +possible to have events in the log that are of an unknown type. This function 
   1.293 +allows an event type associated with a component to be removed when that component 
   1.294 +is uninstalled.
   1.295 +
   1.296 +@param aId The UID of the event type to be deleted.
   1.297 +@param aStatus The request status. On request completion, contains:KErrNone, 
   1.298 +if successful; otherwise, one of the other system wide error codes. 
   1.299 +@capability WriteDeviceData
   1.300 +*/
   1.301 +EXPORT_C void CLogClient::DeleteEventType(TUid aId, TRequestStatus& aStatus)
   1.302 +	{
   1.303 +	Queue(aStatus);
   1.304 +	iDeleteType->Start(aId, iStatus);
   1.305 +	SetActive();
   1.306 +	}
   1.307 +
   1.308 +/** Gets the Log Engine configuration. This is an asynchronous request.
   1.309 +
   1.310 +There must be no asynchronous request outstanding when this function is called, 
   1.311 +otherwise the function raises a LogCli 0 panic.
   1.312 +
   1.313 +@param aConfig A reference to a Log Engine configuration object. The caller 
   1.314 +must ensure that this object remains in existence and valid until the request 
   1.315 +is complete. On successful completion of the request, it contains the Log 
   1.316 +Engine configuration data.
   1.317 +@param aStatus The request status. On request completion, contains:KErrNone, 
   1.318 +if successful; otherwise, one of the other system wide error codes. 
   1.319 +@capability Note None required.
   1.320 +*/
   1.321 +EXPORT_C void CLogClient::GetConfig(TLogConfig& aConfig, TRequestStatus& aStatus)
   1.322 +	{
   1.323 +	Queue(aStatus);
   1.324 +	iGetConfig->Start(aConfig, iStatus);
   1.325 +	SetActive();
   1.326 +	}
   1.327 +
   1.328 +/** Changes the Log Engine configuration. This is an asynchronous request.
   1.329 +
   1.330 +There must be no asynchronous request outstanding when this function is called, 
   1.331 +otherwise the function raises a LogCli 0 panic.
   1.332 +
   1.333 +@param aConfig The new configuration values for the Log Engine.
   1.334 +@param aStatus The request status. On request completion, contains:KErrNone, 
   1.335 +if successful; otherwise, one of the other system wide error codes. 
   1.336 +@capability WriteDeviceData */
   1.337 +EXPORT_C void CLogClient::ChangeConfig(const TLogConfig& aConfig, TRequestStatus& aStatus)
   1.338 +	{
   1.339 +	Queue(aStatus);
   1.340 +	iChangeConfig->Start(aConfig, iStatus);
   1.341 +	SetActive();
   1.342 +	}
   1.343 +
   1.344 +/** Clears all events from the main event log that occurred before the specified 
   1.345 +date and time. This is an asynchronous request.
   1.346 +
   1.347 +There must be no asynchronous request outstanding when this function is called, 
   1.348 +otherwise the function raises a LogCli 0 panic.
   1.349 +
   1.350 +@param aDate The UTC date and time.
   1.351 +@param aStatus The request status. On request completion, contains:KErrNone, 
   1.352 +if successful; otherwise, one of the other system wide error codes. 
   1.353 +@capability WriteDeviceData  */
   1.354 +EXPORT_C void CLogClient::ClearLog(const TTime& aDate, TRequestStatus& aStatus)
   1.355 +	{
   1.356 +	Queue(aStatus);
   1.357 +	iClearLog->Start(aDate, iStatus);
   1.358 +	SetActive();
   1.359 +	}
   1.360 +
   1.361 +/** Clears the specified recent event list. This is an asynchronous request.
   1.362 +
   1.363 +There must be no asynchronous request outstanding when this function is called, 
   1.364 +otherwise the function raises a LogCli 0 panic.
   1.365 +
   1.366 +@param aRecentList Identifies the recent event list to be cleared. The value 
   1.367 +KlogNullRecentList indicates that all recent event lists are to be cleared.
   1.368 +@param aStatus The request status. On request completion, contains:KErrNone, 
   1.369 +if successful; otherwise, one of the other system wide error codes. 
   1.370 +@capability WriteDeviceData  */
   1.371 +EXPORT_C void CLogClient::ClearLog(TInt aRecentList, TRequestStatus& aStatus)
   1.372 +	{
   1.373 +	Queue(aStatus);
   1.374 +	iClearRecent->Start((TLogRecentList)aRecentList, iStatus);
   1.375 +	SetActive();
   1.376 +	}
   1.377 +
   1.378 +#ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM	
   1.379 +
   1.380 +/** 
   1.381 +Clears all events from the main event log that occurred before the specified 
   1.382 +date and time and logged with the supplied SIM short Id. This is an asynchronous request.
   1.383 +
   1.384 +There must be no asynchronous request outstanding when this function is called, 
   1.385 +otherwise the function raises a LogCli 0 panic.
   1.386 +
   1.387 +Note: If KLogNullSimId is passed as value of aSimId parameter, then the method will produce the same result as the
   1.388 +           ClearLog() method without SimId parameter - all events occured before  the specified data will be deleted,
   1.389 +	disregarding the SimId event property.
   1.390 +
   1.391 +@param aDate   The UTC date and time.
   1.392 +@param aSimId  SIM card short Id.
   1.393 +@param aStatus The request status. On request completion, contains:KErrNone, 
   1.394 +               if successful; otherwise, one of the other system wide error codes. 
   1.395 +@capability WriteDeviceData  
   1.396 +*/
   1.397 +EXPORT_C void CLogClient::ClearLog(const TTime& aDate, TSimId aSimId, TRequestStatus& aStatus)
   1.398 +	{//Compiled when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM is defined
   1.399 +	Queue(aStatus);
   1.400 +	iClearLog->Start(aDate, iStatus, aSimId);
   1.401 +	SetActive();
   1.402 +	}
   1.403 +
   1.404 +/** 
   1.405 +Clears the specified recent event list from events with the specified SIM short Id. 
   1.406 +This is an asynchronous request.
   1.407 +
   1.408 +There must be no asynchronous request outstanding when this function is called, 
   1.409 +otherwise the function raises a LogCli 0 panic.
   1.410 +
   1.411 +Note: If KLogNullSimId is passed as value of aSimId parameter, then the method will produce the same result as the
   1.412 +           ClearLog() method without SimId parameter - all events from the specified event list will be cleared,
   1.413 +	disregarding the SimId event property.
   1.414 +
   1.415 +@param aRecentList Identifies the recent event list to be cleared. The value 
   1.416 +                   KlogNullRecentList indicates that all recent event lists are to be cleared.
   1.417 +@param aSimId      SIM card short Id.
   1.418 +@param aStatus     The request status. On request completion, contains:KErrNone, 
   1.419 +                   if successful; otherwise, one of the other system wide error codes. 
   1.420 +@capability WriteDeviceData  
   1.421 +*/
   1.422 +EXPORT_C void CLogClient::ClearLog(TInt aRecentList, TSimId aSimId, TRequestStatus& aStatus)
   1.423 +	{//Compiled when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM is defined
   1.424 +	Queue(aStatus);
   1.425 +	iClearRecent->Start((TLogRecentList)aRecentList, iStatus, aSimId);
   1.426 +	SetActive();
   1.427 +	}
   1.428 +
   1.429 +#else //SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
   1.430 +
   1.431 +#pragma BullseyeCoverage off
   1.432 +
   1.433 +/**
   1.434 +Not supported. 
   1.435 +*/
   1.436 +EXPORT_C void CLogClient::ClearLog(const TTime&, TSimId, TRequestStatus&)
   1.437 +	{//Compiled when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM is not defined
   1.438 +	__ASSERT_ALWAYS(0, ::Panic(ELogDualSimNotSupported));
   1.439 +	}
   1.440 +
   1.441 +/**
   1.442 +Not supported. 
   1.443 +*/
   1.444 +EXPORT_C void CLogClient::ClearLog(TInt, TSimId, TRequestStatus&)
   1.445 +	{//Compiled when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM is not defined
   1.446 +	__ASSERT_ALWAYS(0, ::Panic(ELogDualSimNotSupported));
   1.447 +	}
   1.448 +
   1.449 +#pragma BullseyeCoverage on
   1.450 +
   1.451 +#endif//SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
   1.452 +
   1.453 +/** Requests notification of changes to the Log Engine database. This is an asynchronous 
   1.454 +request.
   1.455 +
   1.456 +The function requires the caller to specify a minimum time that must elapse 
   1.457 +before this notification request can complete. The Log Engine buffers all 
   1.458 +changes that occur during this time; the request, then completes after this 
   1.459 +minimum time period has elapsed. If no changes occur within this time period, 
   1.460 +then the request completes when the next change to the database occurs.
   1.461 +
   1.462 +There must be no asynchronous request outstanding when this function is called, 
   1.463 +otherwise the function raises a LogCli 0 panic.
   1.464 +
   1.465 +Note that once a notification request has completed, this function must be 
   1.466 +called again to get further change notifications.
   1.467 +
   1.468 +@param aDelay The minimum time, in microseconds, that elapses before the notification 
   1.469 +request can complete.
   1.470 +@param aStatus The request status. On request completion, contains:KErrNone, 
   1.471 +if successful;KErrCancel, if an outstanding notification request is cancelled; 
   1.472 +otherwise, one of the other system wide error codes. 
   1.473 +@capability Note None required.
   1.474 +*/
   1.475 +EXPORT_C void CLogClient::NotifyChange(TTimeIntervalMicroSeconds32 aDelay, TRequestStatus& aStatus)
   1.476 +	{
   1.477 +	aStatus = KRequestPending;
   1.478 +
   1.479 +	iSession->Send(ELogNotify, TIpcArgs(aDelay.Int()), aStatus);
   1.480 +}
   1.481 +
   1.482 +/** Cancels any outstanding notification request for changes to Log Engine database.
   1.483 +
   1.484 +This function can be called even if there is no outstanding notification request. 
   1.485 +@capability Note None required  */
   1.486 +EXPORT_C void CLogClient::NotifyChangeCancel()
   1.487 +	{
   1.488 +	iSession->Send(ELogNotifyCancel, TIpcArgs());
   1.489 +	}
   1.490 +
   1.491 +/**
   1.492 +@capability Note None required
   1.493 +*/
   1.494 +EXPORT_C void CLogClient::SetGlobalChangeObserverL(MLogClientChangeObserver* aObserver)
   1.495 +	{
   1.496 +	delete iChangeObserver;
   1.497 +	iChangeObserver = NULL;
   1.498 +	//
   1.499 +	if	(aObserver)
   1.500 +		{
   1.501 +		iChangeObserver = CLogClientObserver::NewL(*this, *aObserver, Priority());
   1.502 +		}
   1.503 +	}
   1.504 +
   1.505 +/** Gets a standard string from the specified resource in logwrap.dll resource 
   1.506 +file.
   1.507 +
   1.508 +The function can be used to populate some of the event fields in a CLogEvent 
   1.509 +object before creating or changing an event.
   1.510 +
   1.511 +Note that TLogString is a modifiable buffer descriptor that is guaranteed 
   1.512 +to be large enough to contain all standard strings used in the Log Engine; 
   1.513 +pass an instance of this type to this function.
   1.514 +
   1.515 +@param aString A modifiable descriptor into which the string is copied.
   1.516 +@param aId The resource id.
   1.517 +@return KErrNone, if successful; otherwise, one of the other system wide error 
   1.518 +codes.
   1.519 +@capability Note None required.
   1.520 +@see TLogString */
   1.521 +EXPORT_C TInt CLogClient::GetString(TDes& aString, TInt aId) const
   1.522 +	{
   1.523 +	aString.Zero();
   1.524 +	TRAPD(err, DoGetStringL(aString, aId));
   1.525 +	return err;
   1.526 +	}
   1.527 +
   1.528 +void CLogClient::DoGetStringL(TDes& aString, TInt aId) const
   1.529 +	{
   1.530 +	RResourceReader reader;
   1.531 +#ifdef _DEBUG
   1.532 +	const CResourceFile* rcFile = ResourceFile();
   1.533 +	__ASSERT_DEBUG(rcFile != NULL, Panic(ELogNullRcFile));
   1.534 +#endif
   1.535 +	reader.OpenLC(ResourceFile(), aId);
   1.536 +	aString.Copy(reader.ReadTPtrCL());
   1.537 +	CleanupStack::PopAndDestroy();			// reader
   1.538 +	}
   1.539 +
   1.540 +void CLogClient::DoCancel()
   1.541 +	{
   1.542 +	LOGTEXT("CLogClient::DoCancel()");
   1.543 +
   1.544 +	iAddEvent->Cancel();
   1.545 +	iChangeEvent->Cancel();
   1.546 +	iGetEvent->Cancel();
   1.547 +	iDeleteEvent->Cancel();
   1.548 +	iAddType->Cancel();
   1.549 +	iChangeType->Cancel();
   1.550 +	iGetType->Cancel();
   1.551 +	iDeleteType->Cancel();
   1.552 +	iGetConfig->Cancel(); 
   1.553 +	iChangeConfig->Cancel();
   1.554 +	iClearLog->Cancel();
   1.555 +	iClearRecent->Cancel();
   1.556 +
   1.557 +	CLogBase::DoCancel();
   1.558 +	LOGTEXT("CLogClient::DoCancel() - end");
   1.559 +	}
   1.560 +
   1.561 +void CLogClient::DoRunL()
   1.562 +	{
   1.563 +	LOGTEXT2("CLogClient::DoRunL(%d)", iStatus.Int());
   1.564 +	User::LeaveIfError(iStatus.Int());
   1.565 +	LOGTEXT("CLogClient::DoRunL() - end");
   1.566 +	}
   1.567 +
   1.568 +RLogSession& CLogClient::Session() const
   1.569 +	{
   1.570 +	return *iSession;
   1.571 +	}
   1.572 +
   1.573 +#pragma BullseyeCoverage off
   1.574 +
   1.575 +EXPORT_C void CLogClient::CLogBase_Reserved1()
   1.576 +	{
   1.577 +	}
   1.578 +
   1.579 +#pragma BullseyeCoverage on