331 CPIXLOGSTRING2("Adding Contact Group %S", &( static_cast<CContactGroup*>( contact )->GetGroupLabelL() ) ); |
342 CPIXLOGSTRING2("Adding Contact Group %S", &( static_cast<CContactGroup*>( contact )->GetGroupLabelL() ) ); |
332 index_item->AddExcerptL( static_cast<CContactGroup*>( contact )->GetGroupLabelL() ); |
343 index_item->AddExcerptL( static_cast<CContactGroup*>( contact )->GetGroupLabelL() ); |
333 } |
344 } |
334 else//If the contact item is a regular contact. |
345 else//If the contact item is a regular contact. |
335 { |
346 { |
336 CContactItemFieldSet& fieldSet = contact->CardFields(); |
|
337 AddFieldL( *index_item, fieldSet, KUidContactFieldGivenName, KContactsGivenNameField ); |
|
338 AddFieldL( *index_item, fieldSet, KUidContactFieldFamilyName, KContactsFamilyNameField ); |
|
339 AddFieldL( *index_item, fieldSet, KUidContactFieldCompanyName, KContactsCompanyNameField ); |
|
340 AddFieldL( *index_item, fieldSet, KUidContactFieldPhoneNumber, KContactsPhoneNumberField ); |
|
341 AddFieldL( *index_item, fieldSet, KUidContactFieldAddress, KContactsAddressField ); |
|
342 AddFieldL( *index_item, fieldSet, KUidContactFieldNote, KContactsNoteField ); |
|
343 AddFieldL( *index_item, fieldSet, KUidContactFieldJobTitle, KContactsJobTitleField ); |
|
344 AddFieldL( *index_item, fieldSet, KUidContactFieldSecondName, KContactsSecondNameField ); |
|
345 |
|
346 AddFieldL( *index_item, fieldSet, KUidContactFieldPrefixName, KContactsPrefixField ); |
|
347 AddFieldL( *index_item, fieldSet, KUidContactFieldSuffixName, KContactsSuffixField ); |
|
348 AddFieldL( *index_item, fieldSet, KUidContactFieldAdditionalName, KContactsAdditionalNameField ); |
|
349 AddFieldL( *index_item, fieldSet, KUidContactFieldEMail, KContactsEMailField ); |
|
350 AddFieldL( *index_item, fieldSet, KUidContactFieldUrl, KContactsUrlField ); |
|
351 |
|
352 AddFieldL( *index_item, fieldSet, KUidContactFieldPostOffice, KContactsPostOfficeField ); |
|
353 AddFieldL( *index_item, fieldSet, KUidContactFieldExtendedAddress, KContactsExtendedAddressField ); |
|
354 AddFieldL( *index_item, fieldSet, KUidContactFieldLocality, KContactsLocalityField ); |
|
355 AddFieldL( *index_item, fieldSet, KUidContactFieldRegion, KContactsRegionField ); |
|
356 AddFieldL( *index_item, fieldSet, KUidContactFieldPostcode, KContactsPostcodeField ); |
|
357 AddFieldL( *index_item, fieldSet, KUidContactFieldCountry, KContactsCountryField ); |
|
358 |
|
359 AddFieldL( *index_item, fieldSet, KUidContactFieldSIPID, KContactsSIPIDField ); |
|
360 AddFieldL( *index_item, fieldSet, KUidContactFieldSpouse, KContactsSpouseField ); |
|
361 AddFieldL( *index_item, fieldSet, KUidContactFieldChildren, KContactsChildrenField ); |
|
362 AddFieldL( *index_item, fieldSet, KUidContactFieldClass, KContactsClassField ); |
|
363 AddFieldL( *index_item, fieldSet, KUidContactFieldFax, KContactsFaxField ); |
|
364 |
|
365 AddFieldL( *index_item, fieldSet, KUidContactFieldGivenNamePronunciation, KContactsGivenNamePronunciationField ); |
|
366 AddFieldL( *index_item, fieldSet, KUidContactFieldFamilyNamePronunciation, KContactsFamilyNamePronunciationField ); |
|
367 AddFieldL( *index_item, fieldSet, KUidContactFieldCompanyNamePronunciation, KContactsCompanyNamePronunciationField ); |
|
368 //left: Birthday; Anniversary (date kind of type), Picture, Logo.. |
|
369 |
|
370 if (iExcerpt) |
347 if (iExcerpt) |
371 { |
348 { |
372 delete iExcerpt; |
349 delete iExcerpt; |
373 iExcerpt = NULL; |
350 iExcerpt = NULL; |
374 } |
351 } |
375 iExcerpt = HBufC::NewL(2); |
352 iExcerpt = HBufC::NewL(2); |
376 AddToExcerptL( *index_item, fieldSet, KUidContactFieldGivenName, KContactsGivenNameField ); |
353 |
377 AddToExcerptL( *index_item, fieldSet, KUidContactFieldFamilyName, KContactsFamilyNameField ); |
354 CContactItemFieldSet& fieldSet = contact->CardFields(); |
378 AddToExcerptL( *index_item, fieldSet, KUidContactFieldPhoneNumber, KContactsPhoneNumberField ); |
355 |
379 AddToExcerptL( *index_item, fieldSet, KUidContactFieldCompanyName, KContactsCompanyNameField ); |
356 //For contacts, all fields __except__ GivenName and FamilyName should be added to excerpt. |
380 AddToExcerptL( *index_item, fieldSet, KUidContactFieldLocality, KContactsLocalityField ); |
357 //See appclass-hierarchy.txt for details. |
381 AddToExcerptL( *index_item, fieldSet, KUidContactFieldCountry, KContactsCountryField ); |
358 /* The order of fields in excerpt is as below. The order in this case |
|
359 * is the order of fields shown when you 'Edit' the contact. |
|
360 */ |
|
361 AddFieldL( *index_item, fieldSet, KUidContactFieldGivenName, KContactsGivenNameField ); |
|
362 AddFieldL( *index_item, fieldSet, KUidContactFieldFamilyName, KContactsFamilyNameField ); |
|
363 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldPhoneNumber, KContactsPhoneNumberField ); |
|
364 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldEMail, KContactsEMailField ); |
|
365 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldSIPID, KContactsSIPIDField ); |
|
366 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldCompanyName, KContactsCompanyNameField ); |
|
367 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldJobTitle, KContactsJobTitleField ); |
|
368 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldNote, KContactsNoteField ); |
|
369 |
|
370 /* The following fields are not displayed when 'Edit'-ing the contact. |
|
371 * The order here is arbitrary. |
|
372 */ |
|
373 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldAddress, KContactsAddressField ); |
|
374 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldSecondName, KContactsSecondNameField ); |
|
375 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldPrefixName, KContactsPrefixField ); |
|
376 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldSuffixName, KContactsSuffixField ); |
|
377 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldAdditionalName, KContactsAdditionalNameField ); |
|
378 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldUrl, KContactsUrlField ); |
|
379 |
|
380 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldPostOffice, KContactsPostOfficeField ); |
|
381 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldExtendedAddress, KContactsExtendedAddressField ); |
|
382 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldLocality, KContactsLocalityField ); |
|
383 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldRegion, KContactsRegionField ); |
|
384 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldPostcode, KContactsPostcodeField ); |
|
385 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldCountry, KContactsCountryField ); |
|
386 |
|
387 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldSpouse, KContactsSpouseField ); |
|
388 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldChildren, KContactsChildrenField ); |
|
389 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldClass, KContactsClassField ); |
|
390 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldFax, KContactsFaxField ); |
|
391 |
|
392 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldGivenNamePronunciation, KContactsGivenNamePronunciationField ); |
|
393 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldFamilyNamePronunciation, KContactsFamilyNamePronunciationField ); |
|
394 AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldCompanyNamePronunciation, KContactsCompanyNamePronunciationField ); |
|
395 //left: Birthday; Anniversary (date kind of type), Picture, Logo.. |
|
396 |
382 index_item->AddExcerptL(*iExcerpt); |
397 index_item->AddExcerptL(*iExcerpt); |
383 } |
398 } |
384 |
399 |
385 index_item->AddFieldL(KMimeTypeField, KMimeTypeContact, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
400 index_item->AddFieldL(KMimeTypeField, KMimeTypeContact, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
386 |
401 |