os/persistentdata/loggingservices/eventlogger/LogWrap/inc/LOGWRAP.INL
author sl
Tue, 10 Jun 2014 14:32:02 +0200 (2014-06-10)
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// CLogEvent
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
inline TLogId CLogEvent::Id() const
sl@0
    19
/** Gets the unique event ID associated with this log event.
sl@0
    20
sl@0
    21
Unique event IDs are allocated by the Log Engine when an event is added to 
sl@0
    22
the log.
sl@0
    23
sl@0
    24
@return The unique event ID.
sl@0
    25
@see CLogClient::GetEvent()
sl@0
    26
@see CLogClient::AddEvent()
sl@0
    27
@see CLogClient::ChangeEvent()
sl@0
    28
@see CLogClient::DeleteEvent() */
sl@0
    29
	{
sl@0
    30
	return iId;
sl@0
    31
	}
sl@0
    32
sl@0
    33
inline void CLogEvent::SetId(TLogId aId)
sl@0
    34
/** Sets the unique event ID.
sl@0
    35
sl@0
    36
@param aId The unique event ID. */
sl@0
    37
	{
sl@0
    38
	iId = aId;
sl@0
    39
	}
sl@0
    40
sl@0
    41
inline TUid CLogEvent::EventType() const
sl@0
    42
/** Gets the type of this log event. Event types are identified by a UID.
sl@0
    43
sl@0
    44
@return The event type UID.
sl@0
    45
@see CLogEvent::Description() */
sl@0
    46
	{
sl@0
    47
	return iEventType;
sl@0
    48
	}
sl@0
    49
sl@0
    50
inline void CLogEvent::SetEventType(TUid aId)
sl@0
    51
/** Sets the type of this log event. Event types are identified by a UID.
sl@0
    52
sl@0
    53
@param aId The event type UID.
sl@0
    54
@see CLogEvent::Description() */
sl@0
    55
	{
sl@0
    56
	iEventType = aId;
sl@0
    57
	}
sl@0
    58
sl@0
    59
inline const TDesC& CLogEvent::RemoteParty() const
sl@0
    60
/** Gets the remote party associated with this event.
sl@0
    61
sl@0
    62
@return A reference to a non-modifiable descriptor containing the remote party. */
sl@0
    63
	{
sl@0
    64
	return *iRemoteParty;
sl@0
    65
	}
sl@0
    66
sl@0
    67
inline void CLogEvent::SetRemoteParty(const TDesC& aRemote)
sl@0
    68
/** Sets the remote party associated with this event. This describes the destination 
sl@0
    69
of an outgoing event or the source of an incoming event.
sl@0
    70
sl@0
    71
The remote party is represented by a string.
sl@0
    72
sl@0
    73
The string is copied into a pre-allocated heap descriptor that has a maximum 
sl@0
    74
length of KLogMaxRemoteLength. If the length of the specified descriptor is 
sl@0
    75
greater than KLogMaxRemoteLength, then the data is truncated.
sl@0
    76
sl@0
    77
@param aRemote The remote party. */
sl@0
    78
	{
sl@0
    79
	TPtr ptr(iRemoteParty->Des());
sl@0
    80
	iRemoteParty->Des().Copy(aRemote.Ptr(), Min(aRemote.Length(), ptr.MaxLength()));
sl@0
    81
	}
sl@0
    82
sl@0
    83
inline const TDesC& CLogEvent::Direction() const
sl@0
    84
/** Gets the direction of the call represented by this event. The direction of 
sl@0
    85
a call means incoming, outgoing etc.
sl@0
    86
sl@0
    87
The direction is represented by a string.
sl@0
    88
sl@0
    89
@return A reference to a non-modifiable descriptor containing the string representing 
sl@0
    90
the direction of the call. */
sl@0
    91
	{
sl@0
    92
	return *iDirection;
sl@0
    93
	}
sl@0
    94
sl@0
    95
inline void CLogEvent::SetDirection(const TDesC& aDirection)
sl@0
    96
