|
1 // Copyright (c) 2000-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 // \file mmretrieve.h |
|
15 // Multimode ETel API v1.0 |
|
16 // Header file for asynchronous list retrieval classes |
|
17 // |
|
18 // |
|
19 |
|
20 #ifndef _MMRETRIEVE_H_ |
|
21 #define _MMRETRIEVE_H_ |
|
22 |
|
23 #include "ETELMM.H" |
|
24 #include "mmlist.h" |
|
25 |
|
26 #include <e32base.h> |
|
27 |
|
28 class CAsyncRetrieveVariableLengthBuffer : public CActive |
|
29 /** |
|
30 class CAsyncRetrieveVariableLengthBuffer mmretrieve.h "INC/mmretrieve.h" |
|
31 brief Base class for generic actions in retrieving a variable length buffer in two phases |
|
32 CAsyncRetrieveVariableLengthBuffer inherits from CActive |
|
33 @internalComponent |
|
34 */ |
|
35 { |
|
36 protected: |
|
37 |
|
38 // |
|
39 // Start the retrieval |
|
40 // |
|
41 |
|
42 void Start(TRequestStatus& aReqStatus, TDes8* aPhase1Request, TDes8* aPhase2Request); |
|
43 CAsyncRetrieveVariableLengthBuffer(); |
|
44 virtual ~CAsyncRetrieveVariableLengthBuffer(); |
|
45 |
|
46 TBool CompleteIfInUse(TRequestStatus& aReqStatus); |
|
47 void FreeBuffer(); |
|
48 |
|
49 private: |
|
50 virtual void RestoreListL(); |
|
51 virtual void Get(TInt aIpc, TRequestStatus& aReqStatus, TDes8& aDes1, TDes8& aDes2) = 0; |
|
52 virtual void CancelReq(TInt aIpc1,TInt aIpc2) = 0; |
|
53 |
|
54 virtual void DoCancel(); |
|
55 virtual void RunL(); |
|
56 |
|
57 void StartPhase2L(); |
|
58 |
|
59 protected: |
|
60 enum { |
|
61 EIdle, |
|
62 ERetrievePhase1, |
|
63 ERetrievePhase2 |
|
64 } iState; |
|
65 |
|
66 CBufBase* iResultsBuf; |
|
67 TPtr8 iResultsPtr; |
|
68 TInt iIpcPhase1; |
|
69 TInt iIpcPhase2; |
|
70 TInt iIpcCancel; |
|
71 private: |
|
72 TRequestStatus* iUserStatus; |
|
73 TDes8* iPhase1RequestData; |
|
74 TDes8* iPhase2RequestData; |
|
75 TPckgBuf<TInt> iBufferSize; |
|
76 }; |
|
77 |
|
78 class CAsyncRetrieveWithClientIds : public CAsyncRetrieveVariableLengthBuffer |
|
79 /** |
|
80 class CAsyncRetrieveWithClientIds mmretrieve.h "INC/mmretrieve.h" |
|
81 brief Base class that adds passing of client ID within each phase of the retrieval |
|
82 CAsyncRetrieveWithClientIds inherits from CAsyncRetrieveVariableLengthBuffer |
|
83 @internalComponent |
|
84 */ |
|
85 { |
|
86 protected: |
|
87 CAsyncRetrieveWithClientIds(TInt aSessionHandle, TInt aSubSessionHandle); |
|
88 protected: |
|
89 TPckgBuf<RMobilePhone::TClientId> iId; |
|
90 }; |
|
91 |
|
92 class CAsyncRetrieveStoreList : public CAsyncRetrieveWithClientIds |
|
93 /** |
|
94 class CAsyncRetrieveStoreList mmretrieve.h "INC/mmretrieve.h" |
|
95 brief Class that specialises in retrieving lists from phone store classes |
|
96 CAsyncRetrieveStoreList inherits from CAsyncRetrieveWithClientIds |
|
97 @internalComponent |
|
98 */ |
|
99 { |
|
100 public: |
|
101 CAsyncRetrieveStoreList(RMobilePhoneStore& aStore); |
|
102 virtual void Get(TInt aIpc, TRequestStatus& aReqStatus, TDes8& aDes1, TDes8& aDes2); |
|
103 virtual void CancelReq(TInt aIpc1, TInt aIpc2); |
|
104 |
|
105 IMPORT_C void Start(TRequestStatus& aReqStatus); |
|
106 |
|
107 protected: |
|
108 RMobilePhoneStore& iStore; |
|
109 }; |
|
110 |
|
111 class CAsyncRetrievePhoneList : public CAsyncRetrieveWithClientIds |
|
112 /** |
|
113 class CAsyncRetrievePhoneList mmretrieve.h "INC/mmretrieve.h" |
|
114 brief Class that specialises in retrieving lists from phone or network |
|
115 CAsyncRetrievePhoneList inherits from CAsyncRetrieveWithClientIds |
|
116 @internalComponent |
|
117 */ |
|
118 { |
|
119 public: |
|
120 CAsyncRetrievePhoneList(RMobilePhone& aPhone); |
|
121 virtual void Get(TInt aIpc, TRequestStatus& aReqStatus, TDes8& aDes1, TDes8& aDes2); |
|
122 virtual void CancelReq(TInt aIpc1, TInt aIpc2); |
|
123 |
|
124 protected: |
|
125 RMobilePhone& iPhone; |
|
126 }; |
|
127 |
|
128 class CRetrieveMobilePhoneDetectedNetworks : public CAsyncRetrievePhoneList |
|
129 /** |
|
130 class CRetrieveMobilePhoneDetectedNetworks mmretrieve.h "INC/mmretrieve.h" |
|
131 brief Retrieves the detected network list from the phone |
|
132 CRetrieveMobilePhoneDetectedNetworks inherits from CAsyncRetrievePhoneList |
|
133 @internalComponent |
|
134 */ |
|
135 { |
|
136 public: |
|
137 IMPORT_C static CRetrieveMobilePhoneDetectedNetworks* NewL(RMobilePhone& aPhone); |
|
138 IMPORT_C ~CRetrieveMobilePhoneDetectedNetworks(); |
|
139 |
|
140 IMPORT_C void Start(TRequestStatus& aReqStatus); |
|
141 |
|
142 IMPORT_C CMobilePhoneNetworkList* RetrieveListL(); |
|
143 |
|
144 protected: |
|
145 CRetrieveMobilePhoneDetectedNetworks(RMobilePhone& aPhone); |
|
146 void ConstructL(); |
|
147 |
|
148 virtual void RestoreListL(); |
|
149 |
|
150 private: |
|
151 CMobilePhoneNetworkList* iResults; |
|
152 }; |
|
153 |
|
154 class CRetrieveMobilePhoneCFList : public CAsyncRetrievePhoneList |
|
155 /** |
|
156 class CRetrieveMobilePhoneCFList mmretrieve.h "INC/mmretrieve.h" |
|
157 brief Retrieves the Call Forwarding status list from the phone |
|
158 CRetrieveMobilePhoneCFList inherits from CAsyncRetrievePhoneList |
|
159 @internalComponent |
|
160 */ |
|
161 { |
|
162 public: |
|
163 |
|
164 // for use by client-side API code and TSY only |
|
165 |
|
166 struct TGetCallForwardingRequest |
|
167 { |
|
168 RMobilePhone::TClientId iClient; |
|
169 RMobilePhone::TMobilePhoneCFCondition iCondition; |
|
170 RMobilePhone::TMobileInfoLocation iLocation; |
|
171 }; |
|
172 |
|
173 public: |
|
174 IMPORT_C static CRetrieveMobilePhoneCFList* NewL(RMobilePhone& aPhone); |
|
175 IMPORT_C ~CRetrieveMobilePhoneCFList(); |
|
176 |
|
177 IMPORT_C void Start(TRequestStatus& aReqStatus, |
|
178 RMobilePhone::TMobilePhoneCFCondition aCondition, |
|
179 RMobilePhone::TMobileInfoLocation aLocation = RMobilePhone::EInfoLocationCachePreferred); |
|
180 |
|
181 IMPORT_C CMobilePhoneCFList* RetrieveListL(); |
|
182 |
|
183 protected: |
|
184 CRetrieveMobilePhoneCFList(RMobilePhone& aPhone); |
|
185 void ConstructL(); |
|
186 |
|
187 virtual void RestoreListL(); |
|
188 |
|
189 private: |
|
190 CMobilePhoneCFList* iResults; |
|
191 TPckgBuf<TGetCallForwardingRequest> iCFRequestData; |
|
192 }; |
|
193 |
|
194 class CRetrieveMobilePhoneCBList : public CAsyncRetrievePhoneList |
|
195 /** |
|
196 class CRetrieveMobilePhoneCBList mmretrieve.h "INC/mmretrieve.h" |
|
197 brief Retrieves the Call Barring status list from the phone |
|
198 CRetrieveMobilePhoneCBList inherits from CAsyncRetrievePhoneList |
|
199 @internalComponent |
|
200 */ |
|
201 { |
|
202 public: |
|
203 |
|
204 // for use by client-side API code and TSY only |
|
205 |
|
206 struct TGetCallBarringRequest |
|
207 { |
|
208 RMobilePhone::TClientId iClient; |
|
209 RMobilePhone::TMobilePhoneCBCondition iCondition; |
|
210 RMobilePhone::TMobileInfoLocation iLocation; |
|
211 }; |
|
212 |
|
213 |
|
214 public: |
|
215 IMPORT_C static CRetrieveMobilePhoneCBList* NewL(RMobilePhone& aPhone); |
|
216 IMPORT_C ~CRetrieveMobilePhoneCBList(); |
|
217 |
|
218 IMPORT_C void Start(TRequestStatus& aReqStatus, |
|
219 RMobilePhone::TMobilePhoneCBCondition aCondition, |
|
220 RMobilePhone::TMobileInfoLocation aLocation = RMobilePhone::EInfoLocationCachePreferred); |
|
221 |
|
222 IMPORT_C CMobilePhoneCBList* RetrieveListL(); |
|
223 |
|
224 protected: |
|
225 CRetrieveMobilePhoneCBList(RMobilePhone& aPhone); |
|
226 void ConstructL(); |
|
227 |
|
228 virtual void RestoreListL(); |
|
229 |
|
230 private: |
|
231 CMobilePhoneCBList* iResults; |
|
232 TPckgBuf<TGetCallBarringRequest> iCBRequestData; |
|
233 }; |
|
234 |
|
235 class CRetrieveMobilePhoneCWList : public CAsyncRetrievePhoneList |
|
236 /** |
|
237 class CRetrieveMobilePhoneCWList mmretrieve.h "INC/mmretrieve.h" |
|
238 brief Retrieves the Call Waiting status list from the phone |
|
239 CRetrieveMobilePhoneCWList inherits from CAsyncRetrievePhoneList |
|
240 @internalComponent |
|
241 */ |
|
242 { |
|
243 public: |
|
244 |
|
245 // for use by client-side API code and TSY only |
|
246 |
|
247 struct TGetCallWaitingRequest |
|
248 { |
|
249 RMobilePhone::TClientId iClient; |
|
250 RMobilePhone::TMobileInfoLocation iLocation; |
|
251 }; |
|
252 |
|
253 public: |
|
254 IMPORT_C static CRetrieveMobilePhoneCWList* NewL(RMobilePhone& aPhone); |
|
255 IMPORT_C ~CRetrieveMobilePhoneCWList(); |
|
256 |
|
257 IMPORT_C void Start(TRequestStatus& aReqStatus,RMobilePhone::TMobileInfoLocation aLocation = RMobilePhone::EInfoLocationCachePreferred); |
|
258 |
|
259 IMPORT_C CMobilePhoneCWList* RetrieveListL(); |
|
260 |
|
261 protected: |
|
262 CRetrieveMobilePhoneCWList(RMobilePhone& aPhone); |
|
263 void ConstructL(); |
|
264 |
|
265 virtual void RestoreListL(); |
|
266 |
|
267 private: |
|
268 CMobilePhoneCWList* iResults; |
|
269 TPckgBuf<TGetCallWaitingRequest> iCWRequestData; |
|
270 }; |
|
271 |
|
272 class CRetrieveMobilePhoneCcbsList : public CAsyncRetrievePhoneList |
|
273 /** |
|
274 class CRetrieveMobilePhoneCcbsList mmretrieve.h "INC/mmretrieve.h" |
|
275 brief Retrieves the CCBS request list from the phone |
|
276 CRetrieveMobilePhoneCcbsList inherits from CAsyncRetrievePhoneList |
|
277 @internalComponent |
|
278 */ |
|
279 { |
|
280 public: |
|
281 IMPORT_C static CRetrieveMobilePhoneCcbsList* NewL(RMobilePhone& aPhone); |
|
282 IMPORT_C ~CRetrieveMobilePhoneCcbsList(); |
|
283 |
|
284 IMPORT_C void Start(TRequestStatus& aReqStatus); |
|
285 |
|
286 IMPORT_C CMobilePhoneCcbsList* RetrieveListL(); |
|
287 |
|
288 protected: |
|
289 CRetrieveMobilePhoneCcbsList(RMobilePhone& aPhone); |
|
290 void ConstructL(); |
|
291 |
|
292 virtual void RestoreListL(); |
|
293 |
|
294 private: |
|
295 CMobilePhoneCcbsList* iResults; |
|
296 }; |
|
297 |
|
298 class CRetrieveMobilePhoneSmsList : public CAsyncRetrieveStoreList |
|
299 /** |
|
300 class CRetrieveMobilePhoneSmsList mmretrieve.h "INC/mmretrieve.h" |
|
301 brief Reads stored, fixed length SMS message list from the phone or SIM message store |
|
302 CRetrieveMobilePhoneSmsList inherits from CAsyncRetrieveStoreList |
|
303 @internalComponent |
|
304 */ |
|
305 { |
|
306 public: |
|
307 IMPORT_C static CRetrieveMobilePhoneSmsList* NewL(RMobilePhoneStore& aStore, RMobileSmsStore::TMobileSmsEntryExtensionId aType); |
|
308 IMPORT_C ~CRetrieveMobilePhoneSmsList(); |
|
309 |
|
310 enum |
|
311 { |
|
312 KValueNotUsed = -1 |
|
313 }; |
|
314 |
|
315 struct TBatchRequestData |
|
316 { |
|
317 RMobilePhone::TClientId iClient; |
|
318 RMobileSmsStore::TMobileSmsEntryExtensionId iEntryType; |
|
319 TBool iBatchRequest; |
|
320 TInt iStartIndex; |
|
321 TInt iBatchSize; |
|
322 }; |
|
323 |
|
324 IMPORT_C void Start(TRequestStatus& aReqStatus); |
|
325 IMPORT_C void StartBatch(TRequestStatus& aReqStatus, TInt aStartIndex, TInt aBatchSize); |
|
326 |
|
327 IMPORT_C CMobilePhoneGsmSmsList* RetrieveGsmListL(); |
|
328 |
|
329 protected: |
|
330 CRetrieveMobilePhoneSmsList(RMobilePhoneStore& aStore, RMobileSmsStore::TMobileSmsEntryExtensionId aType); |
|
331 void ConstructL(); |
|
332 void InitiateRequest(TRequestStatus& aReqStatus, TBool aBatch, TInt aStartIndex, TInt aBatchSize); |
|
333 |
|
334 virtual void RestoreListL(); |
|
335 |
|
336 private: |
|
337 CMobilePhoneGsmSmsList* iGsmResults; |
|
338 RMobileSmsStore::TMobileSmsEntryExtensionId iEntryType; |
|
339 TPckgBuf<TBatchRequestData> iRequestData; |
|
340 }; |
|
341 |
|
342 class CRetrieveMobilePhoneSmspList : public CAsyncRetrieveWithClientIds |
|
343 /** |
|
344 class CRetrieveMobilePhoneSmspList mmretrieve.h "INC/mmretrieve.h" |
|
345 brief Reads SMS parameter list from the SIM's SMSP store |
|
346 CRetrieveMobilePhoneSmspList inherits from CAsyncRetrieveWithClientIds |
|
347 @internalComponent |
|
348 */ |
|
349 { |
|
350 public: |
|
351 IMPORT_C static CRetrieveMobilePhoneSmspList* NewL(RMobileSmsMessaging& aMessaging); |
|
352 IMPORT_C ~CRetrieveMobilePhoneSmspList(); |
|
353 |
|
354 IMPORT_C CMobilePhoneSmspList* RetrieveListL(); |
|
355 IMPORT_C void Start(TRequestStatus& aReqStatus); |
|
356 |
|
357 protected: |
|
358 CRetrieveMobilePhoneSmspList(RMobileSmsMessaging& aMessaging); |
|
359 void ConstructL(); |
|
360 virtual void RestoreListL(); |
|
361 |
|
362 private: |
|
363 virtual void Get(TInt aIpc, TRequestStatus& aReqStatus, TDes8& aDes1, TDes8& aDes2); |
|
364 virtual void CancelReq(TInt aIpc1, TInt aIpc2); |
|
365 |
|
366 private: |
|
367 RMobileSmsMessaging& iMessaging; |
|
368 CMobilePhoneSmspList* iResults; |
|
369 }; |
|
370 |
|
371 class CRetrieveMobilePhoneBroadcastIdList : public CAsyncRetrieveWithClientIds |
|
372 /** |
|
373 class CRetrieveMobilePhoneBroadcastIdList mmretrieve.h "INC/mmretrieve.h" |
|
374 brief Reads CBMI list from the phone. This list may be stored on SIM |
|
375 CRetrieveMobilePhoneBroadcastIdList inherits from CAsyncRetrieveWithClientIds |
|
376 @internalComponent |
|
377 */ |
|
378 { |
|
379 public: |
|
380 // for use by client-side API code and TSY only |
|
381 |
|
382 struct TGetBroadcastIdRequest |
|
383 { |
|
384 RMobileBroadcastMessaging::TMobileBroadcastIdType iIdType; |
|
385 RMobilePhone::TClientId iClient; |
|
386 }; |
|
387 |
|
388 public: |
|
389 IMPORT_C static CRetrieveMobilePhoneBroadcastIdList* NewL(RMobileBroadcastMessaging& aMessaging); |
|
390 IMPORT_C ~CRetrieveMobilePhoneBroadcastIdList(); |
|
391 |
|
392 IMPORT_C CMobilePhoneBroadcastIdList* RetrieveListL(); |
|
393 IMPORT_C void Start(TRequestStatus& aReqStatus, RMobileBroadcastMessaging::TMobileBroadcastIdType aIdType); |
|
394 |
|
395 protected: |
|
396 CRetrieveMobilePhoneBroadcastIdList(RMobileBroadcastMessaging& aMessaging); |
|
397 void ConstructL(); |
|
398 virtual void RestoreListL(); |
|
399 |
|
400 private: |
|
401 virtual void Get(TInt aIpc, TRequestStatus& aReqStatus, TDes8& aDes1, TDes8& aDes2); |
|
402 virtual void CancelReq(TInt aIpc1, TInt aIpc2); |
|
403 |
|
404 protected: |
|
405 RMobileBroadcastMessaging& iMessaging; |
|
406 CMobilePhoneBroadcastIdList* iResults; |
|
407 TPckgBuf<TGetBroadcastIdRequest> iBroadcastIdRequestData; |
|
408 }; |
|
409 |
|
410 class CRetrieveMobilePhoneNamList : public CAsyncRetrieveStoreList |
|
411 /** |
|
412 class CRetrieveMobilePhoneNamList mmretrieve.h "INC/mmretrieve.h" |
|
413 brief Reads NAM list from the phone's NAM store |
|
414 CRetrieveMobilePhoneNamList inherits from CAsyncRetrieveStoreList |
|
415 @internalComponent |
|
416 */ |
|
417 { |
|
418 public: |
|
419 IMPORT_C static CRetrieveMobilePhoneNamList* NewL(RMobilePhoneStore& aStore); |
|
420 IMPORT_C ~CRetrieveMobilePhoneNamList(); |
|
421 |
|
422 struct TNamRequestData |
|
423 { |
|
424 RMobilePhone::TClientId iClient; |
|
425 TInt iNamId; |
|
426 }; |
|
427 |
|
428 IMPORT_C CMobilePhoneNamList* RetrieveListL(); |
|
429 IMPORT_C void Start(TRequestStatus& aReqStatus, TInt aNamId); |
|
430 |
|
431 protected: |
|
432 CRetrieveMobilePhoneNamList(RMobilePhoneStore& aStore); |
|
433 void ConstructL(); |
|
434 |
|
435 virtual void RestoreListL(); |
|
436 |
|
437 private: |
|
438 CMobilePhoneNamList* iResults; |
|
439 TPckgBuf<TNamRequestData> iRequestData; |
|
440 }; |
|
441 |
|
442 class CRetrieveMobilePhoneONList : public CAsyncRetrieveStoreList |
|
443 /** |
|
444 class CRetrieveMobilePhoneONList mmretrieve.h "INC/mmretrieve.h" |
|
445 brief Reads Own Number list from the phone or SIM's Own Number store |
|
446 CRetrieveMobilePhoneONList inherits from CAsyncRetrieveStoreList |
|
447 @internalComponent |
|
448 */ |
|
449 { |
|
450 public: |
|
451 IMPORT_C static CRetrieveMobilePhoneONList* NewL(RMobilePhoneStore& aStore); |
|
452 IMPORT_C ~CRetrieveMobilePhoneONList(); |
|
453 |
|
454 IMPORT_C CMobilePhoneONList* RetrieveListL(); |
|
455 IMPORT_C void Start(TRequestStatus& aReqStatus); |
|
456 |
|
457 protected: |
|
458 CRetrieveMobilePhoneONList(RMobilePhoneStore& aStore); |
|
459 void ConstructL(); |
|
460 |
|
461 virtual void RestoreListL(); |
|
462 |
|
463 private: |
|
464 CMobilePhoneONList* iResults; |
|
465 }; |
|
466 |
|
467 class CRetrieveMobilePhoneENList : public CAsyncRetrieveStoreList |
|
468 /** |
|
469 class CRetrieveMobilePhoneENList mmretrieve.h "INC/mmretrieve.h" |
|
470 brief Reads Emergency Number list from the phone or SIM store |
|
471 CRetrieveMobilePhoneENList inherits from CAsyncRetrieveStoreList |
|
472 @internalComponent |
|
473 */ |
|
474 { |
|
475 public: |
|
476 IMPORT_C static CRetrieveMobilePhoneENList* NewL(RMobilePhoneStore& aStore); |
|
477 IMPORT_C ~CRetrieveMobilePhoneENList(); |
|
478 |
|
479 IMPORT_C CMobilePhoneENList* RetrieveListL(); |
|
480 IMPORT_C void Start(TRequestStatus& aReqStatus); |
|
481 |
|
482 protected: |
|
483 CRetrieveMobilePhoneENList(RMobilePhoneStore& aStore); |
|
484 void ConstructL(); |
|
485 |
|
486 virtual void RestoreListL(); |
|
487 |
|
488 private: |
|
489 CMobilePhoneENList* iResults; |
|
490 }; |
|
491 |
|
492 |
|
493 #endif |