|
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 // ETel Multimode API |
|
15 // |
|
16 // |
|
17 |
|
18 #include <mmlist.h> |
|
19 #include <etelext.h> |
|
20 |
|
21 /********************************************************************/ |
|
22 // |
|
23 // CMobilePhoneListBase |
|
24 // Base class of thin-template idiom for ETel list classes |
|
25 // |
|
26 /********************************************************************/ |
|
27 |
|
28 EXPORT_C CMobilePhoneListBase::CMobilePhoneListBase(TInt aLength, TInt aGranularity) : |
|
29 iList(aLength,aGranularity), |
|
30 iMaxNumber(KMaxEntriesNotSet) |
|
31 /** Standard constructor, sets the length of the entries in the list and the granularity |
|
32 of the list. |
|
33 |
|
34 @param aLength Length of the CArrayFixFlat<TAny> entries to be stored in the |
|
35 list. |
|
36 @param aGranularity Granularity of the list. */ |
|
37 { |
|
38 } |
|
39 |
|
40 EXPORT_C CMobilePhoneListBase::~CMobilePhoneListBase() |
|
41 /** Empty destructor. */ |
|
42 { |
|
43 } |
|
44 |
|
45 EXPORT_C CBufBase* CMobilePhoneListBase::StoreLC() |
|
46 /** Stores the streamed contents of the list into a CBufFlat. |
|
47 Placing the list's contents into a store is necessary prior to passing the |
|
48 list across the client-server interface. |
|
49 |
|
50 @return Pointer to the allocated CBufFlat. |
|
51 @capability None |
|
52 */ |
|
53 { |
|
54 CBufFlat* buf=CBufFlat::NewL(4); |
|
55 CleanupStack::PushL(buf); |
|
56 RBufWriteStream strm(*buf); |
|
57 strm << *this; |
|
58 strm.CommitL(); |
|
59 return buf; |
|
60 } |
|
61 |
|
62 EXPORT_C void CMobilePhoneListBase::StoreL(TDes8& aDes) |
|
63 /** This member function will store the contents of the list class into a write |
|
64 stream. Placing the list's contents into a store is necessary prior to passing |
|
65 the list across the client-server interface. |
|
66 |
|
67 This member function uses the aDes parameter as the write stream. |
|
68 |
|
69 @param aDes Descriptor in which to store the list. |
|
70 @capability None |
|
71 */ |
|
72 { |
|
73 RDesWriteStream strm(aDes); |
|
74 strm << *this; |
|
75 strm.CommitL(); |
|
76 } |
|
77 |
|
78 EXPORT_C void CMobilePhoneListBase::RestoreL(const TDesC8& aBuf) |
|
79 /** This member function will restore the contents of a read stream into the list's |
|
80 internal structure. Restoring the list's contents is necessary after the list |
|
81 has crossed the client-server interface. |
|
82 |
|
83 This member function uses the aDes parameter as the read stream. |
|
84 |
|
85 @param aBuf The read stream used to restore the list from. |
|
86 @capability None |
|
87 */ |
|
88 { |
|
89 RDesReadStream strm(aBuf); // turn it into a stream |
|
90 strm >> *this; // re-construct arrays |
|
91 } |
|
92 |
|
93 EXPORT_C const TAny* CMobilePhoneListBase::GetEntryL(TInt aIndex) const |
|
94 /** This member function retrieves the entry at position aIndex from the list. |
|
95 |
|
96 A valid index ranges from 0 to count -1, where count is the value returned |
|
97 from CMobilePhoneListBase::Enumerate(). |
|
98 |
|
99 @param aIndex Index of the entry to be retrieved. |
|
100 @leave EListIndexOutOfRange This member function will leave if aIndex is outside |
|
101 the current number of entries. |
|
102 @return Pointer to the entry at position aIndex. |
|
103 @capability None |
|
104 */ |
|
105 { |
|
106 if (aIndex < 0 || aIndex >= iList.Count()) |
|
107 User::Leave(EListIndexOutOfRange); |
|
108 return iList.At(aIndex); |
|
109 } |
|
110 |
|
111 EXPORT_C void CMobilePhoneListBase::AddEntryL(const TAny* aPtr) |
|
112 /** This member function adds a new entry into the list, placing it in the next |
|
113 empty position. |
|
114 |
|
115 @param aEntry Pointer to the entry that will be added to the list. |
|
116 @leave EListMaxNumberReached This member function will leave if the list fails |
|
117 to allocate memory for the new entry or if the maximum number of entries has |
|
118 been reached. |
|
119 |
|
120 @capability None |
|
121 */ |
|
122 { |
|
123 if (iMaxNumber != KMaxEntriesNotSet && iList.Count() >= iMaxNumber) |
|
124 User::Leave(EListMaxNumberReached); |
|
125 iList.AppendL(aPtr); |
|
126 } |
|
127 |
|
128 EXPORT_C TInt CMobilePhoneListBase::Enumerate() const |
|
129 /** This member function gets the number of entries currently in the list. This |
|
130 number can therefore be between zero and the maximum number of entries if |
|
131 this attribute has been set. |
|
132 |
|
133 @return The number of entries currently in the list. |
|
134 @capability None |
|
135 */ |
|
136 { |
|
137 return iList.Count(); |
|
138 } |
|
139 |
|
140 EXPORT_C TInt CMobilePhoneListBase::MaxNumberEntries() const |
|
141 /** This member function gets the maximum number of entries that can be stored |
|
142 in this list. This attribute is required because most phone-side storage will |
|
143 have an upper storage limit. |
|
144 |
|
145 @return The maximum number of entries that can be stored in this list. If |
|
146 the TSY has not set this attribute during a list retrieval then the value |
|
147 returned will be KMaxEntriesNotSet. |
|
148 @capability None |
|
149 */ |
|
150 { |
|
151 return iMaxNumber; |
|
152 } |
|
153 |
|
154 EXPORT_C void CMobilePhoneListBase::SetMaxNumberEntries(TInt aMax) |
|
155 /** This member function sets the maximum number of entries that can be stored |
|
156 in this list. This member function is intended for use by the TSY only, after |
|
157 it has performed a list retrieval. Clients are able to add new entries to |
|
158 an editable list returned to them but only up to the maximum number. |
|
159 |
|
160 @param aMax The (new) maximum number of entries for this list. |
|
161 @capability None |
|
162 */ |
|
163 { |
|
164 __ASSERT_ALWAYS(aMax >=0, PanicClient(EEtelPanicIndexOutOfRange)); |
|
165 __ASSERT_ALWAYS(aMax >= iList.Count(), PanicClient(EEtelPanicIndexOutOfRange)); |
|
166 iMaxNumber=aMax; |
|
167 } |
|
168 |
|
169 EXPORT_C void CMobilePhoneListBase::InternalizeL(RReadStream& aStream) |
|
170 /** This member function internalizes the list contents from a stream. |
|
171 |
|
172 @param aStream The read stream containing the list. |
|
173 @capability None |
|
174 */ |
|
175 { |
|
176 iMaxNumber = aStream.ReadInt32L(); |
|
177 iList.Reset(); |
|
178 TInt count=aStream.ReadInt32L(); |
|
179 for (TInt ii=0;ii<count;++ii) |
|
180 InternalizeEntryL(iList.ExtendL(),aStream); |
|
181 } |
|
182 |
|
183 EXPORT_C void CMobilePhoneListBase::ExternalizeL(RWriteStream& aStream) const |
|
184 /** This member function externalizes the list contents into a stream. |
|
185 |
|
186 @param aStream The write stream to which to write the list. |
|
187 @capability None |
|
188 */ |
|
189 { |
|
190 aStream.WriteInt32L(iMaxNumber); |
|
191 TInt count=iList.Count(); |
|
192 aStream.WriteInt32L(count); |
|
193 for (TInt ii=0;ii<count;++ii) |
|
194 ExternalizeEntryL(iList.At(ii),aStream); |
|
195 } |
|
196 |
|
197 |
|
198 /********************************************************************/ |
|
199 // |
|
200 // CMobilePhoneEditableListBase |
|
201 // Base class of thin-template idiom for ETel list classes |
|
202 // |
|
203 /********************************************************************/ |
|
204 |
|
205 EXPORT_C CMobilePhoneEditableListBase::CMobilePhoneEditableListBase(TInt aLength, TInt aGranularity) |
|
206 : CMobilePhoneListBase(aLength,aGranularity) |
|
207 /** Standard constructor. |
|
208 |
|
209 @param aLength The length of the elements of this fixed length array. This |
|
210 value must be positive otherwise the constructor raises an E32USER-CBase 17 |
|
211 panic. |
|
212 @param aGranularity The granularity of the array. This value must be positive |
|
213 otherwise the constructor raises an E32USER-CBase 18 panic. */ |
|
214 { |
|
215 } |
|
216 |
|
217 EXPORT_C CMobilePhoneEditableListBase::~CMobilePhoneEditableListBase() |
|
218 /** Standard empty destructor. */ |
|
219 {} |
|
220 |
|
221 EXPORT_C void CMobilePhoneEditableListBase::DeleteEntryL(TInt aIndex) |
|
222 /** Deletes the entry at index aIndex from the list. |
|
223 |
|
224 @param aIndex Index of the entry to be deleted from the list |
|
225 @capability None |
|
226 */ |
|
227 { |
|
228 if (aIndex < 0 || aIndex >= iList.Count()) |
|
229 User::Leave(EListIndexOutOfRange); |
|
230 iList.Delete(aIndex); |
|
231 } |
|
232 |
|
233 EXPORT_C void CMobilePhoneEditableListBase::InsertEntryL(TInt aIndex, const TAny* aPtr) |
|
234 /** |
|
235 Inserts a new list entry at the specified index |
|
236 |
|
237 @param aIndex Index of the point at which to insert the new entry |
|
238 @param aPtr Pointer to the new entry |
|
239 @leave EListIndexOutOfRange If aIndex > number of entries in the list. |
|
240 @leave EListMaxNumberReached If the maximum number of entries is reached. |
|
241 |
|
242 @capability None |
|
243 */ |
|
244 { |
|
245 if (aIndex < 0 || aIndex >= iList.Count()) |
|
246 User::Leave(EListIndexOutOfRange); |
|
247 if (iMaxNumber != KMaxEntriesNotSet && iList.Count() >= iMaxNumber) |
|
248 User::Leave(EListMaxNumberReached); |
|
249 iList.InsertL(aIndex, aPtr); |
|
250 } |
|
251 |
|
252 /********************************************************************/ |
|
253 // |
|
254 // CMobilePhoneNetworkList |
|
255 // A concrete instantiation of an ETel list - holding RMobilePhone::TMobilePhoneNetworkInfoV1 objects |
|
256 // |
|
257 /********************************************************************/ |
|
258 |
|
259 EXPORT_C CMobilePhoneNetworkList* CMobilePhoneNetworkList::NewL() |
|
260 /** This member function creates a new instance of a CMobilePhoneNetworkList. It |
|
261 will leave if the two-phase construction fails at any point. |
|
262 |
|
263 @return A pointer to the new instance of CMobilePhoneNetworkList. |
|
264 @capability None |
|
265 */ |
|
266 { |
|
267 CMobilePhoneNetworkList* r=new(ELeave) CMobilePhoneNetworkList(); |
|
268 CleanupStack::PushL(r); |
|
269 r->ConstructL(); |
|
270 CleanupStack::Pop(); |
|
271 return r; |
|
272 } |
|
273 |
|
274 CMobilePhoneNetworkList::CMobilePhoneNetworkList() |
|
275 : CMobilePhoneReadOnlyList<RMobilePhone::TMobilePhoneNetworkInfoV1>() |
|
276 {} |
|
277 |
|
278 EXPORT_C CMobilePhoneNetworkList::~CMobilePhoneNetworkList() |
|
279 /** Empty destructor. */ |
|
280 {} |
|
281 |
|
282 void CMobilePhoneNetworkList::ConstructL() |
|
283 {} |
|
284 |
|
285 |
|
286 /********************************************************************/ |
|
287 // |
|
288 // CMobilePhoneNetworkListV2 |
|
289 // A concrete instantiation of an ETel list - holding RMobilePhone::TMobilePhoneNetworkInfoV2 objects |
|
290 // |
|
291 /********************************************************************/ |
|
292 |
|
293 EXPORT_C CMobilePhoneNetworkListV2* CMobilePhoneNetworkListV2::NewL() |
|
294 /** This member function creates a new instance of a CMobilePhoneNetworkListV2. It |
|
295 will leave if the two-phase construction fails at any point. |
|
296 |
|
297 @return A pointer to the new instance of CMobilePhoneNetworkList. |
|
298 @capability None |
|
299 */ |
|
300 { |
|
301 CMobilePhoneNetworkListV2* r=new(ELeave) CMobilePhoneNetworkListV2(); |
|
302 return r; |
|
303 } |
|
304 |
|
305 CMobilePhoneNetworkListV2::CMobilePhoneNetworkListV2() |
|
306 : CMobilePhoneReadOnlyList<RMobilePhone::TMobilePhoneNetworkInfoV2>() |
|
307 {} |
|
308 |
|
309 EXPORT_C CMobilePhoneNetworkListV2::~CMobilePhoneNetworkListV2() |
|
310 /** Empty destructor. */ |
|
311 {} |
|
312 |
|
313 /********************************************************************/ |
|
314 // |
|
315 // CMobilePhoneNetworkListV5 |
|
316 // A concrete instantiation of an ETel list - holding RMobilePhone::TMobilePhoneNetworkInfoV5 objects |
|
317 // |
|
318 /********************************************************************/ |
|
319 |
|
320 EXPORT_C CMobilePhoneNetworkListV5* CMobilePhoneNetworkListV5::NewL() |
|
321 /** This member function creates a new instance of a CMobilePhoneNetworkListV5. It |
|
322 will leave if the two-phase construction fails at any point. |
|
323 |
|
324 @return A pointer to the new instance of CMobilePhoneNetworkList. |
|
325 @capability None |
|
326 */ |
|
327 { |
|
328 CMobilePhoneNetworkListV5* r=new(ELeave) CMobilePhoneNetworkListV5(); |
|
329 return r; |
|
330 } |
|
331 |
|
332 CMobilePhoneNetworkListV5::CMobilePhoneNetworkListV5() |
|
333 : CMobilePhoneReadOnlyList<RMobilePhone::TMobilePhoneNetworkInfoV5>() |
|
334 {} |
|
335 |
|
336 EXPORT_C CMobilePhoneNetworkListV5::~CMobilePhoneNetworkListV5() |
|
337 /** Empty destructor. */ |
|
338 {} |
|
339 |
|
340 /********************************************************************/ |
|
341 // |
|
342 // CMobilePhoneNetworkListV8 |
|
343 // A concrete instantiation of an ETel list - holding RMobilePhone::TMobilePhoneNetworkInfoV8 objects |
|
344 // |
|
345 /********************************************************************/ |
|
346 |
|
347 EXPORT_C CMobilePhoneNetworkListV8* CMobilePhoneNetworkListV8::NewL() |
|
348 /** This member function creates a new instance of a CMobilePhoneNetworkListV8. It |
|
349 will leave if the two-phase construction fails at any point. |
|
350 |
|
351 @return A pointer to the new instance of CMobilePhoneNetworkList. |
|
352 @capability None |
|
353 */ |
|
354 { |
|
355 CMobilePhoneNetworkListV8* r=new(ELeave) CMobilePhoneNetworkListV8(); |
|
356 return r; |
|
357 } |
|
358 |
|
359 CMobilePhoneNetworkListV8::CMobilePhoneNetworkListV8() |
|
360 : CMobilePhoneReadOnlyList<RMobilePhone::TMobilePhoneNetworkInfoV8>() |
|
361 {} |
|
362 |
|
363 EXPORT_C CMobilePhoneNetworkListV8::~CMobilePhoneNetworkListV8() |
|
364 /** Empty destructor. */ |
|
365 {} |
|
366 |
|
367 /********************************************************************/ |
|
368 // |
|
369 // CMobilePhoneCFList |
|
370 // A concrete instantion of an ETel list - holding RMobilePhone::TMobilePhoneCFInfoEntryV1 objects |
|
371 // |
|
372 /********************************************************************/ |
|
373 |
|
374 EXPORT_C CMobilePhoneCFList* CMobilePhoneCFList::NewL() |
|
375 /** This function member creates a new instance of a CMobilePhoneCFList. |
|
376 |
|
377 @return A pointer to the new instance of CMobilePhoneCFList. |
|
378 @capability None |
|
379 */ |
|
380 { |
|
381 CMobilePhoneCFList* r=new(ELeave) CMobilePhoneCFList(); |
|
382 CleanupStack::PushL(r); |
|
383 r->ConstructL(); |
|
384 CleanupStack::Pop(); |
|
385 return r; |
|
386 } |
|
387 |
|
388 CMobilePhoneCFList::CMobilePhoneCFList() |
|
389 : CMobilePhoneReadOnlyList<RMobilePhone::TMobilePhoneCFInfoEntryV1>() |
|
390 {} |
|
391 |
|
392 EXPORT_C CMobilePhoneCFList::~CMobilePhoneCFList() |
|
393 /** This function member destroys the CMobilePhoneCFList object and the inherited |
|
394 virtual destructor frees-up any resources used by its base classes. */ |
|
395 {} |
|
396 |
|
397 void CMobilePhoneCFList::ConstructL() |
|
398 {} |
|
399 |
|
400 /********************************************************************/ |
|
401 // |
|
402 // CMobilePhoneCBList |
|
403 // A concrete instantion of an ETel list - holding RMobilePhone::TMobilePhoneCBInfoEntryV1 objects |
|
404 // |
|
405 /********************************************************************/ |
|
406 |
|
407 |
|
408 EXPORT_C CMobilePhoneCBList* CMobilePhoneCBList::NewL() |
|
409 /** This member function creates a new instance of a CMobilePhoneCBList. |
|
410 |
|
411 @return A pointer to the new instance of CMobilePhoneCBList |
|
412 @capability None |
|
413 */ |
|
414 { |
|
415 CMobilePhoneCBList* r=new(ELeave) CMobilePhoneCBList(); |
|
416 CleanupStack::PushL(r); |
|
417 r->ConstructL(); |
|
418 CleanupStack::Pop(); |
|
419 return r; |
|
420 } |
|
421 |
|
422 EXPORT_C CMobilePhoneCBList::~CMobilePhoneCBList() |
|
423 /** This member function destroys the CMobilePhoneCBList object and the inherited |
|
424 virtual destructor frees-up any resources used by its base classes. */ |
|
425 { |
|
426 } |
|
427 |
|
428 CMobilePhoneCBList::CMobilePhoneCBList() |
|
429 { |
|
430 } |
|
431 |
|
432 void CMobilePhoneCBList::ConstructL() |
|
433 {} |
|
434 |
|
435 |
|
436 |
|
437 /********************************************************************/ |
|
438 // |
|
439 // CMobilePhoneCWList |
|
440 // A concrete instantion of an ETel list - holding RMobilePhone::TMobilePhoneCWInfoEntryV1 objects |
|
441 // |
|
442 /********************************************************************/ |
|
443 |
|
444 |
|
445 EXPORT_C CMobilePhoneCWList* CMobilePhoneCWList::NewL() |
|
446 /** This function member creates a new instance of a CMobilePhoneCWList. |
|
447 |
|
448 @return A pointer to the new instance of CMobilePhoneCWList. |
|
449 @capability None |
|
450 */ |
|
451 { |
|
452 CMobilePhoneCWList* r=new(ELeave) CMobilePhoneCWList(); |
|
453 CleanupStack::PushL(r); |
|
454 r->ConstructL(); |
|
455 CleanupStack::Pop(); |
|
456 return r; |
|
457 } |
|
458 |
|
459 EXPORT_C CMobilePhoneCWList::~CMobilePhoneCWList() |
|
460 /** This function member destroys the CMobilePhoneCWList object and the inherited |
|
461 virtual destructor frees-up any resources used by its base classes. */ |
|
462 { |
|
463 } |
|
464 |
|
465 CMobilePhoneCWList::CMobilePhoneCWList() |
|
466 { |
|
467 } |
|
468 |
|
469 void CMobilePhoneCWList::ConstructL() |
|
470 {} |
|
471 |
|
472 |
|
473 /********************************************************************/ |
|
474 // |
|
475 // CMobilePhoneCCBSList |
|
476 // A concrete instantion of an ETel list - holding RMobilePhone::TMobilePhoneCCBSEntryV1 objects |
|
477 // |
|
478 /********************************************************************/ |
|
479 |
|
480 |
|
481 EXPORT_C CMobilePhoneCcbsList* CMobilePhoneCcbsList::NewL() |
|
482 /** This member function creates a new instance of a CMobilePhoneCcbsList. |
|
483 |
|
484 @return A pointer to the new instance of CMobilePhoneCcbsList. |
|
485 @capability None |
|
486 */ |
|
487 { |
|
488 CMobilePhoneCcbsList* r=new(ELeave) CMobilePhoneCcbsList(); |
|
489 CleanupStack::PushL(r); |
|
490 r->ConstructL(); |
|
491 CleanupStack::Pop(); |
|
492 return r; |
|
493 } |
|
494 |
|
495 EXPORT_C CMobilePhoneCcbsList::~CMobilePhoneCcbsList() |
|
496 /** This member function destroys the CMobilePhoneCcbsList object and the inherited |
|
497 virtual destructor frees-up any resources used by its base classes. */ |
|
498 { |
|
499 } |
|
500 |
|
501 CMobilePhoneCcbsList::CMobilePhoneCcbsList() |
|
502 { |
|
503 } |
|
504 |
|
505 void CMobilePhoneCcbsList::ConstructL() |
|
506 {} |
|
507 |
|
508 |
|
509 /********************************************************************/ |
|
510 // |
|
511 // CMobilePhoneGsmSmsList |
|
512 // A concrete instantion of an ETel list - holding RMobileSmsStore::TMobileGsmSmsEntryV1 objects |
|
513 // |
|
514 /********************************************************************/ |
|
515 |
|
516 EXPORT_C CMobilePhoneGsmSmsList* CMobilePhoneGsmSmsList::NewL() |
|
517 /** This member function creates a new instance of a CMobilePhoneGsmSmsList. It |
|
518 will leave if the two-phase construction fails at any point. |
|
519 |
|
520 @return A pointer to newly created CMobilePhoneGsmSmsList. |
|
521 @capability None |
|
522 */ |
|
523 { |
|
524 CMobilePhoneGsmSmsList* r=new(ELeave) CMobilePhoneGsmSmsList(); |
|
525 CleanupStack::PushL(r); |
|
526 r->ConstructL(); |
|
527 CleanupStack::Pop(); |
|
528 return r; |
|
529 } |
|
530 |
|
531 CMobilePhoneGsmSmsList::CMobilePhoneGsmSmsList() |
|
532 : CMobilePhoneReadOnlyList<RMobileSmsStore::TMobileGsmSmsEntryV1>() |
|
533 {} |
|
534 |
|
535 EXPORT_C CMobilePhoneGsmSmsList::~CMobilePhoneGsmSmsList() |
|
536 /** This member function destroys the CMobilePhoneGsmSmsList object and the inherited |
|
537 virtual destructor frees-up any resources used by its base classes. */ |
|
538 {} |
|
539 |
|
540 void CMobilePhoneGsmSmsList::ConstructL() |
|
541 {} |
|
542 |
|
543 /********************************************************************/ |
|
544 // |
|
545 // CMobilePhoneCdmaSmsList |
|
546 // A concrete instantion of an ETel list - holding RMobileSmsStore::TMobileCdmaSmsEntryV1 objects |
|
547 // |
|
548 /********************************************************************/ |
|
549 |
|
550 EXPORT_C CMobilePhoneCdmaSmsList* CMobilePhoneCdmaSmsList::NewL() |
|
551 /** This member function creates a new instance of a CMobilePhoneCdmaSmsList. |
|
552 |
|
553 @return A pointer to the new instance of CMobilePhoneCdmaSmsList. |
|
554 @capability None |
|
555 */ |
|
556 { |
|
557 CMobilePhoneCdmaSmsList* r=new(ELeave) CMobilePhoneCdmaSmsList(); |
|
558 CleanupStack::PushL(r); |
|
559 r->ConstructL(); |
|
560 CleanupStack::Pop(); |
|
561 return r; |
|
562 } |
|
563 |
|
564 CMobilePhoneCdmaSmsList::CMobilePhoneCdmaSmsList() |
|
565 : CMobilePhoneReadOnlyList<RMobileSmsStore::TMobileCdmaSmsEntryV1>() |
|
566 {} |
|
567 |
|
568 EXPORT_C CMobilePhoneCdmaSmsList::~CMobilePhoneCdmaSmsList() |
|
569 /** This member function destroys the CMobilePhoneCdmaSmsList object and the inherited |
|
570 virtual destructor frees-up any resources used by its base classes. */ |
|
571 {} |
|
572 |
|
573 void CMobilePhoneCdmaSmsList::ConstructL() |
|
574 {} |
|
575 |
|
576 /********************************************************************/ |
|
577 // |
|
578 // CMobilePhoneSmspList |
|
579 // A concrete instantion of an ETel list - holding RMobileSmsMessaging::TMobileSmspEntryV1 objects |
|
580 // |
|
581 /********************************************************************/ |
|
582 |
|
583 EXPORT_C CMobilePhoneSmspList* CMobilePhoneSmspList::NewL() |
|
584 /** This member function creates a new instance of a CMobilePhoneSmspList. It will |
|
585 leave if the two-phase construction fails at any point. |
|
586 |
|
587 @return A pointer to the new instance of CMobilePhoneSmspList. |
|
588 @capability None |
|
589 */ |
|
590 { |
|
591 CMobilePhoneSmspList* r=new(ELeave) CMobilePhoneSmspList(); |
|
592 CleanupStack::PushL(r); |
|
593 r->ConstructL(); |
|
594 CleanupStack::Pop(); |
|
595 return r; |
|
596 } |
|
597 |
|
598 CMobilePhoneSmspList::CMobilePhoneSmspList() |
|
599 : CMobilePhoneEditableList<RMobileSmsMessaging::TMobileSmspEntryV1>() |
|
600 {} |
|
601 |
|
602 EXPORT_C CMobilePhoneSmspList::~CMobilePhoneSmspList() |
|
603 /** Empty destructor. */ |
|
604 {} |
|
605 |
|
606 void CMobilePhoneSmspList::ConstructL() |
|
607 {} |
|
608 |
|
609 |
|
610 /********************************************************************/ |
|
611 // |
|
612 // CMobilePhoneBroadcastIdList |
|
613 // A concrete instantion of an ETel list - holding RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 objects |
|
614 // |
|
615 /********************************************************************/ |
|
616 |
|
617 EXPORT_C CMobilePhoneBroadcastIdList* CMobilePhoneBroadcastIdList::NewL() |
|
618 /** This member function creates a new instance of a CMobilePhoneBroadcastIdList. |
|
619 |
|
620 @return A pointer to the new instance of CMobilePhoneBroadcastIdList. |
|
621 @capability None |
|
622 */ |
|
623 { |
|
624 CMobilePhoneBroadcastIdList* r=new(ELeave) CMobilePhoneBroadcastIdList(); |
|
625 CleanupStack::PushL(r); |
|
626 r->ConstructL(); |
|
627 CleanupStack::Pop(); |
|
628 return r; |
|
629 } |
|
630 |
|
631 CMobilePhoneBroadcastIdList::CMobilePhoneBroadcastIdList() |
|
632 : CMobilePhoneEditableList<RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1>() |
|
633 {} |
|
634 |
|
635 EXPORT_C CMobilePhoneBroadcastIdList::~CMobilePhoneBroadcastIdList() |
|
636 /** This member function destroys the CMobilePhoneBroadcastIdList object and the |
|
637 inherited virtual destructor frees-up any resources used by its base classes. */ |
|
638 {} |
|
639 |
|
640 void CMobilePhoneBroadcastIdList::ConstructL() |
|
641 {} |
|
642 |
|
643 EXPORT_C void CMobilePhoneBroadcastIdList::AddRangeEntryL(const RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1& aStart, |
|
644 const RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1& aEnd) |
|
645 /** This member function allows the client to add a sequential range of Cell Broadcast |
|
646 Identifiers into the BROADCASTID list. |
|
647 |
|
648 For example, if the client wants to receive all broadcast messages within |
|
649 the range of identifier 100 to (but not including) 200, instead of having |
|
650 to perform 100 individual CMobilePhoneEditableList::AddEntryL() member functions |
|
651 on their list, they can use AddRangeEntryL(), specifying aStart.iId=100 and |
|
652 aEnd.id=200. |
|
653 |
|
654 @param aStart The first value to add. |
|
655 @param aEnd The first that will not be added. |
|
656 @capability None |
|
657 */ |
|
658 { |
|
659 if (aEnd.iId < aStart.iId) |
|
660 User::Leave(EBadRange); |
|
661 |
|
662 TInt numToAdd; |
|
663 numToAdd = (aEnd.iId - aStart.iId); |
|
664 |
|
665 if (iMaxNumber != KMaxEntriesNotSet && numToAdd + iList.Count() >= iMaxNumber) |
|
666 User::Leave(EListMaxNumberReached); |
|
667 |
|
668 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 entry; |
|
669 |
|
670 TInt count=0; |
|
671 while ( count<numToAdd ) |
|
672 { |
|
673 entry.iId=(TUint16)((aStart.iId)+count); |
|
674 AddEntryL(entry); |
|
675 ++count; |
|
676 } |
|
677 } |
|
678 |
|
679 /********************************************************************/ |
|
680 // |
|
681 // CMobilePhoneNamList |
|
682 // A concrete instantion of an ETel list - holding RMobileNamStore::TMobileNamEntryV1 objects |
|
683 // |
|
684 /********************************************************************/ |
|
685 |
|
686 EXPORT_C CMobilePhoneNamList* CMobilePhoneNamList::NewL() |
|
687 /** This member function creates a new instance of a CMobilePhoneNamList. It will |
|
688 leave if the two-phase construction fails at any point. |
|
689 |
|
690 @return A pointer to the new instance of CMobilePhoneNamList. |
|
691 @capability None |
|
692 */ |
|
693 { |
|
694 CMobilePhoneNamList* r=new(ELeave) CMobilePhoneNamList(); |
|
695 CleanupStack::PushL(r); |
|
696 r->ConstructL(); |
|
697 CleanupStack::Pop(); |
|
698 return r; |
|
699 } |
|
700 |
|
701 CMobilePhoneNamList::CMobilePhoneNamList() |
|
702 : CMobilePhoneEditableList<RMobileNamStore::TMobileNamEntryV1>() |
|
703 {} |
|
704 |
|
705 EXPORT_C CMobilePhoneNamList::~CMobilePhoneNamList() |
|
706 /** Empty destructor. */ |
|
707 {} |
|
708 |
|
709 void CMobilePhoneNamList::ConstructL() |
|
710 {} |
|
711 |
|
712 /********************************************************************/ |
|
713 // |
|
714 // CMobilePhoneNamListV4 |
|
715 // A concrete instantiation of an ETel list - holding RMobileNamStore::TMobileNamEntryV4 objects |
|
716 // |
|
717 /********************************************************************/ |
|
718 |
|
719 EXPORT_C CMobilePhoneNamListV4* CMobilePhoneNamListV4::NewL() |
|
720 /** This member function creates a new instance of a CMobilePhoneNamListV4. It will |
|
721 leave if the two-phase construction fails at any point. |
|
722 |
|
723 @return A pointer to the new instance of CMobilePhoneNamListV4. |
|
724 @capability None |
|
725 */ |
|
726 { |
|
727 CMobilePhoneNamListV4* r=new(ELeave) CMobilePhoneNamListV4(); |
|
728 return r; |
|
729 } |
|
730 |
|
731 CMobilePhoneNamListV4::CMobilePhoneNamListV4() |
|
732 : CMobilePhoneEditableList<RMobileNamStore::TMobileNamEntryV4>() |
|
733 {} |
|
734 |
|
735 EXPORT_C CMobilePhoneNamListV4::~CMobilePhoneNamListV4() |
|
736 /** Empty destructor. */ |
|
737 {} |
|
738 |
|
739 /********************************************************************/ |
|
740 // |
|
741 // CMobilePhoneONList |
|
742 // A concrete instantion of an ETel list - holding RMobileONStore::TMobileONEntryV1 objects |
|
743 // |
|
744 /********************************************************************/ |
|
745 |
|
746 EXPORT_C CMobilePhoneONList* CMobilePhoneONList::NewL() |
|
747 /** This member function creates a new instance of a CMobilePhoneONList. It will |
|
748 leave if the two-phase construction fails at any point. |
|
749 |
|
750 @return pointer to the new instance of CMobilePhoneONList. |
|
751 @capability None |
|
752 */ |
|
753 { |
|
754 CMobilePhoneONList* r=new(ELeave) CMobilePhoneONList(); |
|
755 CleanupStack::PushL(r); |
|
756 r->ConstructL(); |
|
757 CleanupStack::Pop(); |
|
758 return r; |
|
759 } |
|
760 |
|
761 CMobilePhoneONList::CMobilePhoneONList() |
|
762 : CMobilePhoneEditableList<RMobileONStore::TMobileONEntryV1>() |
|
763 {} |
|
764 |
|
765 EXPORT_C CMobilePhoneONList::~CMobilePhoneONList() |
|
766 /** Empty destructor. */ |
|
767 {} |
|
768 |
|
769 void CMobilePhoneONList::ConstructL() |
|
770 {} |
|
771 |
|
772 |
|
773 /********************************************************************/ |
|
774 // |
|
775 // CMobilePhoneENList |
|
776 // A concrete instantion of an ETel list - holding RMobileENStore::TMobileENEntryV1 objects |
|
777 // |
|
778 /********************************************************************/ |
|
779 |
|
780 EXPORT_C CMobilePhoneENList* CMobilePhoneENList::NewL() |
|
781 /** This member function creates a list that will contain RMobileENStore::TMobileENEntryV1 |
|
782 objects. It will leave if the two-phase construction fails at any point. |
|
783 |
|
784 @return Pointer to the newly created CMobilePhoneENList. |
|
785 @capability None |
|
786 */ |
|
787 { |
|
788 CMobilePhoneENList* r=new(ELeave) CMobilePhoneENList(); |
|
789 CleanupStack::PushL(r); |
|
790 r->ConstructL(); |
|
791 CleanupStack::Pop(); |
|
792 return r; |
|
793 } |
|
794 |
|
795 CMobilePhoneENList::CMobilePhoneENList() |
|
796 : CMobilePhoneReadOnlyList<RMobileENStore::TMobileENEntryV1>() |
|
797 {} |
|
798 |
|
799 EXPORT_C CMobilePhoneENList::~CMobilePhoneENList() |
|
800 /** This member function destroys the CMobilePhoneENList object and the inherited |
|
801 virtual destructor frees-up any resources used by its base classes. */ |
|
802 {} |
|
803 |
|
804 void CMobilePhoneENList::ConstructL() |
|
805 {} |
|
806 |
|
807 /********************************************************************/ |
|
808 // |
|
809 // CMobilePhoneStoredNetworkList |
|
810 // A concrete instantion of an ETel list - holding RMobilePhone::TMobilePreferredNetworkEntryV3 objects |
|
811 // |
|
812 /********************************************************************/ |
|
813 |
|
814 EXPORT_C CMobilePhoneStoredNetworkList* CMobilePhoneStoredNetworkList::NewL() |
|
815 /** |
|
816 This method creates a list that will contain RMobilePhone::TMobilePreferredNetworkEntryV3 objects |
|
817 |
|
818 @return A pointer to the newly created CMobilePhoneStoredNetworkList object. |
|
819 @capability None |
|
820 */ |
|
821 { |
|
822 CMobilePhoneStoredNetworkList* r=new(ELeave) CMobilePhoneStoredNetworkList(); |
|
823 return r; |
|
824 } |
|
825 |
|
826 CMobilePhoneStoredNetworkList::CMobilePhoneStoredNetworkList() |
|
827 : CMobilePhoneEditableList<RMobilePhone::TMobilePreferredNetworkEntryV3>() |
|
828 /** |
|
829 Constructor. |
|
830 */ |
|
831 {} |
|
832 |
|
833 EXPORT_C CMobilePhoneStoredNetworkList::~CMobilePhoneStoredNetworkList() |
|
834 /** |
|
835 Destructor. |
|
836 */ |
|
837 {} |
|
838 |
|
839 EXPORT_C TInt CMobilePhoneStoredNetworkList::InsertEntryL(TInt aIndex, const RMobilePhone::TMobilePreferredNetworkEntryV3& aEntry) |
|
840 /** |
|
841 Inserts an entry in the stored network list. |
|
842 |
|
843 @param aIndex Index at which to insert the new entry. |
|
844 @param aEntry Entry to be inserted. |
|
845 @return KErrNone if successful; KErrArgument if operation is attempted on non-user defined (i.e. TMobilePreferredNetworkEntryV3.iUserDefined==EFalse) entry. |
|
846 @capability WriteDeviceData |
|
847 */ |
|
848 { |
|
849 if(IsEntryUserDefinedL(aIndex)) |
|
850 { |
|
851 CMobilePhoneEditableList<RMobilePhone::TMobilePreferredNetworkEntryV3>::InsertEntryL(aIndex, aEntry); |
|
852 return KErrNone; |
|
853 } |
|
854 else |
|
855 return KErrArgument; |
|
856 } |
|
857 EXPORT_C TInt CMobilePhoneStoredNetworkList::ChangeEntryL(TInt aIndex, const RMobilePhone::TMobilePreferredNetworkEntryV3& aEntry) |
|
858 /** |
|
859 Changes an entry in the stored network list. |
|
860 |
|
861 @param aIndex Index of entry to change. |
|
862 @param aEntry Changed stored network entry. |
|
863 @return KErrNone if successful; KErrArgument if operation is attempted on non-user defined (i.e. TMobilePreferredNetworkEntryV3.iUserDefined==EFalse) entry. |
|
864 @capability WriteDeviceData |
|
865 */ |
|
866 { |
|
867 if(IsEntryUserDefinedL(aIndex)) |
|
868 { |
|
869 CMobilePhoneEditableList<RMobilePhone::TMobilePreferredNetworkEntryV3>::ChangeEntryL(aIndex, aEntry); |
|
870 return KErrNone; |
|
871 } |
|
872 else |
|
873 return KErrArgument; |
|
874 } |
|
875 |
|
876 EXPORT_C TInt CMobilePhoneStoredNetworkList::DeleteEntryL(TInt aIndex) |
|
877 /** |
|
878 Deletes an entry in the stored network list. |
|
879 |
|
880 @param aIndex Index of entry to be deleted. |
|
881 @return KErrNone if successful; KErrArgument if operation is attempted on non-user defined (i.e. TMobilePreferredNetworkEntryV3.iUserDefined==EFalse) entry. |
|
882 @capability WriteDeviceData |
|
883 */ |
|
884 { |
|
885 if(IsEntryUserDefinedL(aIndex)) |
|
886 { |
|
887 CMobilePhoneEditableList<RMobilePhone::TMobilePreferredNetworkEntryV3>::DeleteEntryL(aIndex); |
|
888 return KErrNone; |
|
889 } |
|
890 else |
|
891 return KErrArgument; |
|
892 } |
|
893 |
|
894 TBool CMobilePhoneStoredNetworkList::IsEntryUserDefinedL(TInt aIndex) |
|
895 { |
|
896 if (aIndex < iList.Count() && !GetEntryL(aIndex).iUserDefined) |
|
897 return EFalse; |
|
898 return ETrue; |
|
899 } |
|
900 /********************************************************************/ |
|
901 // |
|
902 // CMobilePhoneGbaNafIdList |
|
903 // A concrete instantion of an ETel list - holding RMobilePhone::TGbaNafEntryV8 objects |
|
904 // |
|
905 /********************************************************************/ |
|
906 |
|
907 EXPORT_C CMobilePhoneGbaNafIdList* CMobilePhoneGbaNafIdList::NewL() |
|
908 /** This member function creates a new instance of a CMobilePhoneGbaNafIdList. It |
|
909 will leave if the two-phase construction fails at any point. |
|
910 |
|
911 @return A pointer to newly created CMobilePhoneGbaNafIdList. |
|
912 @capability None |
|
913 */ |
|
914 { |
|
915 CMobilePhoneGbaNafIdList* r=new(ELeave) CMobilePhoneGbaNafIdList(); |
|
916 CleanupStack::PushL(r); |
|
917 r->ConstructL(); |
|
918 CleanupStack::Pop(); |
|
919 return r; |
|
920 } |
|
921 |
|
922 CMobilePhoneGbaNafIdList::CMobilePhoneGbaNafIdList() |
|
923 : CMobilePhoneReadOnlyList<RMobilePhone::TGbaNafEntryV8>() |
|
924 /** |
|
925 Constructor. |
|
926 */ |
|
927 {} |
|
928 |
|
929 EXPORT_C CMobilePhoneGbaNafIdList::~CMobilePhoneGbaNafIdList() |
|
930 /** This member function destroys the CMobilePhoneGbaNafIdList object and the inherited |
|
931 virtual destructor frees-up any resources used by its base classes. */ |
|
932 {} |
|
933 |
|
934 void CMobilePhoneGbaNafIdList::ConstructL() |
|
935 {} |
|
936 |
|
937 /********************************************************************/ |
|
938 // |
|
939 // CMobilePhoneMbmsMskIdList |
|
940 // A concrete instantion of an ETel list - holding RMobilePhone::TMskEntryV8 objects |
|
941 // |
|
942 /********************************************************************/ |
|
943 |
|
944 EXPORT_C CMobilePhoneMbmsMskIdList* CMobilePhoneMbmsMskIdList::NewL() |
|
945 /** This member function creates a new instance of a CMobilePhoneMbmsMskIdList. It |
|
946 will leave if the two-phase construction fails at any point. |
|
947 |
|
948 @return A pointer to newly created CMobilePhoneMbmsMskIdList. |
|
949 @capability None |
|
950 */ |
|
951 { |
|
952 CMobilePhoneMbmsMskIdList* r=new(ELeave) CMobilePhoneMbmsMskIdList(); |
|
953 CleanupStack::PushL(r); |
|
954 r->ConstructL(); |
|
955 CleanupStack::Pop(); |
|
956 return r; |
|
957 } |
|
958 |
|
959 CMobilePhoneMbmsMskIdList::CMobilePhoneMbmsMskIdList() |
|
960 : CMobilePhoneReadOnlyList<RMobilePhone::TMskEntryV8>() |
|
961 /** |
|
962 Constructor. |
|
963 */ |
|
964 {} |
|
965 |
|
966 EXPORT_C CMobilePhoneMbmsMskIdList::~CMobilePhoneMbmsMskIdList() |
|
967 /** This member function destroys the CMobilePhoneMbmsMskIdList object and the inherited |
|
968 virtual destructor frees-up any resources used by its base classes. */ |
|
969 {} |
|
970 |
|
971 void CMobilePhoneMbmsMskIdList::ConstructL() |
|
972 {} |
|
973 |
|
974 /********************************************************************/ |
|
975 // |
|
976 // CMobilePhoneStoredWlanSIDList |
|
977 // A concrete instantion of an ETel list - holding RMobilePhone::TWlanSIDV8 objects |
|
978 // |
|
979 /********************************************************************/ |
|
980 |
|
981 EXPORT_C CMobilePhoneStoredWlanSIDList* CMobilePhoneStoredWlanSIDList::NewL() |
|
982 /** This member function creates a new instance of a CMobilePhoneStoredWlanSIDList. It will |
|
983 leave if the two-phase construction fails at any point. |
|
984 |
|
985 @return A pointer to the new instance of CMobilePhoneStoredWlanSIDList. |
|
986 @capability None |
|
987 */ |
|
988 { |
|
989 CMobilePhoneStoredWlanSIDList* r=new(ELeave) CMobilePhoneStoredWlanSIDList(); |
|
990 return r; |
|
991 } |
|
992 |
|
993 CMobilePhoneStoredWlanSIDList::CMobilePhoneStoredWlanSIDList() |
|
994 : CMobilePhoneEditableList<RMobilePhone::TWlanSIDV8>() |
|
995 {} |
|
996 |
|
997 EXPORT_C CMobilePhoneStoredWlanSIDList::~CMobilePhoneStoredWlanSIDList() |
|
998 /** Empty destructor. */ |
|
999 {} |
|
1000 |
|
1001 EXPORT_C TInt CMobilePhoneStoredWlanSIDList::InsertEntryL(TInt aIndex, const RMobilePhone::TWlanSIDV8& aEntry) |
|
1002 /** |
|
1003 Inserts an entry in the stored Wlan Specific identifier list. |
|
1004 |
|
1005 @param aIndex Index at which to insert the new entry. |
|
1006 @param aEntry Entry to be inserted. |
|
1007 @return KErrNone if successful; KErrArgument if operation is attempted on non-user defined (i.e. TWlanSIDV8.iUserDefined==EFalse) entry. |
|
1008 @capability WriteDeviceData |
|
1009 */ |
|
1010 { |
|
1011 if(IsEntryUserDefinedL(aIndex)) |
|
1012 { |
|
1013 CMobilePhoneEditableList<RMobilePhone::TWlanSIDV8>::InsertEntryL(aIndex, aEntry); |
|
1014 return KErrNone; |
|
1015 } |
|
1016 else |
|
1017 { |
|
1018 return KErrArgument; |
|
1019 } |
|
1020 } |
|
1021 |
|
1022 EXPORT_C TInt CMobilePhoneStoredWlanSIDList::ChangeEntryL(TInt aIndex, const RMobilePhone::TWlanSIDV8& aEntry) |
|
1023 /** |
|
1024 Changes an entry in the stored Wlan Specific identifier list. |
|
1025 |
|
1026 @param aIndex Index of entry to change. |
|
1027 @param aEntry Changed stored network entry. |
|
1028 @return KErrNone if successful; KErrArgument if operation is attempted on non-user defined (i.e. TWlanSIDV8.iUserDefined==EFalse) entry. |
|
1029 @capability WriteDeviceData |
|
1030 */ |
|
1031 { |
|
1032 if(IsEntryUserDefinedL(aIndex)) |
|
1033 { |
|
1034 CMobilePhoneEditableList<RMobilePhone::TWlanSIDV8>::ChangeEntryL(aIndex, aEntry); |
|
1035 return KErrNone; |
|
1036 } |
|
1037 else |
|
1038 { |
|
1039 return KErrArgument; |
|
1040 } |
|
1041 } |
|
1042 |
|
1043 EXPORT_C TInt CMobilePhoneStoredWlanSIDList::DeleteEntryL(TInt aIndex) |
|
1044 /** |
|
1045 Deletes an entry in the stored Wlan Specific identifier list. |
|
1046 |
|
1047 @param aIndex Index of entry to be deleted. |
|
1048 @return KErrNone if successful; KErrArgument if operation is attempted on non-user defined (i.e. TWlanSIDV8.iUserDefined==EFalse) entry. |
|
1049 @capability WriteDeviceData |
|
1050 */ |
|
1051 { |
|
1052 if(IsEntryUserDefinedL(aIndex)) |
|
1053 { |
|
1054 CMobilePhoneEditableList<RMobilePhone::TWlanSIDV8>::DeleteEntryL(aIndex); |
|
1055 return KErrNone; |
|
1056 } |
|
1057 else |
|
1058 { |
|
1059 return KErrArgument; |
|
1060 } |
|
1061 } |
|
1062 |
|
1063 TBool CMobilePhoneStoredWlanSIDList::IsEntryUserDefinedL(TInt aIndex) |
|
1064 { |
|
1065 if (aIndex < iList.Count() && !GetEntryL(aIndex).iUserDefined) |
|
1066 return EFalse; |
|
1067 return ETrue; |
|
1068 } |