Update contrib.
1 // Copyright (c) 2003-2010 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.
25 class CLogClientObserver;
26 class MLogClientChangeObserver;
29 //**********************************
31 //**********************************
33 /** Encapsulates the details of an event type.
35 An event type is used to associate an event with a user-readable description
36 and other configuration information related to the event.
38 Event types are identified by UID.
40 @see CLogEvent::EventType()
41 @see CLogEvent::SetEventType()
45 class CLogEventType : public CBase
48 IMPORT_C static CLogEventType* NewL();
49 IMPORT_C ~CLogEventType();
52 inline TUid Uid() const;
53 inline void SetUid(TUid aUid);
55 inline const TDesC& Description() const;
56 inline void SetDescription(const TDesC& aDescription);
58 inline TBool LoggingEnabled() const;
59 inline void SetLoggingEnabled(TBool aEnable);
61 IMPORT_C void Copy(const CLogEventType& aType);
63 void InternalizeL(RReadStream& aStream);
64 void ExternalizeL(RWriteStream& aStream) const;
69 void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
74 TBool iLoggingEnabled;
77 //**********************************
79 //**********************************
81 /** Encapsulates Log Engine configuration data.
83 @see CLogClient::GetConfig()
84 @see CLogClient::ChangeConfig()
91 IMPORT_C TLogConfig();
93 void InternalizeL(RReadStream& aStream);
94 void ExternalizeL(RWriteStream& aStream) const;
97 /** The maximum number of events that the event log holds.
99 If the number of event log entries exceeds this value, the oldest event is
100 deleted from the log. */
101 TLogSize iMaxLogSize;
103 /** The maximum number of events that a recent event list holds.
105 If the number of recent event list entries exceeds this value, the oldest
106 event is removed from the list. Note, however, that the event is not deleted
107 from the event log. */
108 TLogRecentSize iMaxRecentLogSize;
110 /** The maximum age, in seconds, for which events can be retained in the event log.
112 Events older than this are automatically deleted from the event log.
114 Purging of events by age can be disabled by setting this value to 0. */
115 TLogAge iMaxEventAge;
118 //**********************************
120 //**********************************
122 /** Specifies the conditions that events must satisfy to appear in a view.
124 In general, a filter is used to construct the WHERE clause of an SQL
125 statement based on the content of the filter's fields. The filter's fields
126 correspond to the event properties in a log event detail object, i.e. an instance
127 of the CLogEvent class.
129 Where a filter uses time to extract one or more events from the log, this must be
130 specified as UTC rather than local time.
135 @see CLogViewDuplicate
139 class CLogFilter : public CBase
142 IMPORT_C static CLogFilter* NewL();
143 IMPORT_C ~CLogFilter();
146 inline TUid EventType() const;
147 inline void SetEventType(TUid aType);
149 inline const TDesC& RemoteParty() const;
150 inline void SetRemoteParty(const TDesC& aRemote);
152 inline const TDesC& Direction() const;
153 inline void SetDirection(const TDesC& aDirection);
155 inline TLogDurationType DurationType() const;
156 inline void SetDurationType(TLogDurationType aType);
158 inline const TDesC& Status() const;
159 inline void SetStatus(const TDesC& aStatus);
161 inline TLogContactItemId Contact() const;
162 inline void SetContact(TLogContactItemId aContact);
164 inline const TDesC& Number() const;
165 inline void SetNumber(const TDesC& aNumber);
167 inline TLogFlags Flags() const;
168 inline void SetFlags(TLogFlags aFlags);
169 inline void ClearFlags(TLogFlags aFlags);
171 inline TUint32 NullFields() const;
172 inline void SetNullFields(TUint32 aFields);
174 inline const TTime& StartTime() const;
175 inline void SetStartTime(const TTime& aStartTime);
177 inline const TTime& EndTime() const;
178 inline void SetEndTime(const TTime& aEndTime);
180 IMPORT_C void Copy(const CLogFilter& aFilter);
181 void InternalizeL(RReadStream& aStream);
182 void ExternalizeL(RWriteStream& aStream) const;
184 IMPORT_C void SetSimId(TSimId aSimId);
185 IMPORT_C TSimId SimId() const;
190 void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
196 TLogDurationType iDurationType;
198 TLogContactItemId iContact;
204 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
209 /** A set of event view filters.
211 Specifically, this is an array of pointers to const CLogFilter objects and
212 is derived from CArrayPtrFlat<const CLogFilter>.
220 class CLogFilterList : public CArrayPtrFlat<const CLogFilter>
223 IMPORT_C CLogFilterList();
224 IMPORT_C CLogFilterList* CopyL() const;
225 IMPORT_C CLogFilterList* CopyLC() const;
226 void InternalizeL(RReadStream& aStream);
227 void ExternalizeL(RWriteStream& aStream) const;
230 //**********************************
232 //**********************************
237 class CLogAddEventClientOp;
238 class CLogChangeEventClientOp;
239 class CLogGetEventClientOp;
240 class CLogDeleteEventClientOp;
241 class CLogAddTypeClientOp;
242 class CLogChangeTypeClientOp;
243 class CLogGetTypeClientOp;
244 class CLogDeleteTypeClientOp;
245 class CLogGetConfigClientOp;
246 class CLogChangeConfigClientOp;
247 class CLogClearLogClientOp;
248 class CLogClearRecentClientOp;
250 /** Log Engine implementation.
252 It creates a shared session on the log database and allows log viewers to
253 retrieve events from the log.
255 The class also provides log administration functions.
257 Wherever time values are used by this class, they must be specified as UTC rather
264 class CLogClient : public CLogBase
267 IMPORT_C static CLogClient* NewL(RFs& aFs, TInt aPriority = CActive::EPriorityStandard);
268 IMPORT_C ~CLogClient();
271 IMPORT_C void AddEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
272 IMPORT_C void GetEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
273 IMPORT_C void ChangeEvent(const CLogEvent& aEvent, TRequestStatus& aStatus);
274 IMPORT_C void DeleteEvent(TLogId aId, TRequestStatus& aStatus);
276 IMPORT_C void AddEventType(const CLogEventType& aType, TRequestStatus& aStatus);
277 IMPORT_C void GetEventType(CLogEventType& aType, TRequestStatus& aStatus);
278 IMPORT_C void ChangeEventType(const CLogEventType& aType, TRequestStatus& aStatus);
279 IMPORT_C void DeleteEventType(TUid aId, TRequestStatus& aStatus);
280 IMPORT_C void GetConfig(TLogConfig& aConfig, TRequestStatus& aStatus);
281 IMPORT_C void ChangeConfig(const TLogConfig& aConfig, TRequestStatus& aStatus);
282 IMPORT_C void ClearLog(const TTime& aDate, TRequestStatus& aStatus);
283 IMPORT_C void ClearLog(TInt aRecentList, TRequestStatus& aStatus);
284 IMPORT_C void ClearLog(const TTime& aDate, TSimId aSimid, TRequestStatus& aStatus);
285 IMPORT_C void ClearLog(TInt aRecentList, TSimId aSimid, TRequestStatus& aStatus);
287 IMPORT_C void NotifyChange(TTimeIntervalMicroSeconds32 aDelay, TRequestStatus& aStatus);
288 IMPORT_C void NotifyChangeCancel();
290 IMPORT_C void SetGlobalChangeObserverL(MLogClientChangeObserver* aObserver);
292 IMPORT_C TInt GetString(TDes& aString, TInt aId) const;
293 RLogSession& Session() const;
296 CLogClient(RFs& aFs, TInt aPriority);
298 void DoGetStringL(TDes& aString, TInt aId) const;
304 RLogSession* iSession;
305 CLogPackage* iPackage;
306 CLogAddEventClientOp* iAddEvent;
307 CLogChangeEventClientOp* iChangeEvent;
308 CLogGetEventClientOp* iGetEvent;
309 CLogDeleteEventClientOp* iDeleteEvent;
310 CLogAddTypeClientOp* iAddType;
311 CLogChangeTypeClientOp* iChangeType;
312 CLogGetTypeClientOp* iGetType;
313 CLogDeleteTypeClientOp* iDeleteType;
314 CLogGetConfigClientOp* iGetConfig;
315 CLogChangeConfigClientOp* iChangeConfig;
316 CLogClearLogClientOp* iClearLog;
317 CLogClearRecentClientOp* iClearRecent;
319 CLogClientObserver* iChangeObserver;
322 IMPORT_C void CLogBase_Reserved1();
325 #include <logcli.inl>