51 virtual ~CPcsAlgorithm2Helper(); |
52 virtual ~CPcsAlgorithm2Helper(); |
52 |
53 |
53 private: |
54 private: |
54 |
55 |
55 /** |
56 /** |
56 * Filter subset results for ITU-T Mode. Entire search query is |
57 * Filter subset results for Mixed mode. Some portion of query can be in |
57 * entered in ITU-T mode. |
58 * ITU-T mode and some portion in Qwerty mode. |
58 */ |
59 */ |
59 void FilterResultsL(CPcsAlgorithm2FilterHelper* aAlgorithmFilterHelper, |
60 void FilterResultsSingleL(CPcsAlgorithm2FilterHelper* aAlgorithmFilterHelper, |
60 RPointerArray<CPcsPoolElement>& searchSet, |
61 RPointerArray<CPcsPoolElement>& aSearchSet, |
61 const TDesC& searchQuery, TBool isSearchInGroup, |
62 CPsQuery& aSearchQuery, |
62 RArray<TInt>& aContactsInGroup); |
63 TUint8 aFilteredDataMatch, |
|
64 TBool aIsSearchInGroup, |
|
65 const RArray<TInt>& aContactsInGroup); |
|
66 |
63 /** |
67 /** |
64 * Filter subset results for Qwerty Mode. Entire search query is |
68 * Create a buffer containing the first name and last name of a contact in the |
65 * entered in Qwerty mode. |
69 * order specified in Phonebook settings. |
66 */ |
70 */ |
67 void FilterResultsQwertyL(CPcsAlgorithm2FilterHelper* aAlgorithmFilterHelper, |
71 HBufC* CreateNameBufLC( const CPsData& aContactData, TInt aFirstNameIndex, TInt aLastNameIndex ) const; |
68 RPointerArray<CPcsPoolElement>& searchSet, |
72 |
69 const TDesC& searchQuery, TBool isSearchInGroup, |
73 /** |
70 RArray<TInt>& aContactsInGroup); |
74 * Get and store the order of first and last name. |
|
75 */ |
|
76 void UpdateNameOrderL(); |
71 |
77 |
|
78 private: // from MPbkGlobalSettingObserver |
72 /** |
79 /** |
73 * Filter subset results for Mixed mode. Some portion of query is in |
80 * React to change in Phonebook settings. |
74 * ITU-T mode and some portion in Qwert mode. |
|
75 */ |
81 */ |
76 void FilterResultsMixedL(CPcsAlgorithm2FilterHelper* aAlgorithmFilterHelper, |
82 void SettingChangedL( MPbkGlobalSetting::TPbkGlobalSetting aKey ); |
77 RPointerArray<CPcsPoolElement>& searchSet, |
83 |
78 CPsQuery& searchQuery, TBool isSearchInGroup, |
|
79 RArray<TInt>& aContactsInGroup); |
|
80 |
|
81 /** |
|
82 * Convert the search query to a string. |
|
83 * If the mode is ITU-T, character is converted to numeric. |
|
84 * If the mode is Qwerty, character is retained as is. |
|
85 */ |
|
86 void ExtractQueryL(CPsQuery& aPsQuery, TDes& aOutput); |
|
87 |
|
88 /** |
|
89 * Convert the input search query to a string. |
|
90 * Mode is referred in the CPsQuery. |
|
91 * If the mode is ITU-T, character is converted to numeric. |
|
92 * If the mode is Qwerty, character is retained as is. |
|
93 */ |
|
94 void ExtractQueryL(TDesC& aInput, CPsQuery& aPsQuery, TDes& aOutput); |
|
95 |
|
96 public: |
84 public: |
97 |
|
98 /** |
|
99 * Search Function for ITU-T style |
|
100 */ |
|
101 void SearchITUL(const CPsSettings& aSettings, CPsQuery& aQuery, |
|
102 TBool isGroupSearch, RArray<TInt>& aContactsInGroup, |
|
103 RPointerArray<CPsData>& searchResults, |
|
104 RPointerArray<CPsPattern>& searchSeqs); |
|
105 |
|
106 /** |
|
107 * Search Function for QWERTY style |
|
108 */ |
|
109 void SearchQWERTYL(const CPsSettings& aSettings, CPsQuery& aQuery, |
|
110 TBool isGroupSearch, RArray<TInt>& aContactsInGroup, |
|
111 RPointerArray<CPsData>& searchResults, |
|
112 RPointerArray<CPsPattern>& searchSeqs); |
|
113 |
85 |
114 /** |
86 /** |
115 * Search Function for mixed style |
87 * Search Function for mixed style |
116 * Some chars are entered in ITU-T and some in QWERTY |
88 * Some chars are entered in ITU-T and some in QWERTY |
117 */ |
89 */ |
118 void SearchMixedL(const CPsSettings& aSettings, CPsQuery& aQuery, |
90 void SearchSingleL(const CPsSettings& aSettings, |
119 TBool isGroupSearch, RArray<TInt>& aContactsInGroup, |
91 CPsQuery& aQuery, |
120 RPointerArray<CPsData>& searchResults, |
92 TBool aIsGroupSearch, |
121 RPointerArray<CPsPattern>& searchSeqs); |
93 const RArray<TInt>& aContactsInGroup, |
|
94 RPointerArray<CPsData>& aSearchResults, |
|
95 RPointerArray<CPsPattern>& aSearchSeqs); |
122 |
96 |
123 /** |
97 /** |
124 * Funciton to search matching sequences in the input text |
98 * Funciton to search matching sequences in the input text |
125 */ |
99 */ |
126 void SearchMatchSeqL(HBufC* aQuery, TDesC& aData, |
100 void SearchMatchSeqL(CPsQuery& aPsQuery, |
127 RPointerArray<TDesC>& aMatchSet, CPsQuery& aPsQuery, |
101 const TDesC& aData, |
|
102 RPointerArray<TDesC>& aMatchSet, |
128 RArray<TPsMatchLocation>& aMatchLocation); |
103 RArray<TPsMatchLocation>& aMatchLocation); |
129 |
104 |
130 /** |
105 /** |
131 * Sort search sequences |
106 * Sort search sequences |
132 */ |
107 */ |
133 void SortSearchSeqsL(RPointerArray<TDesC>& aMatchSet); |
108 void SortSearchSeqsL(RPointerArray<TDesC>& aMatchSet); |
134 |
109 |
135 private: |
|
136 |
|
137 /** |
|
138 * Constructs a bit pattern using the required/supported data fields |
|
139 * For example, 6, 4 and 27 are supported fields <-- 00000111 |
|
140 * 6 and 4 are required fields <-- 00000011 |
|
141 * Bit pattern returned is 00000011. |
|
142 */ |
|
143 TUint8 FilterDataFieldsL(RArray<TInt>& aRequiredDataFields, |
|
144 RArray<TInt>& aSupportedDataFields); |
|
145 private: |
110 private: |
146 |
111 |
147 /** |
112 /** |
148 * Constructor |
113 * Constructor |
149 */ |
114 */ |