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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
18 inline TLogId CLogEvent::Id() const
19 /** Gets the unique event ID associated with this log event.
21 Unique event IDs are allocated by the Log Engine when an event is added to
24 @return The unique event ID.
25 @see CLogClient::GetEvent()
26 @see CLogClient::AddEvent()
27 @see CLogClient::ChangeEvent()
28 @see CLogClient::DeleteEvent() */
33 inline void CLogEvent::SetId(TLogId aId)
34 /** Sets the unique event ID.
36 @param aId The unique event ID. */
41 inline TUid CLogEvent::EventType() const
42 /** Gets the type of this log event. Event types are identified by a UID.
44 @return The event type UID.
45 @see CLogEvent::Description() */
50 inline void CLogEvent::SetEventType(TUid aId)
51 /** Sets the type of this log event. Event types are identified by a UID.
53 @param aId The event type UID.
54 @see CLogEvent::Description() */
59 inline const TDesC& CLogEvent::RemoteParty() const
60 /** Gets the remote party associated with this event.
62 @return A reference to a non-modifiable descriptor containing the remote party. */
67 inline void CLogEvent::SetRemoteParty(const TDesC& aRemote)
68 /** Sets the remote party associated with this event. This describes the destination
69 of an outgoing event or the source of an incoming event.
71 The remote party is represented by a string.
73 The string is copied into a pre-allocated heap descriptor that has a maximum
74 length of KLogMaxRemoteLength. If the length of the specified descriptor is
75 greater than KLogMaxRemoteLength, then the data is truncated.
77 @param aRemote The remote party. */
79 TPtr ptr(iRemoteParty->Des());
80 iRemoteParty->Des().Copy(aRemote.Ptr(), Min(aRemote.Length(), ptr.MaxLength()));
83 inline const TDesC& CLogEvent::Direction() const
84 /** Gets the direction of the call represented by this event. The direction of
85 a call means incoming, outgoing etc.
87 The direction is represented by a string.
89 @return A reference to a non-modifiable descriptor containing the string representing
90 the direction of the call. */
95 inline void CLogEvent::SetDirection(const TDesC& aDirection)
96 /** Sets the direction of the call represented by this event. The direction of
97 a call means incoming, outgoing etc.
99 The direction is represented by a string. Standard strings are available in
100 the log wrapper resource file and can be accessed through the resource IDs:
101 R_LOG_DIR_IN, R_LOG_DIR_OUT, R_LOG_DIR_IN_ALT, R_LOG_DIR_OUT_ALT, R_LOG_DIR_FETCHED
102 and R_LOG_DIR_MISSED.
104 The string is copied into a pre-allocated heap descriptor that has a maximum
105 length of KLogMaxDirectionLength. If the length of the specified descriptor
106 is greater than KLogMaxDirectionLength, then the data is truncated.
108 @param aDirection The readable name.
109 @see CLogClient::GetString() */
111 TPtr ptr(iDirection->Des());
112 ptr.Copy(aDirection.Ptr(), Min(aDirection.Length(), ptr.MaxLength()));
115 inline const TTime& CLogEvent::Time() const
116 /** Gets the UTC time that this event was created.
118 @return The time of the event. */
123 inline void CLogEvent::SetTime(const TTime& aTime)
124 /** Sets the UTC time that this event was created.
126 Note that this field is used when ordering events in a view; changing this
127 value may change the position of the event in a view.
129 @param aTime The UTC time of the event. */
134 inline TLogDurationType CLogEvent::DurationType() const
135 /** Gets the duration type.
137 This applies meaning to the idea of a duration.
139 The duration type is implemented as a UI variant-specific enumeration. The
140 following duration types are generic: KLogDurationNone, KLogDurationValid
141 and KLogDurationData.
143 @return The duration type. */
145 return iDurationType;
148 inline void CLogEvent::SetDurationType(TLogDurationType aDurationType)
149 /** Sets the duration type. This applies meaning to the idea of a duration.
151 @param aDurationType The duration type. */
153 iDurationType = aDurationType;
156 inline TLogDuration CLogEvent::Duration() const
157 /** Gets the duration of the event.
159 @return The duration of the event, expressed as the number of seconds since
160 the time of the event. */
165 inline void CLogEvent::SetDuration(TLogDuration aDuration)
166 /** Sets the duration of the event.
168 @param aDuration The duration of the event, expressed as the number of seconds
169 since the time of the event. */
171 iDuration = aDuration;
174 inline const TDesC& CLogEvent::Status() const
175 /** Gets the delivery status of this event.
177 @return A reference to a non-modifiable descriptor containing the delivery
183 inline void CLogEvent::SetStatus(const TDesC& aStatus)
184 /** Sets the delivery status of this event.
186 The delivery status is represented by a string. Standard strings are available
187 in the log wrapper resource file and can be accessed through the resource
188 IDs: R_LOG_DEL_PENDING, R_LOG_DEL_SENT, R_LOG_DEL_FAILED, R_LOG_DEL_NONE,
189 R_LOG_DEL_DONE and R_LOG_DEL_NOT_SENT.
191 The string is copied into a pre-allocated heap descriptor that has a maximum
192 length of KLogMaxStatusLength. If the length of the specified descriptor is
193 greater than KLogMaxStatusLength, then the data is truncated.
195 @param aStatus The delivery status.
196 @see CLogClient::GetString() */
198 TPtr ptr(iStatus->Des());
199 ptr.Copy(aStatus.Ptr(), Min(aStatus.Length(), ptr.MaxLength()));
202 inline const TDesC& CLogEvent::Subject() const
203 /** Gets the subject of this event.
205 @return A reference to a non-modifiable descriptor containing the subject. */
210 inline void CLogEvent::SetSubject(const TDesC& aSubject)
211 /** Sets the subject of this event.
213 The subject is represented by a string.
215 The string is copied into a pre-allocated heap descriptor that has a maximum
216 length of KLogMaxSubjectLength. If the length of the specified descriptor
217 is greater than KLogMaxSubjectLength, then the data is truncated.
219 @param aSubject The subject. */
221 TPtr ptr(iSubject->Des());
222 ptr.Copy(aSubject.Ptr(), Min(aSubject.Length(), ptr.MaxLength()));
225 inline const TDesC& CLogEvent::Number() const
226 /** Gets the phone number associated with the event.
228 @return A reference to a non-modifiable descriptor containing the phone number. */
233 inline void CLogEvent::SetNumber(const TDesC& aNumber)
234 /** Sets the phone number associated with this event. This is used when the number
235 cannot be stored in any other field.
237 The number is specified as a string and is copied into a pre-allocated heap
238 descriptor that has a maximum length of KLogMaxNumberLength. If the length
239 of the specified descriptor is greater than KLogMaxNumberLength, then the
242 @param aNumber The number. */
244 TPtr ptr(iNumber->Des());
245 ptr.Copy(aNumber.Ptr(), Min(aNumber.Length(), ptr.MaxLength()));
248 inline TLogContactItemId CLogEvent::Contact() const
249 /** Gets the contact ID associated with the event.
251 @return The contact ID. */
256 inline void CLogEvent::SetContact(TLogContactItemId aContact)
257 /** Sets the contact ID associated with the event.
259 @param aContact The contact ID. */
264 inline TLogLink CLogEvent::Link() const
265 /** Gets the link value.
267 @return The link value. */
272 inline void CLogEvent::SetLink(TLogLink aLink)
273 /** Sets the link value.
275 The link can be used to relate this event to an entity in another application.
276 For example, it can be used to associate the event with the call ID or the
277 message ID for emails and faxes.
279 @param aLink The link value. */
284 inline const TDesC& CLogEvent::Description() const
285 /** Gets the human readable name describing the event type.
287 Note that this is set automatically by the Log Engine.
289 @return A reference to a non-modifiable descriptor containing the readable
292 return *iDescription;
295 inline void CLogEvent::SetDescription(const TDesC& aDescription)
297 TPtr ptr(iDescription->Des());
298 ptr.Copy(aDescription.Ptr(), Min(aDescription.Length(), ptr.MaxLength()));
301 inline const TDesC8& CLogEvent::Data() const
302 /** Gets event specific data.
304 @return A reference to a non-modifiable descriptor containing the data that
305 is specific to the event.KNullDesC8, if there is no data. */
313 inline TLogFlags CLogEvent::Flags() const
314 /** Gets the flags set for this event.
316 @return The flags. */
321 inline void CLogEvent::SetFlags(TLogFlags aFlags)
322 /** Sets the specified flags for this event.
324 The function does not change any of the other flag bit settings.
326 Only the low order 4 bits are stored in the Log Engine Database; the constant
327 KLogFlagsMask can be used as a mask.
329 @param aFlags The flags to be set. */
331 __ASSERT_DEBUG(aFlags <= KLogFlagsMask, User::Invariant());
332 iFlags = (TLogFlags)(iFlags | aFlags);
335 inline void CLogEvent::ClearFlags(TLogFlags aFlags)
336 /** Clears the specified flags for this event.
338 The function does not change any of the other flag bit settings.
340 The constant KLogFlagsMask may be used to clear all the flags in an event.
342 @param aFlags The flags to be cleared. */
344 __ASSERT_DEBUG(aFlags <= KLogFlagsMask, User::Invariant());
345 iFlags = (TLogFlags)(iFlags & ~aFlags);
348 //**********************************
350 //**********************************
352 inline const CResourceFile* CLogBase::ResourceFile() const
354 return iResourceFile;
357 inline CLogBase& CLogWrapper::Log()
358 /** Gets a reference to the Log Engine object.
360 @return If the Log Engine is installed, this is a reference to a CLogClient
361 object. If there is no Log Engine, this is a reference to an instance of the
362 Log Engine base class, CLogBase.