|
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 "loggingevent.h" |
|
28 |
|
29 #include "tlogging.h" |
|
30 #include "tlogcallback.h" |
|
31 |
|
32 _LIT(KOwnEventSubject, "RandomLogEvent"); |
|
33 _LIT(KOwnEventRemoteParty, "OwnContact"); |
|
34 |
|
35 |
|
36 TInt DeleteEventasync(void) |
|
37 { |
|
38 |
|
39 |
|
40 CLoggingService *LogService = CLoggingService :: NewL() ; |
|
41 |
|
42 CLogsEvent* event = CLogsEvent::NewL(); |
|
43 MLogCallback MyCb ; |
|
44 |
|
45 // Sets the duration of the event in seconds. |
|
46 // Randomize something between 0-299 |
|
47 |
|
48 event->SetDuration(300); |
|
49 |
|
50 TBuf<KLogMaxDirectionLength> direction; |
|
51 |
|
52 // Direction of the event is randomized |
|
53 |
|
54 TInt dirID = R_LOG_DIR_IN; |
|
55 TUid eventTypeID = KLogCallEventTypeUid; |
|
56 event->SetEventType(eventTypeID); |
|
57 event->SetSubject(KOwnEventSubject); |
|
58 TTime time; // creation time from the device clock |
|
59 time.HomeTime(); |
|
60 event->SetTime(time); |
|
61 |
|
62 TBuf<KLogMaxNumberLength> number; // Randomize number |
|
63 number.AppendNum(7000000); |
|
64 event->SetNumber(number); |
|
65 event->SetRemoteParty(KOwnEventRemoteParty); |
|
66 |
|
67 TLogId ret=LogService->AddEventL(event) ; |
|
68 |
|
69 LogService->DeleteEventL(2 , ret ,&MyCb); |
|
70 |
|
71 MyCb.Start() ; |
|
72 |
|
73 CLogsEvent *DeletedEvent = CLogsEvent :: NewL() ; |
|
74 |
|
75 DeletedEvent->SetId(ret) ; |
|
76 |
|
77 // ret = LogService->GetEventL(3,DeletedEvent,&MyCb); |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 TInt count = 0 ; |
|
84 delete DeletedEvent; |
|
85 delete event ; |
|
86 delete LogService ; |
|
87 |
|
88 return KErrNone ; |
|
89 |
|
90 } |