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