|
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 // Contains method definitions for CMmPtrHolder and all of the classes that derive from it |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 */ |
|
21 |
|
22 // From core API |
|
23 #include <etelext.h> |
|
24 |
|
25 // Multimode header files |
|
26 #include <etelmm.h> |
|
27 #include "mm_hold.h" |
|
28 |
|
29 |
|
30 // |
|
31 // CMmPtrHolder - class owned by RMobile... objects to contain the TPtr8's and other member |
|
32 // data required by asynchronous functions so that any additional functions will not require |
|
33 // breaking BC. |
|
34 // |
|
35 |
|
36 /* |
|
37 CMmPtrHolder* CMmPtrHolder::NewL(TInt aSizeOfPtrArray, TInt aSizeOfPtrCArray) |
|
38 { |
|
39 CMmPtrHolder* p = new (ELeave) CMmPtrHolder(); |
|
40 CleanupStack::PushL(p); |
|
41 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
42 CleanupStack::Pop(); |
|
43 return p; |
|
44 } |
|
45 */ |
|
46 CMmPtrHolder::CMmPtrHolder() |
|
47 /** Standard C++ constructor */ |
|
48 {} |
|
49 |
|
50 CMmPtrHolder::~CMmPtrHolder() |
|
51 /** Standard destructor */ |
|
52 { |
|
53 iPtrArray.Close(); |
|
54 iPtrCArray.Close(); |
|
55 } |
|
56 |
|
57 void CMmPtrHolder::ConstructL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
58 /** |
|
59 * This method constructs the two arrays: one to hold TPtr8's and the other TPtrC8's |
|
60 */ |
|
61 { |
|
62 TPtr8 ptr(NULL,0); |
|
63 |
|
64 TInt i; |
|
65 for (i = 0; i < aSizeOfPtrArray; i++) |
|
66 { |
|
67 User::LeaveIfError(iPtrArray.Append(ptr)); |
|
68 } |
|
69 |
|
70 TPtrC8 ptrC(NULL,0); |
|
71 for (i = 0; i < aSizeOfPtrCArray; i++) |
|
72 { |
|
73 User::LeaveIfError(iPtrCArray.Append(ptrC)); |
|
74 } |
|
75 } |
|
76 |
|
77 TPtr8& CMmPtrHolder::Ptr(TInt aIndex) |
|
78 /** |
|
79 * This method returns a reference to the TPtr8 at aIndex within the array |
|
80 * |
|
81 * @param aIndex The array location of the desired TPtr8 |
|
82 * @return TPtr8& |
|
83 */ |
|
84 { |
|
85 return iPtrArray[aIndex]; |
|
86 } |
|
87 |
|
88 TPtrC8& CMmPtrHolder::PtrC(TInt aIndex) |
|
89 /** |
|
90 * This method returns a reference to the TPtrC8 at aIndex within the array |
|
91 * |
|
92 * @param aIndex The array location of the desired TPtrC8 |
|
93 * @return TPtrC8& |
|
94 */ |
|
95 { |
|
96 return iPtrCArray[aIndex]; |
|
97 } |
|
98 |
|
99 // |
|
100 // CMobilePhonePtrHolder |
|
101 // |
|
102 |
|
103 CMobilePhonePtrHolder* CMobilePhonePtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
104 /** |
|
105 * This method creates the RMobilePhone ptr holder object |
|
106 * Array sizes depend on number of RMobilePhone requests that require ptr holder slots |
|
107 * |
|
108 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
109 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
110 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
111 */ |
|
112 { |
|
113 CMobilePhonePtrHolder* p = new (ELeave) CMobilePhonePtrHolder(); |
|
114 CleanupStack::PushL(p); |
|
115 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
116 CleanupStack::Pop(); |
|
117 return p; |
|
118 } |
|
119 |
|
120 CMobilePhonePtrHolder::CMobilePhonePtrHolder() : |
|
121 iStoreNetworkPtr(NULL,0,0),iStoreWlanSIDPtr(NULL,0,0) |
|
122 /** |
|
123 Constructor |
|
124 */ |
|
125 {} |
|
126 |
|
127 |
|
128 CMobilePhonePtrHolder::~CMobilePhonePtrHolder() |
|
129 /** |
|
130 Destructor |
|
131 */ |
|
132 { |
|
133 delete iStoreNetworkBuf; |
|
134 delete iStoreWlanSIDBuf; |
|
135 } |
|
136 |
|
137 // |
|
138 // CMobileLinePtrHolder |
|
139 // |
|
140 |
|
141 CMobileLinePtrHolder* CMobileLinePtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
142 /** |
|
143 * This method creates the RMobileLine ptr holder object |
|
144 * Array sizes depend on number of RMobileLine requests that require ptr holder slots |
|
145 * |
|
146 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
147 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
148 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
149 */ |
|
150 { |
|
151 CMobileLinePtrHolder* p = new (ELeave) CMobileLinePtrHolder(); |
|
152 CleanupStack::PushL(p); |
|
153 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
154 CleanupStack::Pop(); |
|
155 return p; |
|
156 } |
|
157 |
|
158 // |
|
159 // CMobileCallPtrHolder |
|
160 // |
|
161 |
|
162 CMobileCallPtrHolder* CMobileCallPtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
163 /** |
|
164 * This method creates the RMobileCall ptr holder object |
|
165 * Array sizes depend on number of RMobileCall requests that require ptr holder slots |
|
166 * |
|
167 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
168 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
169 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
170 */ |
|
171 { |
|
172 CMobileCallPtrHolder* p = new (ELeave) CMobileCallPtrHolder(); |
|
173 CleanupStack::PushL(p); |
|
174 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
175 CleanupStack::Pop(); |
|
176 return p; |
|
177 } |
|
178 |
|
179 // |
|
180 // CSmsMessagingPtrHolder |
|
181 // |
|
182 |
|
183 CSmsMessagingPtrHolder* CSmsMessagingPtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
184 /** |
|
185 * This method creates the RMobileSmsMessaging ptr holder object |
|
186 * Array sizes depend on number of RMobileSmsMessaging requests that require ptr holder slots |
|
187 * |
|
188 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
189 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
190 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
191 */ |
|
192 { |
|
193 CSmsMessagingPtrHolder* p = new (ELeave) CSmsMessagingPtrHolder(); |
|
194 CleanupStack::PushL(p); |
|
195 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
196 CleanupStack::Pop(); |
|
197 return p; |
|
198 } |
|
199 |
|
200 CSmsMessagingPtrHolder::CSmsMessagingPtrHolder() : |
|
201 iSmspPtr(NULL,0,0) |
|
202 { |
|
203 } |
|
204 |
|
205 CSmsMessagingPtrHolder::~CSmsMessagingPtrHolder() |
|
206 { |
|
207 delete iSmspBuf; |
|
208 } |
|
209 |
|
210 // |
|
211 // CCbsMessagingPtrHolder |
|
212 // |
|
213 |
|
214 CCbsMessagingPtrHolder* CCbsMessagingPtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
215 /** |
|
216 * This method creates the RMobileBroadcastMessaging ptr holder object |
|
217 * Array sizes depend on number of RMobileBroadcastMessaging requests that require ptr holder slots |
|
218 * |
|
219 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
220 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
221 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
222 */ |
|
223 { |
|
224 CCbsMessagingPtrHolder* p = new (ELeave) CCbsMessagingPtrHolder(); |
|
225 CleanupStack::PushL(p); |
|
226 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
227 CleanupStack::Pop(); |
|
228 return p; |
|
229 } |
|
230 |
|
231 CCbsMessagingPtrHolder::CCbsMessagingPtrHolder() : |
|
232 iBroadcastIdPtr(NULL,0,0) |
|
233 { |
|
234 } |
|
235 |
|
236 CCbsMessagingPtrHolder::~CCbsMessagingPtrHolder() |
|
237 { |
|
238 delete iBroadcastIdBuf; |
|
239 } |
|
240 |
|
241 // |
|
242 // CMobilePhoneStorePtrHolder |
|
243 // |
|
244 |
|
245 CMobilePhoneStorePtrHolder* CMobilePhoneStorePtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
246 /** |
|
247 * This method creates the RMobilePhoneStore ptr holder object |
|
248 * Array sizes depend on number of RMobilePhoneStore requests that require ptr holder slots |
|
249 * |
|
250 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
251 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
252 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
253 */ |
|
254 { |
|
255 CMobilePhoneStorePtrHolder* p = new (ELeave) CMobilePhoneStorePtrHolder(); |
|
256 CleanupStack::PushL(p); |
|
257 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
258 CleanupStack::Pop(); |
|
259 return p; |
|
260 } |
|
261 |
|
262 // |
|
263 // CSmsStorePtrHolder |
|
264 // |
|
265 |
|
266 CSmsStorePtrHolder* CSmsStorePtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
267 /** |
|
268 * This method creates the RMobileSmsStore ptr holder object |
|
269 * Array sizes depend on number of RMobileSmsStore requests that require ptr holder slots |
|
270 * |
|
271 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
272 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
273 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
274 */ |
|
275 { |
|
276 CSmsStorePtrHolder* p = new (ELeave) CSmsStorePtrHolder(); |
|
277 CleanupStack::PushL(p); |
|
278 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
279 CleanupStack::Pop(); |
|
280 return p; |
|
281 } |
|
282 |
|
283 // |
|
284 // CNamStorePtrHolder |
|
285 // |
|
286 |
|
287 CNamStorePtrHolder* CNamStorePtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
288 /** |
|
289 * This method creates the RMobileNamStore ptr holder object |
|
290 * Array sizes depend on number of RMobileNamStore requests that require ptr holder slots |
|
291 * |
|
292 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
293 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
294 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
295 */ |
|
296 { |
|
297 CNamStorePtrHolder* p = new (ELeave) CNamStorePtrHolder(); |
|
298 CleanupStack::PushL(p); |
|
299 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
300 CleanupStack::Pop(); |
|
301 return p; |
|
302 } |
|
303 |
|
304 CNamStorePtrHolder::CNamStorePtrHolder() : |
|
305 iNamPtr(NULL,0),iNamPtrV4(NULL,0) |
|
306 { |
|
307 } |
|
308 |
|
309 CNamStorePtrHolder::~CNamStorePtrHolder() |
|
310 { |
|
311 delete iNamBuf; |
|
312 delete iNamBufV4; |
|
313 } |
|
314 |
|
315 // |
|
316 // CONStorePtrHolder |
|
317 // |
|
318 |
|
319 CONStorePtrHolder* CONStorePtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
320 /** |
|
321 * This method creates the RMobileONStore ptr holder object |
|
322 * Array sizes depend on number of RMobileONStore requests that require ptr holder slots |
|
323 * |
|
324 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
325 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
326 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
327 */ |
|
328 { |
|
329 CONStorePtrHolder* p = new (ELeave) CONStorePtrHolder(); |
|
330 CleanupStack::PushL(p); |
|
331 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
332 CleanupStack::Pop(); |
|
333 return p; |
|
334 } |
|
335 |
|
336 CONStorePtrHolder::CONStorePtrHolder() : |
|
337 iONPtr(NULL,0) |
|
338 { |
|
339 } |
|
340 |
|
341 CONStorePtrHolder::~CONStorePtrHolder() |
|
342 { |
|
343 delete iONBuf; |
|
344 } |
|
345 |
|
346 // |
|
347 // CPhoneBookStorePtrHolder |
|
348 // |
|
349 |
|
350 CPhoneBookStorePtrHolder* CPhoneBookStorePtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
351 /** |
|
352 * This method creates the RMobilePhoneBookStore ptr holder object |
|
353 * Array sizes depend on number of RMobilePhoneBookStore requests that require ptr holder slots |
|
354 * |
|
355 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
356 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
357 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
358 */ |
|
359 { |
|
360 CPhoneBookStorePtrHolder* p = new (ELeave) CPhoneBookStorePtrHolder(); |
|
361 CleanupStack::PushL(p); |
|
362 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
363 CleanupStack::Pop(); |
|
364 return p; |
|
365 } |
|
366 |
|
367 // |
|
368 // CMobileConferenceCallPtrHolder |
|
369 // |
|
370 |
|
371 CMobileConferenceCallPtrHolder* CMobileConferenceCallPtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
372 /** |
|
373 * This method creates the RMobileConferenceCall ptr holder object |
|
374 * Array sizes depend on number of RMobileConferenceCall requests that require ptr holder slots |
|
375 * |
|
376 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
377 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
378 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
379 */ |
|
380 { |
|
381 CMobileConferenceCallPtrHolder* p = new (ELeave) CMobileConferenceCallPtrHolder(); |
|
382 CleanupStack::PushL(p); |
|
383 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
384 CleanupStack::Pop(); |
|
385 return p; |
|
386 } |
|
387 |
|
388 |
|
389 // |
|
390 // CMobileSmartCardEapPtrHolder |
|
391 // |
|
392 |
|
393 /** |
|
394 This method creates the RMobileSmartCardEap ptr holder object. |
|
395 Array sizes depend on number of RMobileSmartCardEap requests that |
|
396 require ptr holder slots. |
|
397 |
|
398 @param aSizeOfPtrArray Number of TPtr8 slots required |
|
399 @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
400 @return Pointer to a new CMobileSmartCardEapPtrHolder object |
|
401 */ |
|
402 CMobileSmartCardEapPtrHolder* CMobileSmartCardEapPtrHolder::NewL(TInt aSizeOfPtrArray, TInt aSizeOfPtrCArray) |
|
403 { |
|
404 CMobileSmartCardEapPtrHolder* self = new (ELeave) CMobileSmartCardEapPtrHolder(); |
|
405 CleanupStack::PushL(self); |
|
406 self->ConstructL(aSizeOfPtrArray, aSizeOfPtrCArray); |
|
407 CleanupStack::Pop(); |
|
408 return self; |
|
409 } |
|
410 |
|
411 /** |
|
412 Default constructor. |
|
413 */ |
|
414 CMobileSmartCardEapPtrHolder::CMobileSmartCardEapPtrHolder() |
|
415 : iReqAuthData(NULL,0) |
|
416 { |
|
417 // NOP |
|
418 } |
|
419 |
|
420 /** |
|
421 Default destructor. |
|
422 */ |
|
423 CMobileSmartCardEapPtrHolder::~CMobileSmartCardEapPtrHolder() |
|
424 { |
|
425 // NOP |
|
426 } |
|
427 |
|
428 |
|
429 // |
|
430 // CMobileLocationServicesPtrHolder |
|
431 // |
|
432 |
|
433 CMobileLocationServicesPtrHolder* CMobileLocationServicesPtrHolder::NewL(TInt aSizeOfPtrArray,TInt aSizeOfPtrCArray) |
|
434 /** |
|
435 * This method creates the RMobileLocationServices ptr holder object |
|
436 * Array sizes depend on number of RMobileLocationServices requests that require ptr holder slots |
|
437 * |
|
438 * @param aSizeOfPtrArray Number of TPtr8 slots required |
|
439 * @param aSizeOfPtrCArray Number of TPtrC8 slots required |
|
440 * @return CMobilePhonePtrHolder* Pointer to newly created ptr holder object |
|
441 */ |
|
442 { |
|
443 CMobileLocationServicesPtrHolder* p = new (ELeave) CMobileLocationServicesPtrHolder(); |
|
444 CleanupStack::PushL(p); |
|
445 p->ConstructL(aSizeOfPtrArray,aSizeOfPtrCArray); |
|
446 CleanupStack::Pop(); |
|
447 return p; |
|
448 } |