1 // Copyright (c) 2003-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
24 //#include <logserv.rsg>
27 class CLogClientObserver;
28 class MLogClientChangeObserver;
31 //**********************************
33 //**********************************
35 class CLogEventType : public CBase
36 /** Encapsulates the details of an event type.
38 An event type is used to associate an event with a user-readable description
39 and other configuration information related to the event.
41 Event types are identified by UID.
43 @see CLogEvent::EventType()
44 @see CLogEvent::SetEventType()
50 IMPORT_C static CLogEventType* NewL();
51 IMPORT_C ~CLogEventType();
54 inline TUid Uid() const;
55 inline void SetUid(TUid aUid);
57 inline const TDesC& Description() const;
58 inline void SetDescription(const TDesC& aDescription);
60 inline TBool LoggingEnabled() const;
61 inline void SetLoggingEnabled(TBool aEnable);
63 IMPORT_C void Copy(const CLogEventType& aType);
65 void InternalizeL(RReadStream& aStream);
66 void ExternalizeL(RWriteStream& aStream) const;
71 void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
76 TBool iLoggingEnabled;
79 //**********************************
81 //**********************************
84 /** Encapsulates Log Engine configuration data.
86 @see CLogClient::GetConfig()
87 @see CLogClient::ChangeConfig()
93 IMPORT_C TLogConfig();
95 void InternalizeL(RReadStream& aStream);
96 void ExternalizeL(RWriteStream& aStream) const;
99 /** The maximum number of events that the event log holds.
101 If the number of event log entries exceeds this value, the oldest event is
102 deleted from the log. */
103 TLogSize iMaxLogSize;
105 /** The maximum number of events that a recent event list holds.
107 If the number of recent event list entries exceeds this value, the oldest
108 event is removed from the list. Note, however, that the event is not deleted
109 from the event log. */
110 TLogRecentSize iMaxRecentLogSize;
112 /** The maximum age, in seconds, for which events can be retained in the event log.
114 Events older than this are automatically deleted from the event log.
116 Purging of events by age can be disabled by setting this value to 0. */
117 TLogAge iMaxEventAge;
120 //**********************************
122 //**********************************
124 class CLogFilter : public CBase
125 /** Specifies the conditions that events must satisfy to appear in a view.
127 In general, a filter is used to construct the WHERE clause of an SQL
128 statement based on the content of the filter's fields. The filter's fields
129 correspond to the event properties in a log event detail object, i.e. an instance
130 of the CLogEvent class.
132 Where a filter uses time to extract one or more events from the log, this must be
133 specified as UTC rather than local time.
138 @see CLogViewDuplicate
144 IMPORT_C static CLogFilter* NewL();
145 IMPORT_C ~CLogFilter();
148 inline TUid EventType() const;
149 inline void SetEventType(TUid aType);
151 inline const TDesC& RemoteParty() const;
152 inline void SetRemoteParty(const TDesC& aRemote);
154 inline const TDesC& Direction() const;
155 inline void SetDirection(const TDesC& aDirection);
157 inline TLogDurationType DurationType() const;
158 inline void SetDurationType(TLogDurationType aType);
160 inline const TDesC& Status() const;
161 inline void SetStatus(const TDesC& aStatus);
163 inline TLogContactItemId Contact() const;
164 inline void SetContact(TLogContactItemId aContact);
166 inline const TDesC& Number() const;
167 inline void SetNumber(const TDesC& aNumber);
169 inline TLogFlags Flags() const;
170 inline void SetFlags(TLogFlags aFlags);
171 inline void ClearFlags(TLogFlags aFlags);
173 inline TUint32 NullFields() const;
174 inline void SetNullFields(TUint32 aFields);
176 inline const TTime& StartTime() const;
177 inline void SetStartTime(const TTime& aStartTime);
179 inline const TTime& EndTime() const;
180 inline void SetEndTime(const TTime& aEndTime);
182 IMPORT_C void Copy(const CLogFilter& aFilter);
183 void InternalizeL(RReadStream& aStream);
184 void ExternalizeL(RWriteStream& aStream) const;
189 void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
195 TLogDurationType iDurationType;
197 TLogContactItemId iContact;
205 class CLogFilterList : public CArrayPtrFlat<const CLogFilter>
206 /** A set of event view filters.
208 Specifically, this is an array of pointers to const CLogFilter objects and
209 is derived from CArrayPtrFlat<const CLogFilter>.
219 IMPORT_C CLogFilterList();
220 IMPORT_C CLogFilterList* CopyL() const;
221 IMPORT_C CLogFilterList* CopyLC() const;
222 void InternalizeL(RReadStream& aStream);
223 void ExternalizeL(RWriteStream& aStream) const;
226 //**********************************
228 //**********************************
233 class CLogAddEventClientOp;
234 class CLogChangeEventClientOp;
235 class CLogGetEventClientOp;
236 class CLogDeleteEventClientOp;
237 class CLogAddTypeClientOp;
238 class CLogChangeTypeClientOp;
239 class CLogGetTypeClientOp;
240 class CLogDeleteTypeClientOp;
241 class CLogGetConfigClientOp;
242 class CLogChangeConfigClientOp;
243 class CLogClearLogClientOp;
244 class CLogClearRecentClientOp;
246 class CLogClient : public CLogBase
247 /** Log Engine implementation.
249 It creates a shared session on the log database and allows log viewers to
250 retrieve events from the log.
252 The class also provides log administration functions.
254 Wherever time values are used by this class, they must be specified as UTC rather
263 IMPORT_C static CLogClient* NewL(RFs& aFs, TInt aPriority = CActive::EPriorityStandard);
264 IMPORT_C ~CLogClient();
267 IMPORT_C void AddEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
268 IMPORT_C void GetEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
269 IMPORT_C void ChangeEvent(const CLogEvent& aEvent, TRequestStatus& aStatus);
270 IMPORT_C void DeleteEvent(TLogId aId, TRequestStatus& aStatus);
272 IMPORT_C void AddEventType(const CLogEventType& aType, TRequestStatus& aStatus);
273 IMPORT_C void GetEventType(CLogEventType& aType, TRequestStatus& aStatus);
274 IMPORT_C void ChangeEventType(const CLogEventType& aType, TRequestStatus& aStatus);
275 IMPORT_C void DeleteEventType(TUid aId, TRequestStatus& aStatus);
276 IMPORT_C void GetConfig(TLogConfig& aConfig, TRequestStatus& aStatus);
277 IMPORT_C void ChangeConfig(const TLogConfig& aConfig, TRequestStatus& aStatus);
278 IMPORT_C void ClearLog(const TTime& aDate, TRequestStatus& aStatus);
279 IMPORT_C void ClearLog(TInt aRecentList, TRequestStatus& aStatus);
281 IMPORT_C void NotifyChange(TTimeIntervalMicroSeconds32 aDelay, TRequestStatus& aStatus);
282 IMPORT_C void NotifyChangeCancel();
284 IMPORT_C void SetGlobalChangeObserverL(MLogClientChangeObserver* aObserver);
286 IMPORT_C TInt GetString(TDes& aString, TInt aId) const;
287 RLogSession& Session() const;
290 CLogClient(RFs& aFs, TInt aPriority);
292 void DoGetStringL(TDes& aString, TInt aId) const;
298 RLogSession* iSession;
299 CLogPackage* iPackage;
300 CLogAddEventClientOp* iAddEvent;
301 CLogChangeEventClientOp* iChangeEvent;
302 CLogGetEventClientOp* iGetEvent;
303 CLogDeleteEventClientOp* iDeleteEvent;
304 CLogAddTypeClientOp* iAddType;
305 CLogChangeTypeClientOp* iChangeType;
306 CLogGetTypeClientOp* iGetType;
307 CLogDeleteTypeClientOp* iDeleteType;
308 CLogGetConfigClientOp* iGetConfig;
309 CLogChangeConfigClientOp* iChangeConfig;
310 CLogClearLogClientOp* iClearLog;
311 CLogClearRecentClientOp* iClearRecent;
313 CLogClientObserver* iChangeObserver;
316 IMPORT_C void CLogBase_Reserved1();
319 #include <logcli.inl>