|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 @test |
|
20 */ |
|
21 |
|
22 #ifndef LBSNETSIMTEST_H |
|
23 #define LBSNETSIMTEST_H |
|
24 |
|
25 class MLbsNetSimTestObserver; |
|
26 |
|
27 #include <lbs/lbsassistancereferencelocation.h> |
|
28 #include <lbs/lbsnetcommon.h> |
|
29 #include <lbs/lbsnetprotocolbase.h> |
|
30 #include <lbspositioninfo.h> |
|
31 #include <lbs/lbslocdatasourcegpsbase.h> |
|
32 |
|
33 #include <s32mem.h> |
|
34 |
|
35 /** |
|
36 */ |
|
37 class RLbsNetSimTest : public RSessionBase |
|
38 { |
|
39 public: |
|
40 // Error message specific to pretending the network is not available |
|
41 static const TInt KNetSimNetworkNotAvailable = 10071; |
|
42 |
|
43 // Constructor |
|
44 IMPORT_C RLbsNetSimTest(); |
|
45 IMPORT_C ~RLbsNetSimTest(); |
|
46 |
|
47 // Server methods |
|
48 IMPORT_C TInt ConnectL(MLbsNetSimTestObserver* aObserver); |
|
49 IMPORT_C void Close(); |
|
50 |
|
51 // Methods |
|
52 IMPORT_C TBool SetReferenceLocation(TPosition& aLocation); |
|
53 IMPORT_C TBool SetReferenceLocation(TDesC8& aLocation); |
|
54 IMPORT_C TBool SetResponseTime(TInt32 aTime, TBool aSticky); |
|
55 IMPORT_C TBool SetResponseError(TInt32 aError, TBool aSticky); |
|
56 IMPORT_C TBool SetDefaultAssitanceDataFilter(TLbsAssistanceDataGroup& aFilter); |
|
57 IMPORT_C TBool SetMoreAssitanceDataFilter(TLbsAssistanceDataGroup& aFilter); |
|
58 IMPORT_C TBool ClearAssistanceDataFilters(); |
|
59 IMPORT_C TBool SetAssistanceDataProvider(TUid aProvider); |
|
60 IMPORT_C TBool SetEmergenyStatus(TBool aEmergency); |
|
61 IMPORT_C TBool SetRoamingStatus(TBool aRoaming); |
|
62 IMPORT_C TBool SetQuality(TLbsNetPosRequestQuality& aQuality); |
|
63 IMPORT_C TBool SendResetAssistanceData(TLbsAssistanceDataGroup aMask); |
|
64 |
|
65 // |
|
66 IMPORT_C void StartNetworkPrivacyRequest(TLbsNetPosRequestPrivacy aType, TLbsExternalRequestInfo& aRequest); |
|
67 IMPORT_C void CancelNetworkPrivacyRequest(); |
|
68 IMPORT_C void StartNetworkLocationRequest(); |
|
69 IMPORT_C void CancelNetworkLocationRequest(); |
|
70 |
|
71 // |
|
72 IMPORT_C TBool SetStepMode(TBool aStepMode); |
|
73 IMPORT_C TBool Next(TInt aError); |
|
74 private: |
|
75 static TInt StartServer(); |
|
76 |
|
77 public: |
|
78 // So inner classes can call sendreceive |
|
79 void SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const |
|
80 { |
|
81 RSessionBase::SendReceive(aFunction, aArgs, aStatus); |
|
82 } |
|
83 TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const |
|
84 { |
|
85 return RSessionBase::SendReceive(aFunction, aArgs); |
|
86 } |
|
87 void SendReceive(TInt aFunction,TRequestStatus& aStatus) const |
|
88 { |
|
89 RSessionBase::SendReceive(aFunction, aStatus); |
|
90 } |
|
91 TInt SendReceive(TInt aFunction) const |
|
92 { |
|
93 return RSessionBase::SendReceive(aFunction); |
|
94 } |
|
95 TInt Send(TInt aFunction) const |
|
96 { |
|
97 return RSessionBase::Send(aFunction); |
|
98 } |
|
99 TInt Send(TInt aFunction,const TIpcArgs& aArgs) const |
|
100 { |
|
101 return RSessionBase::Send(aFunction, aArgs); |
|
102 } |
|
103 private: |
|
104 /** |
|
105 */ |
|
106 class CNotificationConnect : public CActive |
|
107 { |
|
108 public: |
|
109 CNotificationConnect(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
110 ~CNotificationConnect(); |
|
111 void RunL(); |
|
112 void DoCancel(); |
|
113 private: |
|
114 RLbsNetSimTest* iTest; |
|
115 MLbsNetSimTestObserver* iObserver; |
|
116 }; |
|
117 /** |
|
118 */ |
|
119 class CNotificationDisconnect : public CActive |
|
120 { |
|
121 public: |
|
122 CNotificationDisconnect(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
123 ~CNotificationDisconnect(); |
|
124 void RunL(); |
|
125 void DoCancel(); |
|
126 private: |
|
127 RLbsNetSimTest* iTest; |
|
128 MLbsNetSimTestObserver* iObserver; |
|
129 }; |
|
130 /** |
|
131 */ |
|
132 class CNotificationRegisterLcsMoLr : public CActive |
|
133 { |
|
134 public: |
|
135 CNotificationRegisterLcsMoLr(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
136 ~CNotificationRegisterLcsMoLr(); |
|
137 void RunL(); |
|
138 void DoCancel(); |
|
139 private: |
|
140 RLbsNetSimTest* iTest; |
|
141 MLbsNetSimTestObserver* iObserver; |
|
142 |
|
143 // Argument Data |
|
144 TBuf<256> iData; |
|
145 }; |
|
146 /** |
|
147 */ |
|
148 class CNotificationReleaseLcsMoLr : public CActive |
|
149 { |
|
150 public: |
|
151 CNotificationReleaseLcsMoLr(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
152 ~CNotificationReleaseLcsMoLr(); |
|
153 void RunL(); |
|
154 void DoCancel(); |
|
155 private: |
|
156 RLbsNetSimTest* iTest; |
|
157 MLbsNetSimTestObserver* iObserver; |
|
158 |
|
159 // Args |
|
160 TInt iReason; |
|
161 TPckg<TInt> iReasonPkg; |
|
162 }; |
|
163 /** |
|
164 */ |
|
165 class CMessageReleaseLcsLocationNotification : public CActive |
|
166 { |
|
167 public: |
|
168 CMessageReleaseLcsLocationNotification(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
169 ~CMessageReleaseLcsLocationNotification(); |
|
170 |
|
171 void Send(TLbsNetPosRequestPrivacy& aType, TLbsExternalRequestInfo& aRequestInfo); |
|
172 void RunL(); |
|
173 void DoCancel(); |
|
174 private: |
|
175 RLbsNetSimTest* iTest; |
|
176 MLbsNetSimTestObserver* iObserver; |
|
177 |
|
178 // Args |
|
179 TLbsNetPosRequestPrivacy iType; |
|
180 TPckg<TLbsNetPosRequestPrivacy> iTypePkg; |
|
181 TLbsExternalRequestInfo iRequestInfo; |
|
182 TPckg<TLbsExternalRequestInfo> iRequestInfoPkg; |
|
183 CLbsNetworkProtocolBase::TLbsPrivacyResponse iResponse; |
|
184 TPckg<CLbsNetworkProtocolBase::TLbsPrivacyResponse> iResponsePkg; |
|
185 }; |
|
186 /** |
|
187 */ |
|
188 class CMessageStartNetworkLocationRequest : public CActive |
|
189 { |
|
190 public: |
|
191 CMessageStartNetworkLocationRequest(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
192 ~CMessageStartNetworkLocationRequest(); |
|
193 |
|
194 void Send(); |
|
195 void RunL(); |
|
196 void DoCancel(); |
|
197 private: |
|
198 RLbsNetSimTest* iTest; |
|
199 MLbsNetSimTestObserver* iObserver; |
|
200 }; |
|
201 /** |
|
202 */ |
|
203 class CNotificationMeasurementReport : public CActive |
|
204 { |
|
205 public: |
|
206 CNotificationMeasurementReport(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
207 ~CNotificationMeasurementReport(); |
|
208 void RunL(); |
|
209 void DoCancel(); |
|
210 private: |
|
211 RLbsNetSimTest* iTest; |
|
212 MLbsNetSimTestObserver* iObserver; |
|
213 |
|
214 // Args |
|
215 TPositionInfo iPosition; |
|
216 TPckg<TPositionInfo> iPositionPkg; |
|
217 }; |
|
218 /** |
|
219 */ |
|
220 class CNotificationMeasurementReportRequestMoreAssitanceData : public CActive |
|
221 { |
|
222 public: |
|
223 CNotificationMeasurementReportRequestMoreAssitanceData(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
224 ~CNotificationMeasurementReportRequestMoreAssitanceData(); |
|
225 void RunL(); |
|
226 void DoCancel(); |
|
227 private: |
|
228 RLbsNetSimTest* iTest; |
|
229 MLbsNetSimTestObserver* iObserver; |
|
230 |
|
231 // Args |
|
232 TLbsAssistanceDataGroup iFilter; |
|
233 TPckg<TLbsAssistanceDataGroup> iFilterPkg; |
|
234 }; |
|
235 /** |
|
236 */ |
|
237 class CNotificationMeasurementReportControlFailure : public CActive |
|
238 { |
|
239 public: |
|
240 CNotificationMeasurementReportControlFailure(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
241 ~CNotificationMeasurementReportControlFailure(); |
|
242 void RunL(); |
|
243 void DoCancel(); |
|
244 private: |
|
245 RLbsNetSimTest* iTest; |
|
246 MLbsNetSimTestObserver* iObserver; |
|
247 |
|
248 // Args |
|
249 TInt iReason; |
|
250 TPckg<TInt> iReasonPkg; |
|
251 }; |
|
252 /** |
|
253 */ |
|
254 class CNotificationMeasurementControlLocation : public CActive |
|
255 { |
|
256 public: |
|
257 static CNotificationMeasurementControlLocation* NewL(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
258 ~CNotificationMeasurementControlLocation(); |
|
259 void RunL(); |
|
260 void DoCancel(); |
|
261 private: |
|
262 CNotificationMeasurementControlLocation(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
263 void ConstructL(); |
|
264 |
|
265 |
|
266 RLbsNetSimTest* iTest; |
|
267 MLbsNetSimTestObserver* iObserver; |
|
268 |
|
269 // Args |
|
270 TPositionInfo iPosition; |
|
271 TPckg<TPositionInfo> iPositionPkg; |
|
272 TLbsNetPosRequestQuality iQuality; |
|
273 TPckg<TLbsNetPosRequestQuality> iQualityPkg; |
|
274 HBufC8* iAssistanceData; |
|
275 TPtr8 iPtr; |
|
276 }; |
|
277 /** |
|
278 */ |
|
279 class CNotificationFacilityLcsMoLrResult : public CActive |
|
280 { |
|
281 public: |
|
282 CNotificationFacilityLcsMoLrResult(RLbsNetSimTest* aTest, MLbsNetSimTestObserver* iObserver); |
|
283 ~CNotificationFacilityLcsMoLrResult(); |
|
284 void RunL(); |
|
285 void DoCancel(); |
|
286 private: |
|
287 RLbsNetSimTest* iTest; |
|
288 MLbsNetSimTestObserver* iObserver; |
|
289 |
|
290 // Args |
|
291 TInt iReason; |
|
292 TPckg<TInt> iReasonPkg; |
|
293 TPositionInfo iPosition; |
|
294 TPckg<TPositionInfo> iPositionPkg; |
|
295 }; |
|
296 |
|
297 private: |
|
298 MLbsNetSimTestObserver* iObserver; // Observer for callbacks |
|
299 |
|
300 // Notifications |
|
301 CNotificationConnect* iNotificationConnect; |
|
302 CNotificationDisconnect* iNotificationDisconnect; |
|
303 CNotificationRegisterLcsMoLr* iNotificationRegisterLcsMoLr; |
|
304 CNotificationReleaseLcsMoLr* iNotificationReleaseLcsMoLr; |
|
305 CNotificationMeasurementReport* iNotificationMeasurementReport; |
|
306 CNotificationMeasurementReportRequestMoreAssitanceData* iNotificationMeasurementReportRequestMoreAssitanceData; |
|
307 CNotificationMeasurementReportControlFailure* iNotificationMeasurementReportControlFailure; |
|
308 CNotificationMeasurementControlLocation* iNotificationMeasurementControlLocation; |
|
309 CNotificationFacilityLcsMoLrResult* iNotificationFacilityLcsMoLrResult; |
|
310 |
|
311 // Message handlers |
|
312 CMessageReleaseLcsLocationNotification* iMessageReleaseLcsLocationNotification; |
|
313 CMessageStartNetworkLocationRequest* iMessageStartNetworkLocationRequest; |
|
314 }; |
|
315 |
|
316 |
|
317 #endif // LBSNETSIMTEST_H |