author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:15:33 +0300 | |
branch | RCL_3 |
changeset 85 | 38bb213f60ba |
parent 63 | f4a778e096c2 |
permissions | -rw-r--r-- |
63 | 1 |
/* |
2 |
* Copyright (c) 2006-2007 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: Identifies a contact in cache pools |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef __FINDUTILCHINESE_ECE__ |
|
19 |
#define __FINDUTILCHINESE_ECE__ |
|
20 |
||
21 |
// INCLUDES |
|
22 |
#include <e32base.h> |
|
23 |
||
24 |
// FORWARD DECLARATION |
|
25 |
class CPtiEngine; |
|
26 |
class CPcsAlgorithm2; |
|
27 |
class CFindRepositoryWatcher; |
|
28 |
class CRepository; |
|
29 |
class CPsQuery; |
|
30 |
||
31 |
// CONSTANTS |
|
32 |
const TInt KMaxWordLength = 128; |
|
33 |
const TInt KMaxWordInterpretationLen = 255; |
|
34 |
/** |
|
35 |
||
36 |
Defines flags that can be used to indicate what is the default search method for each language. |
|
37 |
*/ |
|
38 |
||
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
39 |
enum TDefaultAdaptiveSearchMethod |
63 | 40 |
{ |
41 |
EAdptSearchPinyin =0, |
|
42 |
EAdptSearchStroke, |
|
43 |
EAdptSearchZhuyin, |
|
44 |
EAdptSearchNormalCangjie, |
|
45 |
EAdptSearchEasyCangjie, |
|
46 |
EAdptSearchAdvCangjie |
|
47 |
}; |
|
48 |
/** |
|
49 |
* STRINGINFO struct |
|
50 |
* |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
51 |
* This data struct is for splited taxt in find pane. |
63 | 52 |
* It includes two type word, which is Chinese or no-Chinese |
53 |
* |
|
54 |
* @lib FindUtil.dll |
|
55 |
* @since S60 v3.2 |
|
56 |
*/ |
|
57 |
struct STRINGINFO |
|
58 |
{ |
|
59 |
TBuf<KMaxWordLength> segmentString; |
|
60 |
TBool isChinese; |
|
61 |
}; |
|
62 |
||
63 |
/** |
|
64 |
* CFindUtilChineseECE utils class |
|
65 |
* |
|
66 |
* This class is Chinese find utils class. It handle Chinese variant find |
|
67 |
* in PhoneBook, LandMark, Clock and so on. |
|
68 |
* |
|
69 |
* @lib FindUtil.dll |
|
70 |
* @since S60 v3.2 |
|
71 |
*/ |
|
72 |
class CFindUtilChineseECE : public CBase |
|
73 |
{ |
|
74 |
public: |
|
75 |
||
76 |
/** |
|
77 |
* Match arithmetic for general search |
|
78 |
* |
|
79 |
* @since S60 v3.2 |
|
80 |
* @param aContactsField Reference to the searching target |
|
81 |
* @param aWord Reference to text in find pane |
|
82 |
* @return ETrue for the text are matched; otherwise EFalse |
|
83 |
*/ |
|
84 |
virtual TBool Match(const TDesC& aContactsField, const TDesC& aWord); |
|
85 |
||
86 |
/** |
|
87 |
* Match arithmetic for accurate search |
|
88 |
* |
|
89 |
* @since S60 v3.2 |
|
90 |
* @param aItemString Reference to the searching target |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
91 |
* @param aWord Reference to text in find pane |
63 | 92 |
* @return ETrue for the text are matched; otherwise EFalse |
93 |
*/ |
|
94 |
virtual TBool MatchRefineL(const TDesC& aItemString, CPsQuery& aPsQuery); |
|
95 |
||
96 |
/** |
|
97 |
* Current input text is handled by this model |
|
98 |
* |
|
99 |
* @since S60 v3.2 |
|
100 |
* @param aWord Reference to text in find pane |
|
101 |
* @return ETrue for handling by this model; otherwise EFalse |
|
102 |
*/ |
|
103 |
virtual TBool IsWordValidForMatching(const TDesC& aWord); |
|
104 |
||
105 |
// The below code is commented out because current CFindUtilChineseECE is used |
|
106 |
// on 3.2.3 which is not supported adaptive search. It will be easy to keep these code |
|
107 |
// for the further merging work (merge from FindUtil 5.0) |
|
108 |
#if 0 |
|
109 |
/** |
|
110 |
* From MFindUtil It tests a partial matching. |
|
111 |
* @since 5.0 |
|
112 |
* @param aItemString is a field string |
|
113 |
* @param aSearchText is a search string |
|
114 |
* @param aNextChars is a reference to buffer where next possible characters are saved. |
|
115 |
* The HBufC buffer may be re-allocated by this method. |
|
116 |
* In that case the pointer reference is modified to point to the re-allocated object. |
|
117 |
* @return If aSearchText has been found in aItemString, |
|
118 |
* ETrue is returned. |
|
119 |
*/ |
|
120 |
TBool MatchAdaptiveRefineL( const TDesC& aItemString, |
|
121 |
const TDesC& aSearchText, |
|
122 |
HBufC*& aNextChars); |
|
123 |
#endif |
|
124 |
||
125 |
/** |
|
126 |
* Create ptiengine and initialize member data |
|
127 |
* |
|
128 |
* @since S60 v3.2 |
|
129 |
* @return none |
|
130 |
*/ |
|
131 |
virtual void OpenL(); |
|
132 |
||
133 |
/** |
|
134 |
* From CFindUtilBase |
|
135 |
* Close ptiEngine |
|
136 |
* |
|
137 |
* @since S60 v3.2 |
|
138 |
* @return none |
|
139 |
*/ |
|
140 |
virtual void Close(); |
|
141 |
||
142 |
/** |
|
143 |
* Symbian constructor |
|
144 |
* |
|
145 |
* @since S60 v3.2 |
|
146 |
* @return Pointer to created CFindUtilChineseECE object |
|
147 |
*/ |
|
148 |
static CFindUtilChineseECE* NewL(CPcsAlgorithm2* aAlgorithm); |
|
149 |
||
150 |
||
151 |
||
152 |
public: |
|
153 |
||
154 |
/** |
|
155 |
* C++ default constructor |
|
156 |
* |
|
157 |
* @since S60 v3.2 |
|
158 |
* @return None |
|
159 |
*/ |
|
160 |
CFindUtilChineseECE(); |
|
161 |
||
162 |
/** |
|
163 |
* Destructor |
|
164 |
* |
|
165 |
* @since S60 v3.2 |
|
166 |
* @return None |
|
167 |
*/ |
|
168 |
~CFindUtilChineseECE(); |
|
169 |
||
170 |
public: |
|
171 |
||
172 |
/** |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
173 |
* Do translate for Chinese word |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
174 |
* |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
175 |
* @since S60 v3.2 |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
176 |
* @param aHZUnicode For translate word |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
177 |
* @param aSpellList Reference to spelling list for polyphonic word |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
178 |
* @return ETrue for it can be translated; otherwise EFalse |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
179 |
*/ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
180 |
TBool T9ChineseTranslationL(TInt16 aHZUnicode, RPointerArray<HBufC>& aSpellList); |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
181 |
|
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
182 |
/** |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
183 |
* Find pane text is including Chinese word |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
184 |
* |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
185 |
* @since S60 v3.2 |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
186 |
* @param aWord Reference to text for analyse |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
187 |
* @return ETrue it includes Chinese; otherwise EFalse |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
188 |
*/ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
189 |
TBool IsChineseWord(const TDesC& aWord); |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
190 |
|
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
191 |
/* |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
192 |
* |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
193 |
*/ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
194 |
void SetKeyboardMode(TInt aMode); |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
195 |
|
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
196 |
/** |
63 | 197 |
* Translate Chinese word to its spelling |
198 |
* |
|
199 |
* @since S60 v3.2 |
|
200 |
* @param aHZUnicode For translate word |
|
201 |
* @param aSpellList Reference to spelling list for polyphonic word |
|
202 |
* @return ETrue for this word can be translated; otherwise EFalse |
|
203 |
*/ |
|
204 |
TBool DoTranslationL(TInt16 aHZUnicode, RPointerArray<HBufC>& aSpellList); |
|
205 |
||
206 |
/* |
|
207 |
* |
|
208 |
*/ |
|
209 |
inline TLanguage CurrentInputLanguage() |
|
210 |
{ |
|
211 |
return iLanguage; |
|
212 |
} |
|
213 |
||
214 |
private: |
|
215 |
||
216 |
/** |
|
217 |
* Symbian second-phase constructor |
|
218 |
* |
|
219 |
* @since S60 v3.2 |
|
220 |
* @return None |
|
221 |
*/ |
|
222 |
void ConstructL(CPcsAlgorithm2* aAlgorithm); |
|
223 |
||
224 |
/** |
|
225 |
* Open ptiengine and active it by input language |
|
226 |
* |
|
227 |
* @since S60 v3.2 |
|
228 |
* @param aLanguage Actived language |
|
229 |
* @return ETrue for opening ptiengine successfully; otherwise EFalse |
|
230 |
*/ |
|
231 |
TBool OpenT9InterfaceL(TLanguage aLanguage); |
|
232 |
||
233 |
/** |
|
234 |
* Close ptiengine |
|
235 |
* |
|
236 |
* @since S60 v3.2 |
|
237 |
* @return none |
|
238 |
*/ |
|
239 |
void CloseT9InterfaceL(); |
|
240 |
||
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
241 |
TInt CategoryOfLang(TLanguage aLanguage); |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
242 |
|
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
243 |
|
63 | 244 |
/** |
245 |
* This letter is stroke symbol |
|
246 |
* |
|
247 |
* @since S60 v3.2 |
|
248 |
* @param aFindWord For analyse |
|
249 |
* @return ETrue for it is stroke symbol; otherwise EFalse |
|
250 |
*/ |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
251 |
TInt IsStrokeSymbol(const TInt aFindWord); |
63 | 252 |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
253 |
// The below code is commented out because current CFindUtilChineseECE is used |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
254 |
// on 3.2.3 which is not supported adaptive search. It will be easy to keep these code |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
255 |
// for the further merging work (merge from FindUtil 5.0) |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
256 |
#if 0 |
63 | 257 |
/** |
258 |
* Do translate for Chinese word |
|
259 |
* |
|
260 |
* @since S60 v5.0.1 |
|
261 |
* @param aHZUnicode For translate word |
|
262 |
* @param aSpellList Reference to spelling list for polyphonic word |
|
263 |
* @return ETrue for it can be translated; otherwise EFalse |
|
264 |
*/ |
|
265 |
TBool T9ChineseTranslationAdaptiveL(TInt16 aHZUnicode, RPointerArray<HBufC>& aSpellList); |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
266 |
#endif |
63 | 267 |
|
268 |
/** |
|
269 |
* Find pane text is including separator |
|
270 |
* |
|
271 |
* @since S60 v3.2 |
|
272 |
* @param aCh Analyze word |
|
273 |
* @return ETrue it is separator; otherwise EFalse |
|
274 |
*/ |
|
275 |
TBool IsFindWordSeparator(TChar aCh); |
|
276 |
||
277 |
/** |
|
278 |
* Find pane text is including stroke symbol |
|
279 |
* |
|
280 |
* @since S60 v3.2 |
|
281 |
* @param aWord Reference to text for analyse |
|
282 |
* @return ETrue it is stroke symbol; otherwise EFalse |
|
283 |
*/ |
|
284 |
TBool IsStrokeSymbolInString(const TDesC& aWord); |
|
285 |
||
286 |
/** |
|
287 |
* Find pane text is including zhuyin symbol |
|
288 |
* |
|
289 |
* @since S60 v3.2 |
|
290 |
* @param aWord Reference to text for analyse |
|
291 |
* @return ETrue it includes zhuyin symbol; otherwise EFalse |
|
292 |
*/ |
|
293 |
TBool IsZhuyinSymbolInString(const TDesC& aWord); |
|
294 |
||
295 |
/** |
|
296 |
* This language is support by this model |
|
297 |
* |
|
298 |
* @since S60 v3.2 |
|
299 |
* @param aLang Language for support |
|
300 |
* @return ETrue it supports; otherwise EFalse |
|
301 |
*/ |
|
302 |
TBool IsSupportLanguage(TLanguage aLang); |
|
303 |
||
304 |
/** |
|
305 |
* Callback method to notify client about language change. |
|
306 |
* |
|
307 |
* @since S60 v3.2 |
|
308 |
* @param aPtr Pointer to the callback data |
|
309 |
* @return Error code |
|
310 |
*/ |
|
311 |
static TInt HandleFindRepositoryCallBack(TAny* aPtr); |
|
312 |
||
313 |
/** |
|
314 |
* Splite the input text to sgement by language |
|
315 |
* |
|
316 |
* @since S60 v3.2 |
|
317 |
* @param aStringInfoArr Reference to segment list |
|
318 |
* @param aItemString Reference to input text |
|
319 |
* @return none |
|
320 |
*/ |
|
321 |
void SplitItemStringL(RPointerArray<STRINGINFO>& aStringInfoArr, const TDesC &aItemString); |
|
322 |
||
323 |
/** |
|
324 |
* Insert segment to list |
|
325 |
* |
|
326 |
* @since S60 v3.2 |
|
327 |
* @param aStringInfoArr Reference to segment list |
|
328 |
* @param aSegmentStr Reference to segment text |
|
329 |
* @param aChinese The segment is Chinese |
|
330 |
* @return none |
|
331 |
*/ |
|
332 |
void InsertStrInforArrayL(RPointerArray<STRINGINFO>& aStringInfoArr, |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
333 |
TDes &aSegmentStr, const TBool aChinese); |
63 | 334 |
|
335 |
/** |
|
336 |
* This segment is matched by search text |
|
337 |
* |
|
338 |
* @since S60 v3.2 |
|
339 |
* @param aStringInfoArr Reference to segment list |
|
340 |
* @param aSearchText Reference to searching text |
|
341 |
* @return ETrue it is matched; otherwise EFalse |
|
342 |
*/ |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
343 |
TBool MatchSegmentL(RPointerArray<STRINGINFO>& aStringInfoArr, CPsQuery& aQuery); |
63 | 344 |
|
345 |
/** |
|
346 |
* Search text by reverse |
|
347 |
* |
|
348 |
* @since S60 v3.2 |
|
349 |
* @param aFirst Reference to matched text |
|
350 |
* @param aSecond Reference to matched text |
|
351 |
* @return Matched count |
|
352 |
*/ |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
353 |
TInt ReverseMatchString(const TDesC& aFirst, const TDesC& aSecond); |
63 | 354 |
|
355 |
/** |
|
356 |
* Search text in other text |
|
357 |
* |
|
358 |
* @since S60 v3.2 |
|
359 |
* @param aFirst Reference to matched text |
|
360 |
* @param aSecond Reference to matched text |
|
361 |
* @return Matched count |
|
362 |
*/ |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
363 |
TInt MatchString(const TDesC& aFirst, const TDesC& aSecond); |
63 | 364 |
|
365 |
/** |
|
366 |
* Search text in other text |
|
367 |
* |
|
368 |
* @since S60 v3.2 |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
369 |
* @param aSearhTargetStr Reference to the target text to be queried |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
370 |
* @param CPsQuery maintain the matched text from user |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
371 |
* @return Matched count |
63 | 372 |
*/ |
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
373 |
TInt MatchString(const TDesC& aSearhTargetStr, CPsQuery& aQuery); |
63 | 374 |
|
375 |
/** |
|
376 |
* Search Chinese word in input text |
|
377 |
* |
|
378 |
* @since S60 v3.2 |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
379 |
* @param aFirst Reference to matched text |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
380 |
* @param aSecond Reference to matched text |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
381 |
* @return Matched count |
63 | 382 |
*/ |
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
383 |
TInt MatchChineseStringL(const TDesC& aSearchTargetString, CPsQuery& aQuery, TInt& aIndex); |
63 | 384 |
|
385 |
/** |
|
386 |
* Initial character search |
|
387 |
* |
|
388 |
* @since S60 v3.2 |
|
389 |
* @param aStringInfoArr Reference to spelling list |
|
390 |
* @param aSearchStr Reference to search text |
|
391 |
* @return ETrue it is matched; otherwise EFalse |
|
392 |
*/ |
|
393 |
TBool MatchChineseInitialStringL(RPointerArray<STRINGINFO>& aStringInfoArr, |
|
394 |
const TDesC& aSearchStr); |
|
395 |
||
396 |
/** |
|
397 |
* Maximal matched count in spelling list |
|
398 |
* |
|
399 |
* @since S60 v3.2 |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
400 |
* @param spellList Reference to spelling list |
63 | 401 |
* @param aSearchStr Reference to search text |
402 |
* @param aPreviouStr Reference to previous matched word |
|
403 |
* @param aMatchIndex Reference to match index in Search text |
|
404 |
* @param aFullMatched Previous word is fully matched |
|
405 |
* @param aMatchedCount Previous word matched count |
|
406 |
* @param aAgain Search again |
|
407 |
* @return Matched count |
|
408 |
*/ |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
409 |
TInt MaxMatchInList(RPointerArray<HBufC> &spellList, CPsQuery& aQuery, |
63 | 410 |
TDesC& aPreviouStr, TInt& aMatchIndex, const TBool aFullMatched, |
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
411 |
const TInt aMatchedCount, TBool& aAgain); |
63 | 412 |
|
413 |
/** |
|
414 |
* Search the taxt is include the input text |
|
415 |
* |
|
416 |
* @since S60 v3.2 |
|
417 |
* @param aFirst Reference to matched text |
|
418 |
* @param aSecond Reference to matched text |
|
419 |
* @return Matched count |
|
420 |
*/ |
|
421 |
TBool IncludeString(const TDesC& aFirst, const TDesC& aSecond); |
|
422 |
||
423 |
/** |
|
424 |
* Update input method in ptiengine from find pane |
|
425 |
* |
|
426 |
* @since S60 v3.2 |
|
427 |
* @return none |
|
428 |
*/ |
|
429 |
void UpdateCurrentInputMode(); |
|
430 |
||
431 |
/** |
|
432 |
* Remove separator from search text |
|
433 |
* |
|
434 |
* @since S60 v3.2 |
|
435 |
* @param aSearchText Reference to search text |
|
436 |
* @return none |
|
437 |
*/ |
|
438 |
void RemoveSeparator(TDes& aSearchText); |
|
439 |
||
440 |
// The below code is commented out because current CFindUtilChineseECE is used |
|
441 |
// on 3.2.3 which is not supported adaptive search. It will be easy to keep these code |
|
442 |
// for the further merging work (merge from FindUtil 5.0) |
|
443 |
#if 0 |
|
444 |
/** |
|
445 |
* From MFindUtil It return next char. |
|
446 |
* @since 5.0 |
|
447 |
* @param aNextChars is a buffer where next possible characters are saved |
|
448 |
* @param aCh is a char need to be input to aNextChars |
|
449 |
* |
|
450 |
*/ |
|
451 |
void UpdateNextCharsL(HBufC*& aNextChars, TChar aCh); |
|
452 |
/** |
|
453 |
* From MFindUtil It return next chars. |
|
454 |
* @since 5.0 |
|
455 |
* @param aNextChars is a buffer where next possible characters are saved |
|
456 |
* @param aItemString is a Contact field string |
|
457 |
*/ |
|
458 |
void UpdateNextCharsFromStringL(HBufC*& aNextChars, const TDesC& aItemString); |
|
459 |
||
460 |
/** |
|
461 |
* From MFindUtil It return next chars. |
|
462 |
* @since 5.0 |
|
463 |
* @param aNextChars is a buffer where next possible characters are saved |
|
464 |
* @param aItemString is a Contact field string |
|
465 |
* @param aSearchText Reference to search text |
|
466 |
* @param aInputLang for the input language |
|
467 |
*/ |
|
468 |
TBool IsAdaptiveFindMatchL( const TDesC& aItemString, const TDesC& aSearchText, |
|
469 |
HBufC*& aNextChars); |
|
470 |
||
471 |
||
472 |
/** |
|
473 |
* Trim chinese charater if it is exist in search text |
|
474 |
* @since 5.0 |
|
475 |
* @Param aItemString is a contact field string |
|
476 |
* @param aSearchText is a search text |
|
477 |
* @param aNextChars is a buffer to store the charcaters needed to display. |
|
478 |
*/ |
|
479 |
TBool TrimChineseCharacterL(TDes& aItemString, TDes& aSearchText,HBufC*& aNextChars); |
|
480 |
||
481 |
/** |
|
482 |
* Trim chinese charater if it is exist in search text |
|
483 |
* @since 5.0 |
|
484 |
* @Param aarray is a contact field string which had to segments |
|
485 |
* @param aSearchText is a search text |
|
486 |
* @param aNextChars is a buffer to store the charcaters needed to display. |
|
487 |
*/ |
|
488 |
TBool CheckEnglishFirstL( RPointerArray<STRINGINFO>& aarray, TDes& aSearchText,HBufC*& aNextChars); |
|
489 |
||
490 |
/** |
|
491 |
* Trim chinese charater if it is exist in search text |
|
492 |
* @since 5.0 |
|
493 |
* @Param AstringInfoArr is a contact field string which had to segments |
|
494 |
* @param aindex is the current find cursor |
|
495 |
* @param aNextChars is a buffer to store the charcaters needed to display. |
|
496 |
*/ |
|
497 |
void AppendCharInNextSegmentL(const RPointerArray<STRINGINFO>& astringInfoArr , |
|
498 |
const TInt aindex,HBufC*& aNextChars); |
|
499 |
||
500 |
/** |
|
501 |
* Trim chinese charater if it is exist in search text |
|
502 |
* @since 5.0 |
|
503 |
* @Param AstringInfoArr is a contact field string which had to segments |
|
504 |
* @param aindex is the current find cursor |
|
505 |
* @paran aindexforfind is the temp cursor for find |
|
506 |
* @param aCurrentBuf the data in this segment |
|
507 |
* @param aTranSearchBuf is the left search data |
|
508 |
* @param aNextChars is a buffer to store the charcaters needed to display. |
|
509 |
*/ |
|
510 |
||
511 |
TBool AppendNextSegmentFirstCharL(const RPointerArray<STRINGINFO>& astringInfoArr , |
|
512 |
const TInt aindex ,const TInt aindexforfind , |
|
513 |
const TDes& aCurrentBuf ,const TDes& aTranSearchBuf , |
|
514 |
HBufC*& aNextChars); |
|
515 |
||
516 |
/** |
|
517 |
* Check and add next char if existed overlap problem (tang ang) |
|
518 |
* @since 5.0 |
|
519 |
* @Param AstringInfoArr is a contact field string which had to segments |
|
520 |
* @param aindex is the current find cursor |
|
521 |
* @paran aindexforfind is the temp cursor for find |
|
522 |
* @param aCurrentBuf is the search string |
|
523 |
* @param aNextChars is a buffer to store the charcaters needed to display. |
|
524 |
*/ |
|
525 |
void AddNextIfOverlapL(const RPointerArray<STRINGINFO>& astringInfoArr , |
|
526 |
const TInt aindex,const TInt aindexforfind , |
|
527 |
const TDes& aCurrentBuf,HBufC*& aNextChars ); |
|
528 |
#endif |
|
529 |
||
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
530 |
/** |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
531 |
* Converts the input data to the key board mode specified by the query. |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
532 |
* Mode is referred in the CPsQuery. |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
533 |
* If the mode is ITU-T, data is converted to numeric. |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
534 |
* If the mode is Qwerty, data is retained as is. |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
535 |
* If the mode is Mix, data is conerted according to the keyboard mode |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
536 |
* of the corresponding query chararter |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
537 |
*/ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
538 |
void ConvertdDataToKeyBoardModeL(CPsQuery& aQuery, |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
539 |
const TDesC& aSearchTargetStr, |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
540 |
TBuf<KMaxWordInterpretationLen>& aOutputNumInterpretationStr); |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
541 |
|
63 | 542 |
// help function for using CPsQuery |
543 |
public: |
|
544 |
void GetPartOfQueryL(CPsQuery& aSrcQuery, TInt aStartIndex, |
|
545 |
TInt aEndIndex, CPsQuery& aDestQuery); |
|
546 |
private: |
|
547 |
void RemoveSeparatorL(CPsQuery& aQuery); |
|
548 |
||
549 |
||
550 |
private: |
|
551 |
||
552 |
/** |
|
553 |
* Ptiengine for Chinese translation (Own) |
|
554 |
*/ |
|
555 |
CPtiEngine* iPtiEngine; |
|
556 |
||
557 |
/** |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
558 |
* Ptiengine for Chinese translation in English language (Own) |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
559 |
*/ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
560 |
CPtiEngine* iPtiEnginePrc; |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
561 |
|
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
562 |
/** |
63 | 563 |
* Current text input language |
564 |
*/ |
|
565 |
TLanguage iLanguage; |
|
566 |
||
567 |
/** |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
568 |
* It is support Chinese Language |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
569 |
*/ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
570 |
TBool iSupportPRCChinese; |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
571 |
|
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
572 |
/** |
63 | 573 |
* Current input mode |
574 |
*/ |
|
575 |
TInt iCurInputMode; |
|
576 |
||
577 |
/** |
|
578 |
* Repository for input mode (Own) |
|
579 |
*/ |
|
580 |
CRepository* iRepositoryFind; |
|
581 |
||
582 |
/** |
|
583 |
* The repository watcher(Own); |
|
584 |
*/ |
|
585 |
CFindRepositoryWatcher* iWatcher; |
|
586 |
||
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
587 |
// The below code is commented out because current CFindUtilChineseECE is used |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
588 |
// on 3.2.3 which is not supported adaptive search. It will be easy to keep these code |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
589 |
// for the further merging work (merge from FindUtil 5.0) |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
590 |
#if 0 |
63 | 591 |
/** |
592 |
* Repository for input mode (Own) |
|
593 |
*/ |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
594 |
CRepository* iRepositoryFindAdaptive; |
63 | 595 |
|
596 |
/** |
|
597 |
* The repository watcher(Own); |
|
598 |
*/ |
|
599 |
CFindRepositoryWatcher* iWatcherAdaptive; |
|
600 |
||
601 |
||
602 |
/** |
|
603 |
* The default adaptive search method; |
|
604 |
*/ |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
605 |
TDefaultAdaptiveSearchMethod iSearchMethodPRC; |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
606 |
|
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
607 |
/** |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
608 |
* The default adaptive search method; |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
609 |
*/ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
610 |
TDefaultAdaptiveSearchMethod iSearchMethodTaiWan; |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
611 |
|
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
612 |
/** |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
613 |
* The default adaptive search method; |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
614 |
*/ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
615 |
TDefaultAdaptiveSearchMethod iSearchMethodHongKong; |
63 | 616 |
|
617 |
/** |
|
618 |
* The search method; |
|
619 |
*/ |
|
620 |
TBool iSearchMethodAdaptive; |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
621 |
#endif |
63 | 622 |
|
623 |
CPcsAlgorithm2* iAlgorithm; |
|
624 |
||
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
625 |
/* |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
626 |
* The keyboard Mode |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
627 |
*/ |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
628 |
TInt iKeyboardMode; |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
629 |
|
63 | 630 |
}; |
631 |
||
632 |
#endif // __FINDUTILCHINESE_ECE__ |
|
633 |
// End of File |