sl@0
|
1 |
// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __LOGCLI_H__
|
sl@0
|
17 |
#define __LOGCLI_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
// System includes
|
sl@0
|
20 |
#include <f32file.h>
|
sl@0
|
21 |
#include <d32dbms.h>
|
sl@0
|
22 |
#include <logwrap.h>
|
sl@0
|
23 |
|
sl@0
|
24 |
// Classes referenced
|
sl@0
|
25 |
class CLogClientObserver;
|
sl@0
|
26 |
class MLogClientChangeObserver;
|
sl@0
|
27 |
|
sl@0
|
28 |
|
sl@0
|
29 |
//**********************************
|
sl@0
|
30 |
// CLogEventType
|
sl@0
|
31 |
//**********************************
|
sl@0
|
32 |
|
sl@0
|
33 |
/** Encapsulates the details of an event type.
|
sl@0
|
34 |
|
sl@0
|
35 |
An event type is used to associate an event with a user-readable description
|
sl@0
|
36 |
and other configuration information related to the event.
|
sl@0
|
37 |
|
sl@0
|
38 |
Event types are identified by UID.
|
sl@0
|
39 |
|
sl@0
|
40 |
@see CLogEvent::EventType()
|
sl@0
|
41 |
@see CLogEvent::SetEventType()
|
sl@0
|
42 |
@publishedAll
|
sl@0
|
43 |
@released
|
sl@0
|
44 |
*/
|
sl@0
|
45 |
class CLogEventType : public CBase
|
sl@0
|
46 |
{
|
sl@0
|
47 |
public:
|
sl@0
|
48 |
IMPORT_C static CLogEventType* NewL();
|
sl@0
|
49 |
IMPORT_C ~CLogEventType();
|
sl@0
|
50 |
//
|
sl@0
|
51 |
public:
|
sl@0
|
52 |
inline TUid Uid() const;
|
sl@0
|
53 |
inline void SetUid(TUid aUid);
|
sl@0
|
54 |
//
|
sl@0
|
55 |
inline const TDesC& Description() const;
|
sl@0
|
56 |
inline void SetDescription(const TDesC& aDescription);
|
sl@0
|
57 |
//
|
sl@0
|
58 |
inline TBool LoggingEnabled() const;
|
sl@0
|
59 |
inline void SetLoggingEnabled(TBool aEnable);
|
sl@0
|
60 |
//
|
sl@0
|
61 |
IMPORT_C void Copy(const CLogEventType& aType);
|
sl@0
|
62 |
|
sl@0
|
63 |
void InternalizeL(RReadStream& aStream);
|
sl@0
|
64 |
void ExternalizeL(RWriteStream& aStream) const;
|
sl@0
|
65 |
//
|
sl@0
|
66 |
private:
|
sl@0
|
67 |
CLogEventType();
|
sl@0
|
68 |
void ConstructL();
|
sl@0
|
69 |
void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
|
sl@0
|
70 |
//
|
sl@0
|
71 |
private:
|
sl@0
|
72 |
TUid iUid;
|
sl@0
|
73 |
HBufC* iDescription;
|
sl@0
|
74 |
TBool iLoggingEnabled;
|
sl@0
|
75 |
};
|
sl@0
|
76 |
|
sl@0
|
77 |
//**********************************
|
sl@0
|
78 |
// TLogConfig
|
sl@0
|
79 |
//**********************************
|
sl@0
|
80 |
|
sl@0
|
81 |
/** Encapsulates Log Engine configuration data.
|
sl@0
|
82 |
|
sl@0
|
83 |
@see CLogClient::GetConfig()
|
sl@0
|
84 |
@see CLogClient::ChangeConfig()
|
sl@0
|
85 |
@publishedAll
|
sl@0
|
86 |
@released
|
sl@0
|
87 |
*/
|
sl@0
|
88 |
class TLogConfig
|
sl@0
|
89 |
{
|
sl@0
|
90 |
public:
|
sl@0
|
91 |
IMPORT_C TLogConfig();
|
sl@0
|
92 |
//
|
sl@0
|
93 |
void InternalizeL(RReadStream& aStream);
|
sl@0
|
94 |
void ExternalizeL(RWriteStream& aStream) const;
|
sl@0
|
95 |
//
|
sl@0
|
96 |
public:
|
sl@0
|
97 |
/** The maximum number of events that the event log holds.
|
sl@0
|
98 |
|
sl@0
|
99 |
If the number of event log entries exceeds this value, the oldest event is
|
sl@0
|
100 |
deleted from the log. */
|
sl@0
|
101 |
TLogSize iMaxLogSize;
|
sl@0
|
102 |
|
sl@0
|
103 |
/** The maximum number of events that a recent event list holds.
|
sl@0
|
104 |
|
sl@0
|
105 |
If the number of recent event list entries exceeds this value, the oldest
|
sl@0
|
106 |
event is removed from the list. Note, however, that the event is not deleted
|
sl@0
|
107 |
from the event log. */
|
sl@0
|
108 |
TLogRecentSize iMaxRecentLogSize;
|
sl@0
|
109 |
|
sl@0
|
110 |
/** The maximum age, in seconds, for which events can be retained in the event log.
|
sl@0
|
111 |
|
sl@0
|
112 |
Events older than this are automatically deleted from the event log.
|
sl@0
|
113 |
|
sl@0
|
114 |
Purging of events by age can be disabled by setting this value to 0. */
|
sl@0
|
115 |
TLogAge iMaxEventAge;
|
sl@0
|
116 |
};
|
sl@0
|
117 |
|
sl@0
|
118 |
//**********************************
|
sl@0
|
119 |
// CLogFilter
|
sl@0
|
120 |
//**********************************
|
sl@0
|
121 |
|
sl@0
|
122 |
/** Specifies the conditions that events must satisfy to appear in a view.
|
sl@0
|
123 |
|
sl@0
|
124 |
In general, a filter is used to construct the WHERE clause of an SQL
|
sl@0
|
125 |
statement based on the content of the filter's fields. The filter's fields
|
sl@0
|
126 |
correspond to the event properties in a log event detail object, i.e. an instance
|
sl@0
|
127 |
of the CLogEvent class.
|
sl@0
|
128 |
|
sl@0
|
129 |
Where a filter uses time to extract one or more events from the log, this must be
|
sl@0
|
130 |
specified as UTC rather than local time.
|
sl@0
|
131 |
|
sl@0
|
132 |
@see CLogEvent
|
sl@0
|
133 |
@see CLogViewEvent
|
sl@0
|
134 |
@see CLogViewRecent
|
sl@0
|
135 |
@see CLogViewDuplicate
|
sl@0
|
136 |
@publishedAll
|
sl@0
|
137 |
@released
|
sl@0
|
138 |
*/
|
sl@0
|
139 |
class CLogFilter : public CBase
|
sl@0
|
140 |
{
|
sl@0
|
141 |
public:
|
sl@0
|
142 |
IMPORT_C static CLogFilter* NewL();
|
sl@0
|
143 |
IMPORT_C ~CLogFilter();
|
sl@0
|
144 |
//
|
sl@0
|
145 |
public:
|
sl@0
|
146 |
inline TUid EventType() const;
|
sl@0
|
147 |
inline void SetEventType(TUid aType);
|
sl@0
|
148 |
//
|
sl@0
|
149 |
inline const TDesC& RemoteParty() const;
|
sl@0
|
150 |
inline void SetRemoteParty(const TDesC& aRemote);
|
sl@0
|
151 |
//
|
sl@0
|
152 |
inline const TDesC& Direction() const;
|
sl@0
|
153 |
inline void SetDirection(const TDesC& aDirection);
|
sl@0
|
154 |
//
|
sl@0
|
155 |
inline TLogDurationType DurationType() const;
|
sl@0
|
156 |
inline void SetDurationType(TLogDurationType aType);
|
sl@0
|
157 |
//
|
sl@0
|
158 |
inline const TDesC& Status() const;
|
sl@0
|
159 |
inline void SetStatus(const TDesC& aStatus);
|
sl@0
|
160 |
//
|
sl@0
|
161 |
inline TLogContactItemId Contact() const;
|
sl@0
|
162 |
inline void SetContact(TLogContactItemId aContact);
|
sl@0
|
163 |
//
|
sl@0
|
164 |
inline const TDesC& Number() const;
|
sl@0
|
165 |
inline void SetNumber(const TDesC& aNumber);
|
sl@0
|
166 |
//
|
sl@0
|
167 |
inline TLogFlags Flags() const;
|
sl@0
|
168 |
inline void SetFlags(TLogFlags aFlags);
|
sl@0
|
169 |
inline void ClearFlags(TLogFlags aFlags);
|
sl@0
|
170 |
//
|
sl@0
|
171 |
inline TUint32 NullFields() const;
|
sl@0
|
172 |
inline void SetNullFields(TUint32 aFields);
|
sl@0
|
173 |
//
|
sl@0
|
174 |
inline const TTime& StartTime() const;
|
sl@0
|
175 |
inline void SetStartTime(const TTime& aStartTime);
|
sl@0
|
176 |
//
|
sl@0
|
177 |
inline const TTime& EndTime() const;
|
sl@0
|
178 |
inline void SetEndTime(const TTime& aEndTime);
|
sl@0
|
179 |
//
|
sl@0
|
180 |
IMPORT_C void Copy(const CLogFilter& aFilter);
|
sl@0
|
181 |
void InternalizeL(RReadStream& aStream);
|
sl@0
|
182 |
void ExternalizeL(RWriteStream& aStream) const;
|
sl@0
|
183 |
//
|
sl@0
|
184 |
IMPORT_C void SetSimId(TSimId aSimId);
|
sl@0
|
185 |
IMPORT_C TSimId SimId() const;
|
sl@0
|
186 |
//
|
sl@0
|
187 |
private:
|
sl@0
|
188 |
CLogFilter();
|
sl@0
|
189 |
void ConstructL();
|
sl@0
|
190 |
void InternalizeBufL(RReadStream& aStream, HBufC*& aDes);
|
sl@0
|
191 |
//
|
sl@0
|
192 |
private:
|
sl@0
|
193 |
TUid iEventType;
|
sl@0
|
194 |
HBufC* iRemoteParty;
|
sl@0
|
195 |
HBufC* iDirection;
|
sl@0
|
196 |
TLogDurationType iDurationType;
|
sl@0
|
197 |
HBufC* iStatus;
|
sl@0
|
198 |
TLogContactItemId iContact;
|
sl@0
|
199 |
HBufC* iNumber;
|
sl@0
|
200 |
TLogFlags iFlags;
|
sl@0
|
201 |
TUint32 iNullFields;
|
sl@0
|
202 |
TTime iStartTime;
|
sl@0
|
203 |
TTime iEndTime;
|
sl@0
|
204 |
#ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
|
sl@0
|
205 |
TSimId iSimId;
|
sl@0
|
206 |
#endif
|
sl@0
|
207 |
};
|
sl@0
|
208 |
|
sl@0
|
209 |
/** A set of event view filters.
|
sl@0
|
210 |
|
sl@0
|
211 |
Specifically, this is an array of pointers to const CLogFilter objects and
|
sl@0
|
212 |
is derived from CArrayPtrFlat<const CLogFilter>.
|
sl@0
|
213 |
|
sl@0
|
214 |
@see CLogFilter
|
sl@0
|
215 |
@see CLogViewEvent
|
sl@0
|
216 |
@see CLogViewRecent
|
sl@0
|
217 |
@publishedAll
|
sl@0
|
218 |
@released
|
sl@0
|
219 |
*/
|
sl@0
|
220 |
class CLogFilterList : public CArrayPtrFlat<const CLogFilter>
|
sl@0
|
221 |
{
|
sl@0
|
222 |
public:
|
sl@0
|
223 |
IMPORT_C CLogFilterList();
|
sl@0
|
224 |
IMPORT_C CLogFilterList* CopyL() const;
|
sl@0
|
225 |
IMPORT_C CLogFilterList* CopyLC() const;
|
sl@0
|
226 |
void InternalizeL(RReadStream& aStream);
|
sl@0
|
227 |
void ExternalizeL(RWriteStream& aStream) const;
|
sl@0
|
228 |
};
|
sl@0
|
229 |
|
sl@0
|
230 |
//**********************************
|
sl@0
|
231 |
// CLogClient
|
sl@0
|
232 |
//**********************************
|
sl@0
|
233 |
|
sl@0
|
234 |
class CLogView;
|
sl@0
|
235 |
class RLogSession;
|
sl@0
|
236 |
class CLogPackage;
|
sl@0
|
237 |
class CLogAddEventClientOp;
|
sl@0
|
238 |
class CLogChangeEventClientOp;
|
sl@0
|
239 |
class CLogGetEventClientOp;
|
sl@0
|
240 |
class CLogDeleteEventClientOp;
|
sl@0
|
241 |
class CLogAddTypeClientOp;
|
sl@0
|
242 |
class CLogChangeTypeClientOp;
|
sl@0
|
243 |
class CLogGetTypeClientOp;
|
sl@0
|
244 |
class CLogDeleteTypeClientOp;
|
sl@0
|
245 |
class CLogGetConfigClientOp;
|
sl@0
|
246 |
class CLogChangeConfigClientOp;
|
sl@0
|
247 |
class CLogClearLogClientOp;
|
sl@0
|
248 |
class CLogClearRecentClientOp;
|
sl@0
|
249 |
|
sl@0
|
250 |
/** Log Engine implementation.
|
sl@0
|
251 |
|
sl@0
|
252 |
It creates a shared session on the log database and allows log viewers to
|
sl@0
|
253 |
retrieve events from the log.
|
sl@0
|
254 |
|
sl@0
|
255 |
The class also provides log administration functions.
|
sl@0
|
256 |
|
sl@0
|
257 |
Wherever time values are used by this class, they must be specified as UTC rather
|
sl@0
|
258 |
than local time.
|
sl@0
|
259 |
|
sl@0
|
260 |
@see CLogWrapper
|
sl@0
|
261 |
@publishedAll
|
sl@0
|
262 |
@released
|
sl@0
|
263 |
*/
|
sl@0
|
264 |
class CLogClient : public CLogBase
|
sl@0
|
265 |
{
|
sl@0
|
266 |
public:
|
sl@0
|
267 |
IMPORT_C static CLogClient* NewL(RFs& aFs, TInt aPriority = CActive::EPriorityStandard);
|
sl@0
|
268 |
IMPORT_C ~CLogClient();
|
sl@0
|
269 |
//
|
sl@0
|
270 |
public:
|
sl@0
|
271 |
IMPORT_C void AddEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
|
sl@0
|
272 |
IMPORT_C void GetEvent(CLogEvent& aEvent, TRequestStatus& aStatus);
|
sl@0
|
273 |
IMPORT_C void ChangeEvent(const CLogEvent& aEvent, TRequestStatus& aStatus);
|
sl@0
|
274 |
IMPORT_C void DeleteEvent(TLogId aId, TRequestStatus& aStatus);
|
sl@0
|
275 |
|
sl@0
|
276 |
IMPORT_C void AddEventType(const CLogEventType& aType, TRequestStatus& aStatus);
|
sl@0
|
277 |
IMPORT_C void GetEventType(CLogEventType& aType, TRequestStatus& aStatus);
|
sl@0
|
278 |
IMPORT_C void ChangeEventType(const CLogEventType& aType, TRequestStatus& aStatus);
|
sl@0
|
279 |
IMPORT_C void DeleteEventType(TUid aId, TRequestStatus& aStatus);
|
sl@0
|
280 |
IMPORT_C void GetConfig(TLogConfig& aConfig, TRequestStatus& aStatus);
|
sl@0
|
281 |
IMPORT_C void ChangeConfig(const TLogConfig& aConfig, TRequestStatus& aStatus);
|
sl@0
|
282 |
IMPORT_C void ClearLog(const TTime& aDate, TRequestStatus& aStatus);
|
sl@0
|
283 |
IMPORT_C void ClearLog(TInt aRecentList, TRequestStatus& aStatus);
|
sl@0
|
284 |
IMPORT_C void ClearLog(const TTime& aDate, TSimId aSimid, TRequestStatus& aStatus);
|
sl@0
|
285 |
IMPORT_C void ClearLog(TInt aRecentList, TSimId aSimid, TRequestStatus& aStatus);
|
sl@0
|
286 |
//
|
sl@0
|
287 |
IMPORT_C void NotifyChange(TTimeIntervalMicroSeconds32 aDelay, TRequestStatus& aStatus);
|
sl@0
|
288 |
IMPORT_C void NotifyChangeCancel();
|
sl@0
|
289 |
//
|
sl@0
|
290 |
IMPORT_C void SetGlobalChangeObserverL(MLogClientChangeObserver* aObserver);
|
sl@0
|
291 |
//
|
sl@0
|
292 |
IMPORT_C TInt GetString(TDes& aString, TInt aId) const;
|
sl@0
|
293 |
RLogSession& Session() const;
|
sl@0
|
294 |
//
|
sl@0
|
295 |
private:
|
sl@0
|
296 |
CLogClient(RFs& aFs, TInt aPriority);
|
sl@0
|
297 |
void ConstructL();
|
sl@0
|
298 |
void DoGetStringL(TDes& aString, TInt aId) const;
|
sl@0
|
299 |
//
|
sl@0
|
300 |
void DoRunL();
|
sl@0
|
301 |
void DoCancel();
|
sl@0
|
302 |
//
|
sl@0
|
303 |
private:
|
sl@0
|
304 |
RLogSession* iSession;
|
sl@0
|
305 |
CLogPackage* iPackage;
|
sl@0
|
306 |
CLogAddEventClientOp* iAddEvent;
|
sl@0
|
307 |
CLogChangeEventClientOp* iChangeEvent;
|
sl@0
|
308 |
CLogGetEventClientOp* iGetEvent;
|
sl@0
|
309 |
CLogDeleteEventClientOp* iDeleteEvent;
|
sl@0
|
310 |
CLogAddTypeClientOp* iAddType;
|
sl@0
|
311 |
CLogChangeTypeClientOp* iChangeType;
|
sl@0
|
312 |
CLogGetTypeClientOp* iGetType;
|
sl@0
|
313 |
CLogDeleteTypeClientOp* iDeleteType;
|
sl@0
|
314 |
CLogGetConfigClientOp* iGetConfig;
|
sl@0
|
315 |
CLogChangeConfigClientOp* iChangeConfig;
|
sl@0
|
316 |
CLogClearLogClientOp* iClearLog;
|
sl@0
|
317 |
CLogClearRecentClientOp* iClearRecent;
|
sl@0
|
318 |
RFs& iFs;
|
sl@0
|
319 |
CLogClientObserver* iChangeObserver;
|
sl@0
|
320 |
//
|
sl@0
|
321 |
private:
|
sl@0
|
322 |
IMPORT_C void CLogBase_Reserved1();
|
sl@0
|
323 |
};
|
sl@0
|
324 |
|
sl@0
|
325 |
#include <logcli.inl>
|
sl@0
|
326 |
|
sl@0
|
327 |
#endif
|