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 wrapper over Clogevent.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef SAPIEVENT_H
|
|
19 |
#define SAPIEVENT_H
|
|
20 |
|
|
21 |
#include <logwrap.h>
|
|
22 |
#include <CNTDEF.H>
|
|
23 |
|
|
24 |
/**
|
|
25 |
* CLogsEvent:this is a wrapper class for the symbian CLogEvent class.
|
|
26 |
*/
|
|
27 |
|
|
28 |
class CLogsEvent : public CBase
|
|
29 |
{
|
|
30 |
public :
|
|
31 |
|
|
32 |
/**
|
|
33 |
* NewL: Two phased construction
|
|
34 |
*/
|
|
35 |
|
|
36 |
IMPORT_C static CLogsEvent *NewL() ;
|
|
37 |
|
|
38 |
/**
|
|
39 |
* NewLC: Creates an instance of CLogSyncServiceClass
|
|
40 |
* Two Phased constructor
|
|
41 |
* returns newly allocated object.
|
|
42 |
*/
|
|
43 |
|
|
44 |
static CLogsEvent* NewLC() ;
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Default Destructor
|
|
48 |
*/
|
|
49 |
|
|
50 |
~CLogsEvent() ;
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Sets unique id to identify event type.
|
|
54 |
*/
|
|
55 |
|
|
56 |
inline void SetEventType(TUid aEventTypeId)
|
|
57 |
{
|
|
58 |
iLogEvent->SetEventType(aEventTypeId);
|
|
59 |
}
|
|
60 |
|
|
61 |
/**
|
|
62 |
* Sets the duration of the event.
|
|
63 |
*/
|
|
64 |
|
|
65 |
inline void SetDuration(TLogDuration aDuration)
|
|
66 |
{
|
|
67 |
iLogEvent->SetDuration(aDuration);
|
|
68 |
}
|
|
69 |
|
|
70 |
/**
|
|
71 |
* Sets the durationType of the event.
|
|
72 |
*/
|
|
73 |
|
|
74 |
inline void SetDurationType(TLogDurationType aDurationType)
|
|
75 |
{
|
|
76 |
iLogEvent->SetDurationType( aDurationType );
|
|
77 |
}
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Sets the subject of the event.
|
|
81 |
*/
|
|
82 |
|
|
83 |
inline void SetSubject(const TDesC &aSubject)
|
|
84 |
{
|
|
85 |
iLogEvent->SetSubject(aSubject);
|
|
86 |
}
|
|
87 |
|
|
88 |
/**
|
|
89 |
* Sets the time of the event.
|
|
90 |
*/
|
|
91 |
|
|
92 |
inline void SetTime(const TTime &aTime)
|
|
93 |
{
|
|
94 |
iLogEvent->SetTime(aTime);
|
|
95 |
}
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Sets the number associated with the event..
|
|
99 |
*/
|
|
100 |
|
|
101 |
inline void SetNumber(const TDesC &aNumber)
|
|
102 |
{
|
|
103 |
iLogEvent->SetNumber(aNumber);
|
|
104 |
}
|
|
105 |
|
|
106 |
/**
|
|
107 |
* Sets the remote party associated with the event.
|
|
108 |
*/
|
|
109 |
|
|
110 |
inline void SetRemoteParty(const TDesC &aRemote)
|
|
111 |
{
|
|
112 |
iLogEvent->SetRemoteParty(aRemote);
|
|
113 |
}
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Sets the Direction of the .event
|
|
117 |
*/
|
|
118 |
|
|
119 |
IMPORT_C void SetDirection(TInt aDirection) ;
|
|
120 |
|
|
121 |
|
|
122 |
/**
|
|
123 |
* Sets the contact id.
|
|
124 |
*/
|
|
125 |
|
|
126 |
inline void SetContact(TContactItemId aContact)
|
|
127 |
{
|
|
128 |
iLogEvent->SetContact(aContact);
|
|
129 |
}
|
|
130 |
|
|
131 |
/**
|
|
132 |
* Sets description of event type
|
|
133 |
*/
|
|
134 |
|
|
135 |
inline void SetDescription(const TDesC &aDescription)
|
|
136 |
{
|
|
137 |
iLogEvent->SetDescription(aDescription);
|
|
138 |
}
|
|
139 |
|
|
140 |
/**
|
|
141 |
* Sets data of event type
|
|
142 |
*/
|
|
143 |
inline void SetDataL(const TDesC8 &aData)
|
|
144 |
{
|
|
145 |
iLogEvent->SetDataL(aData);
|
|
146 |
}
|
|
147 |
|
|
148 |
/**
|
|
149 |
* Sets link value
|
|
150 |
*/
|
|
151 |
|
|
152 |
inline void SetLink(TLogLink aLink)
|
|
153 |
{
|
|
154 |
iLogEvent->SetLink(aLink);
|
|
155 |
}
|
|
156 |
|
|
157 |
/**
|
|
158 |
* Sets status of event
|
|
159 |
*/
|
|
160 |
|
|
161 |
IMPORT_C void SetStatus(TInt aStatus) ;
|
|
162 |
|
|
163 |
|
|
164 |
/**
|
|
165 |
* Sets unique id to identify event type.
|
|
166 |
* @param aEvent, event details to be copied
|
|
167 |
*/
|
|
168 |
|
|
169 |
inline void SetEvent(const CLogEvent& aEvent)
|
|
170 |
{
|
|
171 |
iLogEvent->CopyL(aEvent) ;
|
|
172 |
}
|
|
173 |
|
|
174 |
/**
|
|
175 |
* get logid
|
|
176 |
*/
|
|
177 |
|
|
178 |
inline TLogId Id()
|
|
179 |
{
|
|
180 |
return iLogEvent->Id() ;
|
|
181 |
}
|
|
182 |
|
|
183 |
/**
|
|
184 |
* copy function
|
|
185 |
*/
|
|
186 |
|
|
187 |
inline void Copy(CLogEvent* aEvent)
|
|
188 |
{
|
|
189 |
iLogEvent->CopyL(*aEvent);
|
|
190 |
}
|
|
191 |
|
|
192 |
/**
|
|
193 |
* gets eventtype
|
|
194 |
*/
|
|
195 |
|
|
196 |
TUid getEventType() const
|
|
197 |
{
|
|
198 |
return iLogEvent->EventType();
|
|
199 |
}
|
|
200 |
|
|
201 |
/**
|
|
202 |
* gets eventduration
|
|
203 |
*/
|
|
204 |
|
|
205 |
TLogDuration getDuration() const
|
|
206 |
{
|
|
207 |
return iLogEvent->Duration();
|
|
208 |
}
|
|
209 |
|
|
210 |
/**
|
|
211 |
* gets subject
|
|
212 |
*/
|
|
213 |
|
|
214 |
const TDesC& getSubject() const
|
|
215 |
{
|
|
216 |
return iLogEvent->Subject() ;
|
|
217 |
}
|
|
218 |
|
|
219 |
/**
|
|
220 |
* gets time
|
|
221 |
*/
|
|
222 |
|
|
223 |
TTime getTime() const
|
|
224 |
{
|
|
225 |
return iLogEvent->Time();
|
|
226 |
}
|
|
227 |
|
|
228 |
/**
|
|
229 |
* gets number
|
|
230 |
*/
|
|
231 |
|
|
232 |
const TDesC& getNumber() const
|
|
233 |
{
|
|
234 |
return iLogEvent->Number();
|
|
235 |
}
|
|
236 |
|
|
237 |
/**
|
|
238 |
* gets remoteparty
|
|
239 |
*/
|
|
240 |
|
|
241 |
const TDesC& getRemoteParty() const
|
|
242 |
{
|
|
243 |
return iLogEvent->RemoteParty();
|
|
244 |
}
|
|
245 |
|
|
246 |
/**
|
|
247 |
* gets direction
|
|
248 |
*/
|
|
249 |
|
|
250 |
const TDesC& getDirection() const
|
|
251 |
{
|
|
252 |
return iLogEvent->Direction();
|
|
253 |
}
|
|
254 |
|
|
255 |
/**
|
|
256 |
* gets contactid
|
|
257 |
*/
|
|
258 |
|
|
259 |
TContactItemId getContact() const
|
|
260 |
{
|
|
261 |
return iLogEvent->Contact();
|
|
262 |
}
|
|
263 |
|
|
264 |
/**
|
|
265 |
* gets description
|
|
266 |
*/
|
|
267 |
|
|
268 |
const TDesC& getDescription() const
|
|
269 |
{
|
|
270 |
return iLogEvent->Description();
|
|
271 |
}
|
|
272 |
|
|
273 |
/**
|
|
274 |
* gets data
|
|
275 |
*/
|
|
276 |
|
|
277 |
|
|
278 |
const TDesC8& getDataL() const
|
|
279 |
{
|
|
280 |
return iLogEvent->Data();
|
|
281 |
}
|
|
282 |
|
|
283 |
/**
|
|
284 |
* gets linkvalue
|
|
285 |
*/
|
|
286 |
|
|
287 |
|
|
288 |
TLogLink getLink() const
|
|
289 |
{
|
|
290 |
return iLogEvent->Link();
|
|
291 |
}
|
|
292 |
|
|
293 |
/**
|
|
294 |
* gets status
|
|
295 |
*/
|
|
296 |
|
|
297 |
const TDesC& getStatus() const
|
|
298 |
{
|
|
299 |
return iLogEvent->Status();
|
|
300 |
}
|
|
301 |
|
|
302 |
/**
|
|
303 |
* getEvents: Gets the event .
|
|
304 |
*/
|
|
305 |
|
|
306 |
inline CLogEvent* getEvent()
|
|
307 |
{
|
|
308 |
return iLogEvent ;
|
|
309 |
}
|
|
310 |
|
|
311 |
/**
|
|
312 |
* setid function
|
|
313 |
*/
|
|
314 |
|
|
315 |
inline void SetId(TLogId aId)
|
|
316 |
{
|
|
317 |
iLogEvent->SetId(aId);
|
|
318 |
}
|
|
319 |
|
|
320 |
/**
|
|
321 |
* Gets the flag associated with the event
|
|
322 |
*/
|
|
323 |
|
|
324 |
inline TLogFlags Flags()
|
|
325 |
{
|
|
326 |
return iLogEvent->Flags() ;
|
|
327 |
}
|
|
328 |
|
|
329 |
/**
|
|
330 |
* Gets the flags associated with the event
|
|
331 |
* @param aFlags , flags to be set
|
|
332 |
*/
|
|
333 |
|
|
334 |
inline void SetFlags(TLogFlags aFlags)
|
|
335 |
{
|
|
336 |
iLogEvent->SetFlags(aFlags) ;
|
|
337 |
}
|
|
338 |
|
|
339 |
protected:
|
|
340 |
|
|
341 |
/**
|
|
342 |
* ConstructL(): Internal method to construct members
|
|
343 |
*/
|
|
344 |
|
|
345 |
void ConstructL() ;
|
|
346 |
|
|
347 |
/**
|
|
348 |
* Default constructor
|
|
349 |
*/
|
|
350 |
|
|
351 |
CLogsEvent() ;
|
|
352 |
|
|
353 |
private:
|
|
354 |
|
|
355 |
/**
|
|
356 |
* contains the details of an event
|
|
357 |
*/
|
|
358 |
|
|
359 |
CLogEvent* iLogEvent;
|
|
360 |
|
|
361 |
/**
|
|
362 |
* Required for the Setting Direction and the status for
|
|
363 |
* the event
|
|
364 |
*/
|
|
365 |
|
|
366 |
RFs iFs ;
|
|
367 |
CLogClient *iLogClient ;
|
|
368 |
|
|
369 |
};
|
|
370 |
|
|
371 |
|
|
372 |
#endif |