|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Contact model class for MyCard |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "spbcontactdatamodel.h" |
|
19 #include "spbcontactdatamodelprivate.h" |
|
20 |
|
21 |
|
22 // --------------------------------------------------------------------------- |
|
23 // CSpbContactDataModel::NewL |
|
24 // --------------------------------------------------------------------------- |
|
25 // |
|
26 EXPORT_C CSpbContactDataModel* CSpbContactDataModel::NewL( |
|
27 CVPbkContactManager& aCntManager, |
|
28 CCoeEnv& aCoeEnv, |
|
29 TInt aFieldTypeSelectorRes, |
|
30 MPbk2ClipListBoxText* aClip ) |
|
31 { |
|
32 CSpbContactDataModel* self = new (ELeave) CSpbContactDataModel; |
|
33 CleanupStack::PushL(self); |
|
34 self->iImpl = CSpbContactDataModelPrivate::NewL( |
|
35 aCntManager, aCoeEnv, aFieldTypeSelectorRes, aClip ); |
|
36 CleanupStack::Pop(self); |
|
37 return self; |
|
38 } |
|
39 |
|
40 // --------------------------------------------------------------------------- |
|
41 // CSpbContactDataModel::~CSpbContactDataModel |
|
42 // --------------------------------------------------------------------------- |
|
43 // |
|
44 CSpbContactDataModel::~CSpbContactDataModel() |
|
45 { |
|
46 delete iImpl; |
|
47 } |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // CSpbContactDataModel::PresentationFieldIndex |
|
51 // --------------------------------------------------------------------------- |
|
52 // |
|
53 EXPORT_C TInt CSpbContactDataModel::PresentationFieldIndex( TInt aListIndex ) |
|
54 { |
|
55 return iImpl->PresentationFieldIndex( aListIndex ); |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------------------------- |
|
59 // CSpbContactDataModel::PresentationFieldIndex |
|
60 // --------------------------------------------------------------------------- |
|
61 // |
|
62 EXPORT_C TInt CSpbContactDataModel::ListIndex( TInt aPresentationIndex ) |
|
63 { |
|
64 return iImpl->ListIndex( aPresentationIndex ); |
|
65 } |
|
66 |
|
67 // -------------------------------------------------------------------------- |
|
68 // CSpbContactDataModel::ExternalizeL |
|
69 // -------------------------------------------------------------------------- |
|
70 // |
|
71 EXPORT_C void CSpbContactDataModel::ExternalizeL( RWriteStream& aStream ) const |
|
72 { |
|
73 iImpl->ExternalizeL( aStream ); |
|
74 } |
|
75 |
|
76 // -------------------------------------------------------------------------- |
|
77 // CSpbContactDataModel::InternalizeL |
|
78 // -------------------------------------------------------------------------- |
|
79 // |
|
80 EXPORT_C void CSpbContactDataModel::InternalizeL( RReadStream& aStream ) |
|
81 { |
|
82 iImpl->InternalizeL( aStream ); |
|
83 } |
|
84 |
|
85 // -------------------------------------------------------------------------- |
|
86 // CSpbContactDataModel::SetDataL |
|
87 // -------------------------------------------------------------------------- |
|
88 // |
|
89 EXPORT_C void CSpbContactDataModel::SetDataL( |
|
90 const CPbk2PresentationContact& aContact, |
|
91 const CPbk2IconArray* aIconArray ) |
|
92 { |
|
93 iImpl->SetDataL( aContact, aIconArray ); |
|
94 } |
|
95 |
|
96 // -------------------------------------------------------------------------- |
|
97 // CSpbContactDataModel::ContactLink |
|
98 // -------------------------------------------------------------------------- |
|
99 // |
|
100 EXPORT_C MVPbkContactLink* CSpbContactDataModel::ContactLink() |
|
101 { |
|
102 return iImpl->ContactLink(); |
|
103 } |
|
104 |
|
105 // -------------------------------------------------------------------------- |
|
106 // CSpbContactDataModel::IsEmpty |
|
107 // -------------------------------------------------------------------------- |
|
108 // |
|
109 EXPORT_C TBool CSpbContactDataModel::IsEmpty() |
|
110 { |
|
111 return iImpl->IsEmpty(); |
|
112 } |
|
113 |
|
114 // -------------------------------------------------------------------------- |
|
115 // CSpbContactDataModel::Reset |
|
116 // -------------------------------------------------------------------------- |
|
117 // |
|
118 EXPORT_C void CSpbContactDataModel::Reset() |
|
119 { |
|
120 iImpl->Reset(); |
|
121 } |
|
122 |
|
123 // -------------------------------------------------------------------------- |
|
124 // CSpbContactDataModel::Text |
|
125 // -------------------------------------------------------------------------- |
|
126 // |
|
127 EXPORT_C TPtrC CSpbContactDataModel::Text( TTextTypes aType ) const |
|
128 { |
|
129 return iImpl->Text( aType ); |
|
130 } |
|
131 |
|
132 // -------------------------------------------------------------------------- |
|
133 // CSpbContactDataModel::Data |
|
134 // -------------------------------------------------------------------------- |
|
135 // |
|
136 EXPORT_C TPtrC8 CSpbContactDataModel::Data( TBinaryTypes aType ) const |
|
137 { |
|
138 return iImpl->Data( aType ); |
|
139 } |
|
140 |
|
141 // -------------------------------------------------------------------------- |
|
142 // CSpbContactDataModel::SetIconArrayL |
|
143 // -------------------------------------------------------------------------- |
|
144 // |
|
145 EXPORT_C void CSpbContactDataModel::UpdateIconsL( const CPbk2IconArray& aIconArray ) |
|
146 { |
|
147 iImpl->UpdateIconsL( aIconArray ); |
|
148 } |
|
149 |
|
150 // -------------------------------------------------------------------------- |
|
151 // CSpbContactDataModel::SetClipListBoxText |
|
152 // -------------------------------------------------------------------------- |
|
153 // |
|
154 EXPORT_C void CSpbContactDataModel::SetClipListBoxText( MPbk2ClipListBoxText* aClip ) |
|
155 { |
|
156 iImpl->SetClipListBoxText( aClip ); |
|
157 } |
|
158 |
|
159 // -------------------------------------------------------------------------- |
|
160 // CSpbContactDataModel::ListBoxModel |
|
161 // -------------------------------------------------------------------------- |
|
162 // |
|
163 EXPORT_C MDesCArray& CSpbContactDataModel::ListBoxModel() |
|
164 { |
|
165 return *iImpl; |
|
166 } |
|
167 |
|
168 // End of File |