|
1 // Copyright (c) 2006-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 |
|
18 // INCLUDE FILES |
|
19 #include "cmmpblist.h" |
|
20 #include "cmmphonetsy.h" |
|
21 #include "cmmphonebookstoretsy.h" |
|
22 |
|
23 // ======== MEMBER FUNCTIONS ======== |
|
24 |
|
25 CMmPBList* CMmPBList::NewL( |
|
26 CMmPhoneTsy* aMmPhone ) |
|
27 { |
|
28 CMmPBList* aPBList = NULL; |
|
29 |
|
30 if( NULL != aMmPhone ) |
|
31 { |
|
32 aPBList = new (ELeave) CMmPBList(); |
|
33 CleanupStack::PushL( aPBList ); |
|
34 aPBList->iMmPhone = aMmPhone; |
|
35 aPBList->ConstructL(); |
|
36 CleanupStack::Pop(); |
|
37 } |
|
38 |
|
39 return aPBList; |
|
40 } |
|
41 |
|
42 CMmPBList::CMmPBList() |
|
43 { |
|
44 } |
|
45 |
|
46 void CMmPBList::ConstructL() |
|
47 { |
|
48 //Create phonebook container |
|
49 CreateContainerL(); |
|
50 } |
|
51 |
|
52 CMmPBList::~CMmPBList() |
|
53 { |
|
54 //delete object container |
|
55 DeleteContainer(); |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------------------------- |
|
59 // CMmPBList::GetMmPBByIndex |
|
60 // Returns mm PB by index. The indexing begins from 0 |
|
61 // (other items were commented in a header). |
|
62 // --------------------------------------------------------------------------- |
|
63 // |
|
64 CMmPhoneBookStoreTsy* CMmPBList::GetMmPBByIndex( |
|
65 TInt aIndex ) |
|
66 { |
|
67 if( iObjectContainer ) |
|
68 { |
|
69 if( aIndex >= 0 && aIndex < iObjectContainer->Count() ) |
|
70 { |
|
71 return (CMmPhoneBookStoreTsy*) (iObjectContainer->At( aIndex )); |
|
72 } |
|
73 } |
|
74 |
|
75 return NULL; |
|
76 } |
|
77 |
|
78 // End of File |
|
79 |
|
80 |
|
81 |