|
1 /* |
|
2 * Copyright (c) 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 "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: Active Object operation for deletiong session triggers. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "lbtglobal.h" |
|
21 #include "lbtdeletesessiontriggers.h" |
|
22 #include "lbtcontainer.h" |
|
23 #include "lbtnotificationmap.h" |
|
24 #include "lbttriggerchangeevent.h" |
|
25 #include "lbtcontainerupdatefilter.h" |
|
26 #include "lbtserverconsts.h" |
|
27 #include "lbtdeletesessiontriggerobserver.h" |
|
28 #include "lbtlogger.h" |
|
29 |
|
30 // ===================== MEMBER FUNCTIONS ===================== |
|
31 |
|
32 // --------------------------------------------------------------------------- |
|
33 // CLbtDeleteSessionTriggers::NewLC |
|
34 // Symbian Two - phase constructor |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 CLbtDeleteSessionTriggers* CLbtDeleteSessionTriggers::NewL(MLbtDeleteSessionTriggerObserver& aObserver, |
|
38 CLbtContainer& aContainer,CLbtNotificationMap& aNotificationMap) |
|
39 { |
|
40 FUNC_ENTER("CLbtDeleteSessionTriggers::NewL"); |
|
41 CLbtDeleteSessionTriggers* deleteSessionTriggers=new( ELeave ) CLbtDeleteSessionTriggers(aObserver,aContainer,aNotificationMap); |
|
42 CleanupStack::PushL(deleteSessionTriggers); |
|
43 deleteSessionTriggers->ConstructL(); |
|
44 CleanupStack::Pop(deleteSessionTriggers); |
|
45 return(deleteSessionTriggers); |
|
46 } |
|
47 |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // CLbtDeleteSessionTriggers::CLbtDeleteSessionTriggers |
|
51 // C++ Default constructor |
|
52 // --------------------------------------------------------------------------- |
|
53 // |
|
54 CLbtDeleteSessionTriggers::CLbtDeleteSessionTriggers(MLbtDeleteSessionTriggerObserver& aObserver,CLbtContainer& aContainer, |
|
55 CLbtNotificationMap& aNotificationMap):CActive( EPriorityStandard ),iObserver(aObserver), |
|
56 iContainer(aContainer),iNotificationMap(aNotificationMap) |
|
57 { |
|
58 FUNC_ENTER("CLbtDeleteSessionTriggers::CLbtDeleteSessionTriggers"); |
|
59 CActiveScheduler::Add(this); |
|
60 } |
|
61 |
|
62 // --------------------------------------------------------------------------- |
|
63 // CLbtDeleteSessionTriggers::ConstructL |
|
64 // --------------------------------------------------------------------------- |
|
65 // |
|
66 void CLbtDeleteSessionTriggers::ConstructL() |
|
67 { |
|
68 |
|
69 } |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // CLbtDeleteSessionTriggers::~CLbtDeleteSessionTriggers |
|
73 // Destructor |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 CLbtDeleteSessionTriggers::~CLbtDeleteSessionTriggers() |
|
77 { |
|
78 FUNC_ENTER("CLbtDeleteSessionTriggers::~CLbtDeleteSessionTriggers"); |
|
79 Cancel(); |
|
80 } |
|
81 |
|
82 |
|
83 // --------------------------------------------------------------------------- |
|
84 // CLbtDeleteSessionTriggers::DoCancel |
|
85 // --------------------------------------------------------------------------- |
|
86 // |
|
87 void CLbtDeleteSessionTriggers::DoCancel() |
|
88 { |
|
89 FUNC_ENTER("CLbtDeleteSessionTriggers::DoCancel"); |
|
90 iContainer.CancelAsyncOperation(iAOIdentificationNum); |
|
91 } |
|
92 |
|
93 |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // CLbtDeleteSessionTriggers::DeleteSessionTriggers |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 void CLbtDeleteSessionTriggers::DeleteSessionTriggers(CLbtContainerUpdateFilter* aContainerFilter) |
|
100 { |
|
101 FUNC_ENTER("CLbtDeleteSessionTriggers::DeleteSessionTriggers"); |
|
102 iContainer.DeleteTriggers(aContainerFilter,iAOIdentificationNum,iStatus); |
|
103 SetActive(); |
|
104 } |
|
105 |
|
106 |
|
107 // --------------------------------------------------------------------------- |
|
108 // CLbtDeleteSessionTriggers::RunL |
|
109 // --------------------------------------------------------------------------- |
|
110 // |
|
111 void CLbtDeleteSessionTriggers::RunL() |
|
112 { |
|
113 FUNC_ENTER("CLbtDeleteSessionTriggers::RunL"); |
|
114 // If there are no triggers to be deleted,DeleteTriggers method will return error code |
|
115 // other than KErrNone in which case management library should not be notified. |
|
116 |
|
117 if(iStatus.Int()==KErrNone) |
|
118 { |
|
119 RMessage2 message; |
|
120 TInt retValue=iNotificationMap.Retreive(message,ELbtNotifyTriggerChangeEvent, |
|
121 CLbtServerLogicBase::TLbtManagementLibrary); |
|
122 |
|
123 if(retValue==KErrNone) |
|
124 { |
|
125 TLbtTriggerChangeEvent event; |
|
126 event.iEventType = ELbtTriggerChangeEventMultiple; |
|
127 |
|
128 //Send notification to management library |
|
129 TPckg<TLbtTriggerChangeEvent> eventChange(event); |
|
130 if(LbtGlobal::Write(message,KParamChangeEvent,eventChange)==KErrNone) |
|
131 { |
|
132 LbtGlobal::RequestComplete(message,KErrNone); |
|
133 } |
|
134 } |
|
135 } |
|
136 iObserver.HandleDeleteSessionTriggersClosureL(this); |
|
137 } |
|
138 |
|
139 // end of file |
|
140 |