115 |
115 |
116 // Fill data element cells |
116 // Fill data element cells |
117 |
117 |
118 // (1) Add thumbnail icon |
118 // (1) Add thumbnail icon |
119 // |
119 // |
120 // TODO: to be fixed |
|
121 //const TPbk2IconId& thumb = iThumbManager.GetPbkIconIndex( aIndex, aViewContact ); |
|
122 //element->SetIconId( MPbk2DoubleListboxDataElement::EThumbnail, thumb ); |
|
123 // -- temporary sollution: |
|
124 TInt index = iThumbManager.GetPbkIconIndexL( aIndex, aViewContact ); |
120 TInt index = iThumbManager.GetPbkIconIndexL( aIndex, aViewContact ); |
125 if( index != KErrNotFound ) |
121 if( index != KErrNotFound ) |
126 { |
122 { |
127 iBuffer.AppendNum( index ); |
123 iBuffer.AppendNum( index ); |
128 } |
124 } |
129 iBuffer.Append( KListColumnSeparator ); |
125 iBuffer.Append( KListColumnSeparator ); |
130 // -- |
|
131 |
126 |
132 // (2) Add contact name |
127 // (2) Add contact name |
133 // |
128 // |
134 HBufC* name = NULL; |
129 HBufC* name = NULL; |
135 if( FeatureManager::FeatureSupported( KFeatureIdFfContactsCompanyNames )) |
130 if( FeatureManager::FeatureSupported( KFeatureIdFfContactsCompanyNames )) |
160 // takes ownership of 'name' |
155 // takes ownership of 'name' |
161 element->SetText( MPbk2DoubleListboxDataElement::EName, name, |
156 element->SetText( MPbk2DoubleListboxDataElement::EName, name, |
162 MPbk2DoubleListboxDataElement::ETypeGenericText ); |
157 MPbk2DoubleListboxDataElement::ETypeGenericText ); |
163 CleanupStack::Pop( name ); |
158 CleanupStack::Pop( name ); |
164 |
159 |
165 // (3, 4) Secondary text and icon |
160 // (3) Secondary text |
166 // |
161 // |
167 // -> These are empty by default |
162 // => Empty by default |
168 |
163 |
169 |
164 // (4) Trailing icon |
170 // (5) Trailing icon |
|
171 // |
165 // |
172 RArray<TPbk2IconId> ids; |
166 RArray<TPbk2IconId> ids; |
173 CleanupClosePushL( ids ); |
167 CleanupClosePushL( ids ); |
174 iContactIcons->GetIconIdsForContactL( aViewContact, ids ); |
168 iContactIcons->GetIconIdsForContactL( aViewContact, ids ); |
175 |
169 |
220 const CPbk2ContactViewDoubleListboxDataElement& aElement ) const |
214 const CPbk2ContactViewDoubleListboxDataElement& aElement ) const |
221 { |
215 { |
222 |
216 |
223 // List model format: |
217 // List model format: |
224 // [thumbnail icon] \t [contact name] \t [secondary text] \t |
218 // [thumbnail icon] \t [contact name] \t [secondary text] \t |
225 // [secondary icon] \t [trailing icon] |
219 // [trailing icon] |
226 |
220 |
227 // (1) Thumbnail icon |
221 // (1) Thumbnail icon |
228 // TODO: to be fixed |
222 // No element support needed for thumbnail at the moment |
229 //AppendIconIndex( |
|
230 // aElement.IconId( MPbk2DoubleListboxDataElement::EThumbnail ) ); |
|
231 |
223 |
232 // (2) Contact name |
224 // (2) Contact name |
233 AppendName( aElement.TextPtr( MPbk2DoubleListboxDataElement::EName ) ); |
225 AppendName( aElement.TextPtr( MPbk2DoubleListboxDataElement::EName ) ); |
234 iBuffer.Append( KListColumnSeparator ); |
226 iBuffer.Append( KListColumnSeparator ); |
235 |
227 |
236 // (3) Secondary text |
228 // (3) Secondary text |
237 TPtr status( aElement.TextPtr( MPbk2DoubleListboxDataElement::EStatusText ) ); |
229 TPtr status( aElement.TextPtr( MPbk2DoubleListboxDataElement::EStatusText ) ); |
238 AppendText( status ); |
230 AppendText( status ); |
239 |
231 |
240 #if 0 // Service icon is removed for now. |
232 // (4) Trailing icon |
241 // (4) Secondary icon |
|
242 AppendIconIndexIfFound( |
|
243 aElement.IconId( MPbk2DoubleListboxDataElement::EServiceIcon ) ); |
|
244 #endif |
|
245 |
|
246 // (5) Trailing icon |
|
247 AppendIconIndexIfFound( |
233 AppendIconIndexIfFound( |
248 aElement.IconId( MPbk2DoubleListboxDataElement::EMainIcon ) ); |
234 aElement.IconId( MPbk2DoubleListboxDataElement::EMainIcon ) ); |
249 } |
235 } |
250 |
236 |
251 // -------------------------------------------------------------------------- |
237 // -------------------------------------------------------------------------- |
252 // CPbk2ContactViewDoubleListBoxModel::AppendText |
238 // CPbk2ContactViewDoubleListBoxModel::AppendText |
253 // -------------------------------------------------------------------------- |
239 // -------------------------------------------------------------------------- |
254 // |
240 // |
255 void CPbk2ContactViewDoubleListBoxModel::AppendText( TDes& aText ) const |
241 void CPbk2ContactViewDoubleListBoxModel::AppendText( TDes& aText ) const |
256 { |
242 { |
|
243 //Convert numbers to some languages specific version. E.g.: Arabic. |
|
244 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( aText ); |
|
245 |
257 // replace non-allowed characters with ' ' |
246 // replace non-allowed characters with ' ' |
258 Pbk2PresentationUtils::ReplaceNonGraphicCharacters( |
247 Pbk2PresentationUtils::ReplaceNonGraphicCharacters( |
259 aText, KGraphicReplaceCharacter ); |
248 aText, KGraphicReplaceCharacter ); |
260 AknTextUtils::ReplaceCharacters( |
249 AknTextUtils::ReplaceCharacters( |
261 aText, KAknReplaceListControlChars, KGraphicReplaceCharacter ); |
250 aText, KAknReplaceListControlChars, KGraphicReplaceCharacter ); |