author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 17 Dec 2009 09:09:50 +0200 | |
changeset 26 | 5d0ec8b709be |
parent 5 | 989d2f495d90 |
permissions | -rw-r--r-- |
5 | 1 |
/* |
2 |
* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Includes logging core class filter methods. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef LOGGINGFILTER_H |
|
19 |
#define LOGGINGFILTER_H |
|
20 |
||
21 |
#include <cntdef.h> |
|
22 |
||
23 |
/** |
|
24 |
* Forward Declarations |
|
25 |
*/ |
|
26 |
||
27 |
class CLogFilter ; |
|
28 |
class CLogsEvent ; |
|
29 |
||
30 |
/** |
|
31 |
* CLogsFilter:this is a wrapper class for the symbian CLogFilter class. |
|
32 |
*/ |
|
33 |
||
34 |
class CLogsFilter : public CBase |
|
35 |
{ |
|
36 |
public : |
|
37 |
||
38 |
/** |
|
39 |
* NewL and NewLC method to construct the sapiFilter |
|
40 |
*/ |
|
41 |
||
42 |
IMPORT_C static CLogsFilter* NewL() ; |
|
43 |
||
44 |
static CLogsFilter* NewLC() ; |
|
45 |
||
46 |
/** |
|
47 |
* Gets the associated filter |
|
48 |
*/ |
|
49 |
||
50 |
inline CLogFilter* getFilter() |
|
51 |
{ |
|
52 |
return iLogFilter ; |
|
53 |
} |
|
54 |
||
55 |
/** |
|
56 |
* Sets the filter |
|
57 |
*/ |
|
58 |
||
59 |
inline void setFilter(CLogFilter& aLogFilter) |
|
60 |
{ |
|
61 |
aLogFilter.Copy(*iLogFilter); |
|
62 |
} |
|
63 |
||
64 |
/** |
|
65 |
* Copy function, does a deep copy of SapiFilter |
|
66 |
*/ |
|
67 |
||
68 |
inline void Copy(CLogsFilter& aLogFilter) |
|
69 |
{ |
|
70 |
(aLogFilter.getFilter())->Copy(*iLogFilter) ; |
|
71 |
} |
|
72 |
||
73 |
/** |
|
74 |
* Clears the flags to be used by filter |
|
75 |
*/ |
|
76 |
||
77 |
inline void ClearFlags(TLogFlags aFlags) |
|
78 |
{ |
|
79 |
iLogFilter->ClearFlags(aFlags) ; |
|
80 |
} |
|
81 |
||
82 |
/** |
|
83 |
* Returns Null Fields in the filter |
|
84 |
*/ |
|
85 |
||
86 |
inline TUint32 NullFields() |
|
87 |
{ |
|
88 |
return iLogFilter->NullFields() ; |
|
89 |
} |
|
90 |
||
91 |
/** |
|
92 |
* Sets the Null Fields in the filter |
|
93 |
* These are the fields that the filter expects to be NULL in the database. |
|
94 |
* |
|
95 |
*/ |
|
96 |
||
97 |
inline void SetNullFields(TUint32 aNullFields) |
|
98 |
{ |
|
99 |
iLogFilter->SetNullFields(aNullFields) ; |
|
100 |
} |
|
101 |
||
102 |
/** |
|
103 |
* Gets the event type used by this filter |
|
104 |
*/ |
|
105 |
inline TUid EventType() |
|
106 |
{ |
|
107 |
return iLogFilter->EventType() ; |
|
108 |
} |
|
109 |
||
110 |
/** |
|
111 |
* Sets the event type to be used by this filter |
|
112 |
* |
|
113 |
* @param aEventType, event type to be set |
|
114 |
*/ |
|
115 |
||
116 |
inline void SetEventType(TUid aEventType) |
|
117 |
{ |
|
118 |
iLogFilter->SetEventType(aEventType) ; |
|
119 |
} |
|
120 |
||
121 |
/** |
|
122 |
* Gets the Remot party used by the filter |
|
123 |
*/ |
|
124 |
||
125 |
inline const TDesC& RemoteParty() |
|
126 |
{ |
|
127 |
return iLogFilter->RemoteParty() ; |
|
128 |
} |
|
129 |
||
130 |
/** |
|
131 |
* Sets the remot party used by this filter |
|
132 |
* |
|
133 |
* @param TDesC aRemotParty, Remot party description |
|
134 |
*/ |
|
135 |
||
136 |
inline void SetRemoteParty(const TDesC &aRemoteParty) |
|
137 |
{ |
|
138 |
iLogFilter->SetRemoteParty(aRemoteParty) ; |
|
139 |
} |
|
140 |
||
141 |
/** |
|
142 |
* Direction, Get the direction of this filter |
|
143 |
* INCOMING , OUTGOING |
|
144 |
*/ |
|
145 |
||
146 |
inline const TDesC& Direction() |
|
147 |
{ |
|
148 |
return iLogFilter->Direction() ; |
|
149 |
} |
|
150 |
||
151 |
/** |
|
152 |
* Sets the direction of the filter |
|
153 |
* |
|
154 |
* @param aDirection , direction of the filter |
|
155 |
*/ |
|
156 |
||
157 |
IMPORT_C void SetDirection(TInt aDirection) ; |
|
158 |
||
159 |
/** |
|
160 |
* DurationType Gets the log duration used by the filter |
|
161 |
*/ |
|
162 |
||
163 |
inline TLogDurationType DurationType() |
|
164 |
{ |
|
165 |
return iLogFilter->DurationType() ; |
|
166 |
} |
|
167 |
||
168 |
/** |
|
169 |
* SetDurationType, sets the duration type used by this filter |
|
170 |
* |
|
171 |
* @param aDurationType, duration type to be set |
|
172 |
*/ |
|
173 |
||
174 |
inline void SetDurationType(TLogDurationType aDurationType) |
|
175 |
{ |
|
176 |
iLogFilter->SetDurationType(aDurationType) ; |
|
177 |
} |
|
178 |
||
179 |
/** |
|
180 |
* Status, gets the Delivery status used by this filter |
|
181 |
*/ |
|
182 |
||
183 |
inline const TDesC &Status() |
|
184 |
{ |
|
185 |
return iLogFilter->Status() ; |
|
186 |
} |
|
187 |
||
188 |
/** |
|
189 |
* SetStatus, sets the Delivery status used by this filter |
|
190 |
* |
|
191 |
* @param aStatus, status to be set for this filter |
|
192 |
*/ |
|
193 |
||
194 |
IMPORT_C void SetStatus(TInt aStatus) ; |
|
195 |
||
196 |
||
197 |
/** |
|
198 |
* SetRequestType, set the request type (GetEvent or GetList) |
|
199 |
* |
|
200 |
* @param aTaskId, Task Id for this filter |
|
201 |
*/ |
|
202 |
||
203 |
inline void SetRequestType(TInt aTaskId) |
|
204 |
{ |
|
205 |
iTaskId = aTaskId ; |
|
206 |
} |
|
207 |
||
208 |
/** |
|
209 |
* GetRequestType, gets the request type of |
|
210 |
*/ |
|
211 |
||
212 |
inline TInt GetRequestType(void) |
|
213 |
{ |
|
214 |
return iTaskId ; |
|
215 |
} |
|
216 |
||
217 |
/** |
|
218 |
* GetEvent, gets the request type of |
|
219 |
*/ |
|
220 |
||
221 |
inline CLogsEvent* GetEvent(void) |
|
222 |
{ |
|
223 |
return iEvent ; |
|
224 |
} |
|
225 |
||
226 |
/** |
|
227 |
* SetEvent, Sets the event for the filer |
|
228 |
* |
|
229 |
* @param aEvent , event to be set |
|
230 |
*/ |
|
231 |
||
232 |
IMPORT_C void SetEventL(CLogsEvent *aEvent) ; |
|
233 |
||
234 |
||
235 |
/** |
|
236 |
* GetRecentList , gets the recent list |
|
237 |
*/ |
|
238 |
||
239 |
inline TLogRecentList GetRecentList(void) |
|
240 |
{ |
|
241 |
return iRecentList; |
|
242 |
} |
|
243 |
||
244 |
/** |
|
245 |
* SetRecentList, sets the recent List for recent view |
|
246 |
* |
|
247 |
* @param aRecentList, recent list to be set for recent view |
|
248 |
*/ |
|
249 |
||
250 |
inline void SetRecentList(TLogRecentList aRecentList) |
|
251 |
{ |
|
252 |
iRecentList = aRecentList; |
|
253 |
} |
|
254 |
||
255 |
/** |
|
256 |
* SetNumber, sets the number view filter |
|
257 |
* |
|
258 |
* @param aNumber, number to be set |
|
259 |
*/ |
|
260 |
||
261 |
inline void SetNumber (const TDesC& aNumber) |
|
262 |
{ |
|
263 |
iLogFilter->SetNumber(aNumber) ; |
|
264 |
} |
|
265 |
||
266 |
/** |
|
267 |
* get the number used by the filter |
|
268 |
*/ |
|
269 |
||
270 |
inline const TDesC& Number() |
|
271 |
{ |
|
272 |
return iLogFilter->Number() ; |
|
273 |
} |
|
26
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
274 |
|
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
275 |
/** |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
276 |
* Set StartTime for the event filter |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
277 |
* |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
278 |
* @param aStartTime, StartTime to be set |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
279 |
*/ |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
280 |
|
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
281 |
inline void SetStartTime(const TTime& aStartTime) |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
282 |
{ |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
283 |
iLogFilter->SetStartTime(aStartTime) ; |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
284 |
} |
5 | 285 |
|
286 |
/** |
|
287 |
* Set EndTime for the event filter |
|
288 |
* |
|
289 |
* @param aEndTime, EndTime to be set |
|
290 |
*/ |
|
291 |
||
292 |
inline void SetEndTime(const TTime& aEndTime) |
|
293 |
{ |
|
294 |
iLogFilter->SetEndTime(aEndTime) ; |
|
295 |
} |
|
296 |
||
297 |
/** |
|
298 |
* get function |
|
299 |
*/ |
|
300 |
||
301 |
TTime getTime() const |
|
302 |
{ |
|
303 |
return iLogFilter->EndTime(); |
|
304 |
} |
|
305 |
||
306 |
/** |
|
307 |
* Set the contact id |
|
308 |
* |
|
309 |
* @param aContactId , contact id to be set |
|
310 |
*/ |
|
311 |
||
312 |
inline void SetContact(TContactItemId aId) |
|
313 |
{ |
|
314 |
iLogFilter->SetContact(aId) ; |
|
315 |
} |
|
316 |
||
317 |
/** |
|
318 |
* get the contact id |
|
319 |
*/ |
|
320 |
||
321 |
TContactItemId getContact() const |
|
322 |
{ |
|
323 |
return iLogFilter->Contact(); |
|
324 |
} |
|
325 |
||
326 |
/** |
|
327 |
* Gets the flag associated with the event |
|
328 |
*/ |
|
329 |
||
330 |
inline TLogFlags Flags() |
|
331 |
{ |
|
332 |
return iLogFilter->Flags() ; |
|
333 |
} |
|
334 |
||
335 |
/** |
|
336 |
* Gets the flags associated with the event |
|
337 |
* @param aFlags , flags to be set |
|
338 |
*/ |
|
339 |
||
340 |
inline void SetFlags(TLogFlags aFlags) |
|
341 |
{ |
|
342 |
iLogFilter->SetFlags(aFlags) ; |
|
343 |
} |
|
344 |
||
345 |
/** |
|
346 |
* Default Destructor |
|
347 |
*/ |
|
348 |
||
349 |
~CLogsFilter() ; |
|
350 |
||
351 |
||
352 |
protected : |
|
353 |
||
354 |
/** |
|
355 |
* Default consturctor |
|
356 |
*/ |
|
357 |
||
358 |
CLogsFilter() ; |
|
359 |
||
360 |
/** |
|
361 |
* ConstructL: Function to consturct members of Filter class |
|
362 |
*/ |
|
363 |
||
364 |
void ConstructL() ; |
|
365 |
||
366 |
private : |
|
367 |
||
368 |
CLogFilter *iLogFilter ; |
|
369 |
// CLogViewRecent *iRecentList ; |
|
370 |
TLogRecentList iRecentList; |
|
371 |
CLogsEvent* iEvent ; |
|
372 |
/** |
|
373 |
* To fetch direction strings and status strings |
|
374 |
*/ |
|
375 |
CLogClient* iLogClient ; |
|
376 |
RFs iFs ; |
|
377 |
TInt iTaskId ; |
|
378 |
||
379 |
} ; |
|
380 |
||
381 |
#endif |