/** Sets the direction of the call represented by this event. The direction of 
sl@0
    97
a call means incoming, outgoing etc.
sl@0
    98
sl@0
    99
The direction is represented by a string. Standard strings are available in 
sl@0
   100
the log wrapper resource file and can be accessed through the resource IDs: 
sl@0
   101
R_LOG_DIR_IN, R_LOG_DIR_OUT, R_LOG_DIR_IN_ALT, R_LOG_DIR_OUT_ALT, R_LOG_DIR_FETCHED 
sl@0
   102
and R_LOG_DIR_MISSED.
sl@0
   103
sl@0
   104
The string is copied into a pre-allocated heap descriptor that has a maximum 
sl@0
   105
length of KLogMaxDirectionLength. If the length of the specified descriptor 
sl@0
   106
is greater than KLogMaxDirectionLength, then the data is truncated.
sl@0
   107
sl@0
   108
@param aDirection The readable name.
sl@0
   109
@see CLogClient::GetString() */
sl@0
   110
	{
sl@0
   111
	TPtr ptr(iDirection->Des());
sl@0
   112
	ptr.Copy(aDirection.Ptr(), Min(aDirection.Length(), ptr.MaxLength()));
sl@0
   113
	}
sl@0
   114
sl@0
   115
inline const TTime& CLogEvent::Time() const
sl@0
   116
/** Gets the UTC time that this event was created.
sl@0
   117
sl@0
   118
@return The time of the event. */
sl@0
   119
	{
sl@0
   120
	return iTime;
sl@0
   121
	}
sl@0
   122
sl@0
   123
inline void CLogEvent::SetTime(const TTime& aTime)
sl@0
   124
/** Sets the UTC time that this event was created.
sl@0
   125
sl@0
   126
Note that this field is used when ordering events in a view; changing this 
sl@0
   127
value may change the position of the event in a view.
sl@0
   128
sl@0
   129
@param aTime The UTC time of the event. */
sl@0
   130
	{
sl@0
   131
	iTime = aTime;
sl@0
   132
	}
sl@0
   133
sl@0
   134
inline TLogDurationType CLogEvent::DurationType() const
sl@0
   135
/** Gets the duration type.
sl@0
   136
sl@0
   137
This applies meaning to the idea of a duration. 
sl@0
   138
sl@0
   139
The duration type is implemented as a UI variant-specific enumeration. The 
sl@0
   140
following duration types are generic: KLogDurationNone, KLogDurationValid 
sl@0
   141
and KLogDurationData.
sl@0
   142
sl@0
   143
@return The duration type. */
sl@0
   144
	{
sl@0
   145
	return iDurationType;
sl@0
   146
	}
sl@0
   147
sl@0
   148
inline void CLogEvent::SetDurationType(TLogDurationType aDurationType)
sl@0
   149
/** Sets the duration type. This applies meaning to the idea of a duration.
sl@0
   150
sl@0
   151
@param aDurationType The duration type. */
sl@0
   152
	{
sl@0
   153
	iDurationType = aDurationType;
sl@0
   154
	}
sl@0
   155
sl@0
   156
inline TLogDuration CLogEvent::Duration() const
sl@0
   157
/** Gets the duration of the event.
sl@0
   158
sl@0
   159
@return The duration of the event, expressed as the number of seconds since 
sl@0
   160
the time of the event. */
sl@0
   161
	{
sl@0
   162
	return iDuration;
sl@0
   163
	}
sl@0
   164
sl@0
   165
inline void CLogEvent::SetDuration(TLogDuration aDuration)
sl@0
   166
/** Sets the duration of the event.
sl@0
   167
sl@0
   168
@param aDuration The duration of the event, expressed as the number of seconds 
sl@0
   169
since the time of the event. */
sl@0
   170
	{
sl@0
   171
	iDuration = aDuration;
sl@0
   172
	}
sl@0
   173
sl@0
   174
inline const TDesC& CLogEvent::Status() const
sl@0
   175
/** Gets the delivery status of this event.
sl@0
   176
sl@0
   177
@return A reference to a non-modifiable descriptor containing the delivery 
sl@0
   178
status. */
sl@0
   179
	{
sl@0
   180
	return *iStatus;
sl@0
   181
	}
sl@0
   182
sl@0
   183
inline void CLogEvent::SetStatus(const TDesC& aStatus)
sl@0
   184
