|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <e32svr.h> |
|
19 #include <e32std.h> |
|
20 #include <StifParser.h> |
|
21 #include <Stiftestinterface.h> |
|
22 #include <logcli.h> |
|
23 #include <logwrap.h> |
|
24 |
|
25 #include "loggingasyncservice.h" |
|
26 #include "loggingservice.h" |
|
27 #include "loggingfilter.h" |
|
28 |
|
29 #include "tlogging.h" |
|
30 #include "tlogcallback.h" |
|
31 #include "loggingevent.h" |
|
32 |
|
33 //------------------------------------------------------------ |
|
34 // Get an event details on the eventid |
|
35 //------------------------------------------------------------- |
|
36 |
|
37 TInt getEvent2(void) |
|
38 { |
|
39 _LIT(KOwnEventSubject, "RandomLogEvent"); |
|
40 _LIT(KOwnEventRemoteParty, "OwnContact"); |
|
41 CLoggingService *LogService = CLoggingService :: NewL() ; |
|
42 CLogsFilter *filter = CLogsFilter :: NewL() ; |
|
43 |
|
44 |
|
45 filter->SetRequestType(EGetEvent) ; |
|
46 |
|
47 CLogsEvent* event = CLogsEvent::NewL(); |
|
48 |
|
49 // Sets the duration of the event in seconds. |
|
50 // Randomize something between 0-299 |
|
51 |
|
52 event->SetDuration(301); |
|
53 |
|
54 TBuf<KLogMaxDirectionLength> direction; |
|
55 |
|
56 // Direction of the event is randomized |
|
57 |
|
58 TInt dirID = R_LOG_DIR_IN; |
|
59 TUid eventTypeID = KLogCallEventTypeUid; |
|
60 event->SetEventType(eventTypeID); |
|
61 event->SetSubject(KOwnEventSubject); |
|
62 TTime time; // creation time from the device clock |
|
63 time.HomeTime(); |
|
64 event->SetTime(time); |
|
65 |
|
66 TBuf<KLogMaxNumberLength> number; // Randomize number |
|
67 number.AppendNum(7000008); |
|
68 event->SetNumber(number); |
|
69 event->SetRemoteParty(KOwnEventRemoteParty); |
|
70 TLogId id= LogService->AddEventL(event) ; |
|
71 |
|
72 CLogsEvent *updatedEvent = CLogsEvent :: NewL() ; |
|
73 updatedEvent->SetId(id) ; |
|
74 |
|
75 filter->SetEventL(updatedEvent) ; |
|
76 |
|
77 MLogCallback Mycb ; |
|
78 TInt ret = LogService->GetListL(1 ,filter , &Mycb) ; |
|
79 Mycb.Start() ; |
|
80 |
|
81 delete filter ; |
|
82 delete updatedEvent ; |
|
83 delete event ; |
|
84 delete LogService ; |
|
85 return ret ; |
|
86 } |