51 _LIT(KContactsPostcodeField, "PostCode"); |
52 _LIT(KContactsPostcodeField, "PostCode"); |
52 _LIT(KContactsCountryField, "Country"); |
53 _LIT(KContactsCountryField, "Country"); |
53 _LIT(KContactsSIPIDField, "SIPID"); |
54 _LIT(KContactsSIPIDField, "SIPID"); |
54 _LIT(KContactsSpouseField, "Spouse"); |
55 _LIT(KContactsSpouseField, "Spouse"); |
55 _LIT(KContactsChildrenField, "Children"); |
56 _LIT(KContactsChildrenField, "Children"); |
56 _LIT(KContactsClassField, "Class"); |
57 //_LIT(KContactsClassField, "Class"); |
57 _LIT(KContactsPrefixField, "Prefix"); |
58 _LIT(KContactsPrefixField, "Prefix"); |
58 _LIT(KContactsAdditionalNameField, "AdditionalName"); |
59 _LIT(KContactsAdditionalNameField, "AdditionalName"); |
59 _LIT(KContactsFaxField, "Fax"); |
60 _LIT(KContactsFaxField, "Fax"); |
60 _LIT(KContactsGivenNamePronunciationField, "GivenNamePronunciation"); |
61 _LIT(KContactsDepartmentName, "Departmant"); |
61 _LIT(KContactsFamilyNamePronunciationField, "FamilyNamePronunciation"); |
62 _LIT(KContactIMAddress, "IMAddress"); |
62 _LIT(KContactsCompanyNamePronunciationField, "CompanyNamePronunciation"); |
63 _LIT(KContactServiceProvider, "ServiceProvider"); |
63 |
64 _LIT(KContactAssistant, "Assistant"); |
|
65 _LIT(KContactAnniversary, "Anniversary"); |
|
66 _LIT(KContactBirthday, "Birthday"); |
|
67 _LIT(KDateSeparator, "-"); |
|
68 const TInt KDateFieldLength = 10; |
|
69 const TInt KDayPosition = 8; |
|
70 const TInt KMonthPosition = 5; |
|
71 const TInt KYearPosition = 0; |
|
72 const TInt KDayLength = 2; |
|
73 const TInt KYearLength = 4; |
64 |
74 |
65 class CContactsPlugin : public CIndexingPlugin, public MContactDbObserver, public MDelayedCallbackObserver |
75 class CContactsPlugin : public CIndexingPlugin, public MContactDbObserver, public MDelayedCallbackObserver |
66 { |
76 { |
67 public: |
77 public: |
68 static CContactsPlugin* NewL(); |
78 static CContactsPlugin* NewL(); |
91 void ConstructL(); |
101 void ConstructL(); |
92 |
102 |
93 /** |
103 /** |
94 * Adds information field (if available) |
104 * Adds information field (if available) |
95 */ |
105 */ |
96 void AddFieldL(CSearchDocument& aDocument, CContactItemFieldSet& aFieldSet, TUid aFieldId, const TDesC& aFieldName ); |
106 void AddFieldL(CSearchDocument& aDocument, CContactItemFieldSet& aFieldSet, TUid aFieldId, const TDesC& aFieldName, const TInt aConfig = CDocumentField::EStoreYes | CDocumentField::EIndexTokenized); |
97 |
107 |
|
108 /** |
|
109 * Gets the date from anniversary text field |
|
110 */ |
|
111 void GetDateL(const TDesC& aTime, TDes& aDateString); |
98 /** |
112 /** |
99 * Adds to excerpt |
113 * Adds to excerpt |
100 */ |
114 */ |
101 void AddToExcerptL(CSearchDocument& aDocument, CContactItemFieldSet& aFieldSet, TUid aFieldId, const TDesC& aFieldName ); |
115 void AddToExcerptL(CSearchDocument& aDocument, CContactItemFieldSet& aFieldSet, TUid aFieldId, const TDesC& aFieldName ); |
102 |
116 |
103 /** |
117 /** |
104 * Helper function: adds information field to the document and to the excerpt field(if available) |
118 * Helper function: adds information field to the document and to the excerpt field(if available) |
105 */ |
119 */ |
106 void AddFieldToDocumentAndExcerptL(CSearchDocument& aDocument, CContactItemFieldSet& aFieldSet, TUid aFieldId, const TDesC& aFieldName ); |
120 void AddFieldToDocumentAndExcerptL(CSearchDocument& aDocument, CContactItemFieldSet& aFieldSet, TUid aFieldId, const TDesC& aFieldName, const TInt aConfig = CDocumentField::EStoreYes | CDocumentField::EIndexTokenized ); |
107 |
121 |
108 /** |
122 /** |
109 * Creates the actual contact book index item |
123 * Creates the actual contact book index item |
110 */ |
124 */ |
111 void CreateContactIndexItemL(TInt aContentId, TCPixActionType aActionType); |
125 void CreateContactIndexItemL(TInt aContentId, TCPixActionType aActionType); |