/** Sets the delivery status of this event.
sl@0
   185
sl@0
   186
The delivery status is represented by a string. Standard strings are available 
sl@0
   187
in the log wrapper resource file and can be accessed through the resource 
sl@0
   188
IDs: R_LOG_DEL_PENDING, R_LOG_DEL_SENT, R_LOG_DEL_FAILED, R_LOG_DEL_NONE, 
sl@0
   189
R_LOG_DEL_DONE and R_LOG_DEL_NOT_SENT.
sl@0
   190
sl@0
   191
The string is copied into a pre-allocated heap descriptor that has a maximum 
sl@0
   192
length of KLogMaxStatusLength. If the length of the specified descriptor is 
sl@0
   193
greater than KLogMaxStatusLength, then the data is truncated.
sl@0
   194
sl@0
   195
@param aStatus The delivery status.
sl@0
   196
@see CLogClient::GetString() */
sl@0
   197
	{
sl@0
   198
	TPtr ptr(iStatus->Des());
sl@0
   199
	ptr.Copy(aStatus.Ptr(), Min(aStatus.Length(), ptr.MaxLength()));
sl@0
   200
	}
sl@0
   201
sl@0
   202
inline const TDesC& CLogEvent::Subject() const
sl@0
   203
/** Gets the subject of this event.
sl@0
   204
sl@0
   205
@return A reference to a non-modifiable descriptor containing the subject. */
sl@0
   206
	{
sl@0
   207
	return *iSubject;
sl@0
   208
	}
sl@0
   209
sl@0
   210
inline void CLogEvent::SetSubject(const TDesC& aSubject)
sl@0
   211
/** Sets the subject of this event.
sl@0
   212
sl@0
   213
The subject is represented by a string.
sl@0
   214
sl@0
   215
The string is copied into a pre-allocated heap descriptor that has a maximum 
sl@0
   216
length of KLogMaxSubjectLength. If the length of the specified descriptor 
sl@0
   217
is greater than KLogMaxSubjectLength, then the data is truncated.
sl@0
   218
sl@0
   219
@param aSubject The subject. */
sl@0
   220
	{
sl@0
   221
	TPtr ptr(iSubject->Des());
sl@0
   222
	ptr.Copy(aSubject.Ptr(), Min(aSubject.Length(), ptr.MaxLength()));
sl@0
   223
	}
sl@0
   224
sl@0
   225
inline const TDesC& CLogEvent::Number() const
sl@0
   226
/** Gets the phone number associated with the event.
sl@0
   227
sl@0
   228
@return A reference to a non-modifiable descriptor containing the phone number. */
sl@0
   229
	{
sl@0
   230
	return *iNumber;
sl@0
   231
	}
sl@0
   232
sl@0
   233
inline void CLogEvent::SetNumber(const TDesC& aNumber)
sl@0
   234
/** Sets the phone number associated with this event. This is used when the number 
sl@0
   235
cannot be stored in any other field.
sl@0
   236
sl@0
   237
The number is specified as a string and is copied into a pre-allocated heap 
sl@0
   238
descriptor that has a maximum length of KLogMaxNumberLength. If the length 
sl@0
   239
of the specified descriptor is greater than KLogMaxNumberLength, then the 
sl@0
   240
number is truncated.
sl@0
   241
sl@0
   242
@param aNumber The number. */
sl@0
   243
	{
sl@0
   244
	TPtr ptr(iNumber->Des());
sl@0
   245
	ptr.Copy(aNumber.Ptr(), Min(aNumber.Length(), ptr.MaxLength()));
sl@0
   246
	}
sl@0
   247
sl@0
   248
inline TLogContactItemId  CLogEvent::Contact() const
sl@0
   249
/** Gets the contact ID associated with the event.
sl@0
   250
sl@0
   251
@return The contact ID. */
sl@0
   252
	{
sl@0
   253
	return iContact;
sl@0
   254
	}
sl@0
   255
sl@0
   256
inline void CLogEvent::SetContact(TLogContactItemId  aContact)
sl@0
   257
/** Sets the contact ID associated with the event.
sl@0
   258
sl@0
   259
@param aContact The contact ID. */
sl@0
   260
	{
sl@0
   261
	iContact = aContact;
sl@0
   262
	}
sl@0
   263
sl@0
   264
inline TLogLink CLogEvent::Link() const
sl@0
   265
/** Gets the link value.
sl@0
   266
sl@0
   267
@return The link value. */
sl@0
   268
	{
sl@0
   269
	return iLink;
sl@0
   270
	}
sl@0
   271
sl@0
   272
inline void CLogEvent::SetLink(TLogLink aLink)
sl@0
   273
