|
1 /* |
|
2 * Copyright (c) 2006 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: Location Triggering Management's Lbt adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CLBTMGMTLBTADAPTER_H_ |
|
19 #define CLBTMGMTLBTADAPTER_H_ |
|
20 |
|
21 // System Includes |
|
22 #include <e32base.h> |
|
23 #include <lbtserver.h> |
|
24 #include <lbtmanager.h> |
|
25 #include <lbt.h> |
|
26 #include <lbttriggerchangeeventobserver.h> |
|
27 |
|
28 // User Includes |
|
29 |
|
30 // Forward Declarations |
|
31 class MLbtMgmtAdapterObserver; |
|
32 class CLbtTriggerChangeEventNotifier; |
|
33 |
|
34 // Constant Declarations |
|
35 |
|
36 // Class Definition |
|
37 |
|
38 /** |
|
39 * Adapter to the Lbt operations |
|
40 */ |
|
41 class CLbtMgmtLbtAdapter : public CActive, |
|
42 public MLbtTriggerChangeEventObserver |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * Enumeration for Trigger Status Values |
|
47 */ |
|
48 enum TTriggeringStatus |
|
49 { |
|
50 /** |
|
51 * Enumeration to display Trigger Status Value as On |
|
52 */ |
|
53 EOn = 0x00000000, |
|
54 |
|
55 /** |
|
56 * Enumeration to display Trigger Status Value as Off |
|
57 */ |
|
58 EOff |
|
59 }; |
|
60 public: |
|
61 /** |
|
62 * Creates new Lbt adapter |
|
63 * |
|
64 * @param aAdapterObsrv Observer to the Lbt adapter |
|
65 * @return CLbtMgmtLbtAdapter& Reference to the adapter |
|
66 */ |
|
67 static CLbtMgmtLbtAdapter* NewL( |
|
68 MLbtMgmtAdapterObserver& aAdapterObsrv ); |
|
69 |
|
70 |
|
71 /** |
|
72 * Creates new Lbt adapter |
|
73 * Leaves the object on the Clean up stack |
|
74 * |
|
75 * @param aAdapterObsrv Observer to the Lbt adapter |
|
76 * @return CLbtMgmtLbtAdapter& Reference to the adapter |
|
77 */ |
|
78 static CLbtMgmtLbtAdapter* NewLC( |
|
79 MLbtMgmtAdapterObserver& aAdapterObsrv ); |
|
80 |
|
81 |
|
82 /** |
|
83 * Destructor |
|
84 */ |
|
85 ~CLbtMgmtLbtAdapter (); |
|
86 |
|
87 /** |
|
88 * Returns the Location Trigger Status settings value. |
|
89 * |
|
90 * @return TTriggeringStatus - Current Trigger Status. |
|
91 */ |
|
92 CLbtMgmtLbtAdapter::TTriggeringStatus GetCurrentTriggeringStatusL(); |
|
93 |
|
94 /** |
|
95 * Sets the value of Location Trigger Status settings value. |
|
96 * |
|
97 * @param aTiggerStatus - Trigger Status Value. |
|
98 */ |
|
99 void SetCurrentTriggeringStatusL( CLbtMgmtLbtAdapter::TTriggeringStatus aTiggerStatus ); |
|
100 |
|
101 /** |
|
102 * Toggle the value of Location Trigger Status settings value. |
|
103 * |
|
104 */ |
|
105 void ToggleTiggerStatusL(); |
|
106 |
|
107 /** |
|
108 * Deletes all active triggers |
|
109 */ |
|
110 void DeleteActiveTriggersL(); |
|
111 |
|
112 /** |
|
113 * Return the total active triggers from Location Triggering Server. |
|
114 * |
|
115 * @return TInt - Total active triggers. |
|
116 */ |
|
117 TInt ActiveTriggers(); |
|
118 |
|
119 /* |
|
120 * Derived from MLbtTriggerChangeEventObserver |
|
121 */ |
|
122 void TriggerChangedL(const TLbtTriggerChangeEvent &aEvent); |
|
123 |
|
124 |
|
125 protected: |
|
126 /** |
|
127 * Inherited from CActive |
|
128 */ |
|
129 void RunL(); |
|
130 |
|
131 /** |
|
132 * Inherited from CActive |
|
133 */ |
|
134 void DoCancel(); |
|
135 |
|
136 private: |
|
137 |
|
138 /** |
|
139 * Gets the total active triggers from Location Triggering Server. |
|
140 */ |
|
141 void GetTotalActiveTriggersL(); |
|
142 |
|
143 /** |
|
144 * Constructor |
|
145 */ |
|
146 CLbtMgmtLbtAdapter( MLbtMgmtAdapterObserver& aAdapterObsrv ); |
|
147 |
|
148 /** |
|
149 * Second Phase Constructor |
|
150 */ |
|
151 void ConstructL(); |
|
152 |
|
153 /** |
|
154 * Start Notification |
|
155 */ |
|
156 void StartNotification(); |
|
157 |
|
158 private: |
|
159 |
|
160 /** |
|
161 * Reference to the Adapter observer |
|
162 */ |
|
163 MLbtMgmtAdapterObserver& iObserver; |
|
164 |
|
165 /** |
|
166 * Reference to the Lbt Server |
|
167 * |
|
168 */ |
|
169 RLbtServer iLbtServ; |
|
170 |
|
171 /** |
|
172 * Reference to the Lbt Manager Session |
|
173 * |
|
174 */ |
|
175 RLbtManager iLbtMgr; |
|
176 |
|
177 /** |
|
178 * Reference to the Lbt Manager Session |
|
179 * |
|
180 */ |
|
181 RLbtManager iLbtMgrObserver; |
|
182 |
|
183 /** |
|
184 * Reference to the Lbt Manager Session |
|
185 * |
|
186 */ |
|
187 CLbtTriggerChangeEventNotifier * iEventChangeObserver; |
|
188 |
|
189 /** |
|
190 * Triggering System structure |
|
191 * |
|
192 */ |
|
193 TLbtTriggeringSystemManagementSettings iTriggerSettings; |
|
194 |
|
195 /** |
|
196 * Total Active Triggers |
|
197 * |
|
198 */ |
|
199 TInt iTotalActiveTriggers; |
|
200 }; |
|
201 |
|
202 #endif // CLBTMGMTLBTADAPTER_H_ |
|
203 |