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 "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.
24 //#include <logserv.rsg>
27 class CLogClientObserver;
28 class MLogClientChangeObserver;
31 //**********************************
33 //**********************************
35 /** Encapsulates the details of an event type.
37 An event type is used to associate an event with a user-readable description
38 and other configuration information related to the event.
40 Event types are identified by UID.
42 @see CLogEvent::EventType()
43 @see CLogEvent::SetEventType()
47 class CLogEventType : public CBase
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 //**********************************
83 /** Encapsulates Log Engine configuration data.
85 @see CLogClient::GetConfig()
86 @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 /** Specifies the conditions that events must satisfy to appear in a view.
126 In general, a filter is used to construct the WHERE clause of an SQL
127 statement based on the content of the filter's fields. The filter's fields
128 correspond to the event properties in a log event detail object, i.e. an instance
129 of the CLogEvent class.
131 Where a filter uses time to extract one or more events from the log, this must be
132 specified as UTC rather than local time.
137 @see CLogViewDuplicate
141 class CLogFilter : public CBase
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;
186 IMPORT_C void SetSimId(TSimId aSimId);
187 IMPORT_C TSimId SimId() const;
192 void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
198 TLogDurationType iDurationType;
200 TLogContactItemId iContact;
206 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
211 /** A set of event view filters.
213 Specifically, this is an array of pointers to const CLogFilter objects and
214 is derived from CArrayPtrFlat<const CLogFilter>.
222 class CLogFilterList : public CArrayPtrFlat<const CLogFilter>
225 IMPORT_C CLogFilterList();
226 IMPORT_C CLogFilterList* CopyL() const;
227 IMPORT_C CLogFilterList* CopyLC() const;
228 void InternalizeL(RReadStream& aStream);
229 void ExternalizeL(RWriteStream& aStream) const;
232 //**********************************
234 //**********************************
239 class CLogAddEventClientOp;
240 class CLogChangeEventClientOp;
241 class CLogGetEventClientOp;
242 class CLogDeleteEventClientOp;
243 class CLogAddTypeClientOp;
244 class CLogChangeTypeClientOp;
245 class CLogGetTypeClientOp;
246 class CLogDeleteTypeClientOp;
247 class CLogGetConfigClientOp;
248 class CLogChangeConfigClientOp;
249 class CLogClearLogClientOp;
250 class CLogClearRecentClientOp;
252 /** Log Engine implementation.
254 It creates a shared session on the log database and allows log viewers to
255 retrieve events from the log.
257 The class also provides log administration functions.
259 Wherever time values are used by this class, they must be specified as UTC rather
266 class CLogClient : public CLogBase
269 IMPORT_C static CLogClient* NewL(RFs& aFs, TInt aPriority = CActive::EPriorityStandard);
270 IMPORT_C ~CLogClient();
273 IMPORT_C void AddEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
274 IMPORT_C void GetEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
275 IMPORT_C void ChangeEvent(const CLogEvent& aEvent, TRequestStatus& aStatus);
276 IMPORT_C void DeleteEvent(TLogId aId, TRequestStatus& aStatus);
278 IMPORT_C void AddEventType(const CLogEventType& aType, TRequestStatus& aStatus);
279 IMPORT_C void GetEventType(CLogEventType& aType, TRequestStatus& aStatus);
280 IMPORT_C void ChangeEventType(const CLogEventType& aType, TRequestStatus& aStatus);
281 IMPORT_C void DeleteEventType(TUid aId, TRequestStatus& aStatus);
282 IMPORT_C void GetConfig(TLogConfig& aConfig, TRequestStatus& aStatus);
283 IMPORT_C void ChangeConfig(const TLogConfig& aConfig, TRequestStatus& aStatus);
284 IMPORT_C void ClearLog(const TTime& aDate, TRequestStatus& aStatus);
285 IMPORT_C void ClearLog(TInt aRecentList, TRequestStatus& aStatus);
286 IMPORT_C void ClearLog(const TTime& aDate, TSimId aSimid, TRequestStatus& aStatus);
287 IMPORT_C void ClearLog(TInt aRecentList, TSimId aSimid, TRequestStatus& aStatus);
289 IMPORT_C void NotifyChange(TTimeIntervalMicroSeconds32 aDelay, TRequestStatus& aStatus);
290 IMPORT_C void NotifyChangeCancel();
292 IMPORT_C void SetGlobalChangeObserverL(MLogClientChangeObserver* aObserver);
294 IMPORT_C TInt GetString(TDes& aString, TInt aId) const;
295 RLogSession& Session() const;
298 CLogClient(RFs& aFs, TInt aPriority);
300 void DoGetStringL(TDes& aString, TInt aId) const;
306 RLogSession* iSession;
307 CLogPackage* iPackage;
308 CLogAddEventClientOp* iAddEvent;
309 CLogChangeEventClientOp* iChangeEvent;
310 CLogGetEventClientOp* iGetEvent;
311 CLogDeleteEventClientOp* iDeleteEvent;
312 CLogAddTypeClientOp* iAddType;
313 CLogChangeTypeClientOp* iChangeType;
314 CLogGetTypeClientOp* iGetType;
315 CLogDeleteTypeClientOp* iDeleteType;
316 CLogGetConfigClientOp* iGetConfig;
317 CLogChangeConfigClientOp* iChangeConfig;
318 CLogClearLogClientOp* iClearLog;
319 CLogClearRecentClientOp* iClearRecent;
321 CLogClientObserver* iChangeObserver;
324 IMPORT_C void CLogBase_Reserved1();
327 #include <logcli.inl>