/** Sets the link value.
sl@0
   274
sl@0
   275
The link can be used to relate this event to an entity in another application. 
sl@0
   276
For example, it can be used to associate the event with the call ID or the 
sl@0
   277
message ID for emails and faxes.
sl@0
   278
sl@0
   279
@param aLink The link value. */
sl@0
   280
	{
sl@0
   281
	iLink = aLink;
sl@0
   282
	}
sl@0
   283
sl@0
   284
inline const TDesC& CLogEvent::Description() const
sl@0
   285
/** Gets the human readable name describing the event type.
sl@0
   286
sl@0
   287
Note that this is set automatically by the Log Engine.
sl@0
   288
sl@0
   289
@return A reference to a non-modifiable descriptor containing the readable 
sl@0
   290
name. */
sl@0
   291
	{
sl@0
   292
	return *iDescription;
sl@0
   293
	}
sl@0
   294
sl@0
   295
inline void CLogEvent::SetDescription(const TDesC& aDescription)
sl@0
   296
	{
sl@0
   297
	TPtr ptr(iDescription->Des());
sl@0
   298
	ptr.Copy(aDescription.Ptr(), Min(aDescription.Length(), ptr.MaxLength()));
sl@0
   299
	}
sl@0
   300
sl@0
   301
inline const TDesC8& CLogEvent::Data() const
sl@0
   302
/** Gets event specific data.
sl@0
   303
sl@0
   304
@return A reference to a non-modifiable descriptor containing the data that 
sl@0
   305
is specific to the event.KNullDesC8, if there is no data. */
sl@0
   306
	{
sl@0
   307
	if (iData)
sl@0
   308
		return *iData;
sl@0
   309
	else
sl@0
   310
		return KNullDesC8;
sl@0
   311
	}
sl@0
   312
sl@0
   313
inline TLogFlags CLogEvent::Flags() const
sl@0
   314
/** Gets the flags set for this event.
sl@0
   315
sl@0
   316
@return The flags. */
sl@0
   317
	{
sl@0
   318
	return iFlags;
sl@0
   319
	}
sl@0
   320
sl@0
   321
inline void CLogEvent::SetFlags(TLogFlags aFlags)
sl@0
   322
/** Sets the specified flags for this event.
sl@0
   323
sl@0
   324
The function does not change any of the other flag bit settings.
sl@0
   325
sl@0
   326
Only the low order 4 bits are stored in the Log Engine Database; the constant 
sl@0
   327
KLogFlagsMask can be used as a mask.
sl@0
   328
sl@0
   329
@param aFlags The flags to be set. */
sl@0
   330
	{
sl@0
   331
	__ASSERT_DEBUG(aFlags <= KLogFlagsMask, User::Invariant());
sl@0
   332
	iFlags = (TLogFlags)(iFlags | aFlags);
sl@0
   333
	}
sl@0
   334
sl@0
   335
inline void CLogEvent::ClearFlags(TLogFlags aFlags)
sl@0
   336
/** Clears the specified flags for this event.
sl@0
   337
sl@0
   338
The function does not change any of the other flag bit settings.
sl@0
   339
sl@0
   340
The constant KLogFlagsMask may be used to clear all the flags in an event.
sl@0
   341
sl@0
   342
@param aFlags The flags to be cleared. */
sl@0
   343
	{
sl@0
   344
	__ASSERT_DEBUG(aFlags <= KLogFlagsMask, User::Invariant());
sl@0
   345
	iFlags = (TLogFlags)(iFlags & ~aFlags); 
sl@0
   346
	}
sl@0
   347
sl@0
   348
//**********************************
sl@0
   349
// CLogBase
sl@0
   350
//**********************************
sl@0
   351
sl@0
   352
inline const CResourceFile* CLogBase::ResourceFile() const
sl@0
   353
	{
sl@0
   354
	return iResourceFile;
sl@0
   355
	}
sl@0
   356
sl@0
   357
inline CLogBase& CLogWrapper::Log()
sl@0
   358
/** Gets a reference to the Log Engine object.
sl@0
   359
sl@0
   360
@return If the Log Engine is installed, this is a reference to a CLogClient 
sl@0
   361
object. If there is no Log Engine, this is a reference to an instance of the 
sl@0
   362
Log Engine base class, CLogBase.
sl@0
   363
@see CLogClient */
sl@0
   364
	{
sl@0
   365
	return *iBase;
sl@0
   366
	}