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