author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:55:58 +0300 | |
branch | RCL_3 |
changeset 56 | 8152b1f1763a |
parent 44 | ecbabf52600f |
permissions | -rw-r--r-- |
44 | 1 |
/* |
2 |
* Copyright (c) 2009 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: Implementation for arabic peninput finger hwr |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef C_PENINPUTFINGERHWRARDATASTORE_H |
|
19 |
#define C_PENINPUTFINGERHWRARDATASTORE_H |
|
20 |
||
21 |
//SYSTEM INCLUDES |
|
22 |
#include <e32base.h> |
|
23 |
#include <e32def.h> |
|
24 |
#include <w32std.h> |
|
25 |
#include <eikon.hrh> |
|
26 |
#include <AknUtils.h> |
|
27 |
||
28 |
//FEP INCLUDES |
|
29 |
#include <PtiEngine.h> |
|
30 |
#include <peninputpluginutils.h> |
|
31 |
||
32 |
||
33 |
//USER INCLUDES |
|
34 |
#include "peninputfingerhwrarstoreconstants.h" |
|
35 |
#include "peninputfingerhwrar.hrh" |
|
36 |
//CONSTANTS |
|
37 |
const TInt KLanguageStringLength = 10; |
|
38 |
||
39 |
//FOWWARD CLASS |
|
40 |
class CPeninputFingerHwrArLayout; |
|
41 |
class CRepository; |
|
42 |
class CPeninputFingerHwrArEngine; |
|
43 |
class CPtiEngine; |
|
44 |
||
45 |
||
46 |
/** |
|
47 |
* CPeninputFingerHwrArDataStore |
|
48 |
* |
|
49 |
* @lib peninputfingerhwr.lib |
|
50 |
* @since Symbian TB9.2 |
|
51 |
*/ |
|
52 |
class CPeninputFingerHwrArDataStore : public CBase |
|
53 |
{ |
|
54 |
public: |
|
55 |
/** |
|
56 |
* Symbian constructor. |
|
57 |
* |
|
58 |
* @since Symbian TB9.2 |
|
59 |
* @param aPtiEngine The PtiEngine |
|
60 |
* @param aLayout The Finger HWR layout |
|
61 |
* @return Pointer to created CPeninputFingerHwrArDataStore object |
|
62 |
*/ |
|
63 |
static CPeninputFingerHwrArDataStore* NewL( CPtiEngine* aPtiEngine, |
|
64 |
CPeninputFingerHwrArLayout* aLayout ); |
|
65 |
||
66 |
/** |
|
67 |
* destructor |
|
68 |
* |
|
69 |
* @since Symbian TB9.2 |
|
70 |
* @return None |
|
71 |
*/ |
|
72 |
virtual ~CPeninputFingerHwrArDataStore(); |
|
73 |
||
74 |
||
75 |
public: |
|
76 |
/** |
|
77 |
* Is valid candidate |
|
78 |
* |
|
79 |
* @since Symbian TB9.2 |
|
80 |
* @param aCandidateIndex The index the candidate in list. |
|
81 |
* @return ETrue if candidate is not empty; otherwise EFalse |
|
82 |
*/ |
|
83 |
TBool IsValidCandidate( TInt aCandidateIndex ) const; |
|
84 |
||
85 |
||
86 |
/** |
|
87 |
* Is English letter |
|
88 |
* |
|
89 |
* @since Symbian TB9.2 |
|
90 |
* @param aLetter The recognize character. |
|
91 |
* @return ETrue if the character is English letter; otherwise EFalse |
|
92 |
*/ |
|
93 |
TBool IsEnglishLetter( const TDesC& aLetter); |
|
94 |
||
95 |
/** |
|
96 |
* Do recoginize by engine |
|
97 |
* |
|
98 |
* @since Symbian TB9.2 |
|
99 |
* @param aTraceData The trace data. |
|
100 |
* @return None |
|
101 |
*/ |
|
102 |
void DoRecognizeL( const RArray<TPoint>& aTraceData ); |
|
103 |
||
104 |
||
105 |
/** |
|
106 |
* Set Chinese symbol to writing candidate list |
|
107 |
* |
|
108 |
* @since Symbian TB9.2 |
|
109 |
* @return None |
|
110 |
*/ |
|
111 |
void SetArabicSymbolL(); |
|
112 |
||
113 |
/** |
|
114 |
* Set permitted ranges |
|
115 |
* |
|
116 |
* @since Symbian TB9.2 |
|
117 |
* @param aPermittedRanges The permitted ranges. |
|
118 |
* @return None |
|
119 |
*/ |
|
120 |
void SetPermittedRanges( TInt aPermittedRanges ); |
|
121 |
||
122 |
/** |
|
123 |
* Set permitted ranges |
|
124 |
* |
|
125 |
* @since Symbian TB9.2 |
|
126 |
* @param aPermittedRanges The permitted ranges. |
|
127 |
* @return None |
|
128 |
*/ |
|
129 |
void SetPermittedCases( TInt aPermittedCases ); |
|
130 |
||
131 |
||
132 |
/** |
|
133 |
* Get Primary range |
|
134 |
* |
|
135 |
* @since Symbian TB9.2 |
|
136 |
* @return Primary range. |
|
137 |
*/ |
|
138 |
TInt PrimaryRange(); |
|
139 |
||
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
140 |
/** |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
141 |
* Get current range |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
142 |
* |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
143 |
* @since Symbian TB9.2 |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
144 |
* @return Current range. |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
145 |
*/ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
146 |
TFingerHwrRange CurrentRange(); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
147 |
|
44 | 148 |
|
149 |
/** |
|
150 |
* Set case |
|
151 |
* |
|
152 |
* @since Symbian TB9.2 |
|
153 |
* @param aCase The case |
|
154 |
* @return None |
|
155 |
*/ |
|
156 |
void SetCase( TInt aCase ); |
|
157 |
||
158 |
/** |
|
159 |
* Set language |
|
160 |
* |
|
161 |
* @since Symbian TB9.2 |
|
162 |
* @param aLanguage The language |
|
163 |
* @return None |
|
164 |
*/ |
|
165 |
void SetLanguageL( TInt aLanguage ); |
|
166 |
||
167 |
||
168 |
/** |
|
169 |
* Set auto complete candidate list. |
|
170 |
* |
|
171 |
* @since Symbian TB9.2 |
|
172 |
* @param aIsFirstStroke The first stroke flag |
|
173 |
* @return None |
|
174 |
*/ |
|
175 |
void SetFirstStroke( const TBool aIsFirstStroke); |
|
176 |
||
177 |
/** |
|
178 |
* Set auto complete candidate list. |
|
179 |
* |
|
180 |
* @since Symbian TB9.2 |
|
181 |
* @return ETrue if it's the first stroke |
|
182 |
*/ |
|
183 |
TBool FirstStroke(); |
|
184 |
||
185 |
||
186 |
/** |
|
187 |
* Get the candidate. |
|
188 |
* |
|
189 |
* @since Symbian TB9.2 |
|
190 |
* @param aIndex The index of candidate |
|
191 |
* @param aCharCode The result candidate |
|
192 |
* @return Candidate char code |
|
193 |
*/ |
|
194 |
const RPointerArray<HBufC>& Candidate() const; |
|
195 |
||
196 |
||
197 |
/** |
|
198 |
* Set number mode |
|
199 |
* |
|
200 |
* @since Symbian TB9.2 |
|
201 |
* @param aNumberMode Given number mode |
|
202 |
* @return None |
|
203 |
*/ |
|
204 |
void SetNumberMode( const TAknEditorNumericKeymap aNumberMode ); |
|
205 |
||
206 |
/** |
|
207 |
* Set number mode |
|
208 |
* |
|
209 |
* @since Symbian TB9.2 |
|
210 |
* @param aCustomMode The customized number key mapping, 0-9 |
|
211 |
* are not included. |
|
212 |
* @return None |
|
213 |
*/ |
|
214 |
void SetCustomNumberModeL( const TDesC& aCustomMode ); |
|
215 |
||
216 |
/** |
|
217 |
* Set the screen mode. |
|
218 |
* |
|
219 |
* @since Symbian TB9.2 |
|
220 |
* @param aRange The range |
|
221 |
* @return None |
|
222 |
*/ |
|
223 |
void SaveRange( TInt aRange ); |
|
224 |
||
225 |
||
226 |
||
227 |
||
228 |
/** |
|
229 |
* Set stroke end mark to stroke end mark control |
|
230 |
* |
|
231 |
* @since Symbian TB9.2 |
|
232 |
* @return None |
|
233 |
*/ |
|
234 |
void SetStrokeEndMark(); |
|
235 |
||
236 |
/** |
|
237 |
* Get the stroke end mark. |
|
238 |
* |
|
239 |
* @since Symbian TB9.2 |
|
240 |
* @return TPoint |
|
241 |
*/ |
|
242 |
TPoint StrokeEndMark(); |
|
243 |
||
244 |
/** |
|
245 |
* Get stroke end mark from control which handle it |
|
246 |
* |
|
247 |
* @since Symbian TB9.2 |
|
248 |
* @return None |
|
249 |
*/ |
|
250 |
TPoint StrokeEndMarkFromControl(); |
|
251 |
||
252 |
/** |
|
253 |
* Get number keymapping string |
|
254 |
* |
|
255 |
* @since Symbian TB9.2 |
|
256 |
* @param aKeyMappingId Keymapping id |
|
257 |
* @return Pointer to keymapping string |
|
258 |
*/ |
|
259 |
HBufC* KeyMappingStringL() const; |
|
260 |
||
261 |
/** |
|
262 |
* Get start writing char flag |
|
263 |
* |
|
264 |
* @since Symbian TB9.2 |
|
265 |
* @return ETrue If begine writing. |
|
266 |
*/ |
|
267 |
TBool StartCharacter(); |
|
268 |
||
269 |
/** |
|
270 |
* Set start writing char flag |
|
271 |
* |
|
272 |
* @since Symbian TB9.2 |
|
273 |
* @param aStartCharacter The start writing flag |
|
274 |
* @return ETrue If begine writing. |
|
275 |
*/ |
|
276 |
void SetStartCharacter(const TBool aStartCharacter); |
|
277 |
||
278 |
/** |
|
279 |
* Set input area size to engine for recognize |
|
280 |
* |
|
281 |
* @since Symbian TB9.2 |
|
282 |
* @param aStartCharacter The start writing flag |
|
283 |
* @return ETrue If begine writing. |
|
284 |
*/ |
|
285 |
TInt SetInputAreaSize(TSize& aSize); |
|
286 |
||
287 |
/** |
|
288 |
* Set screen size to engine for recognize |
|
289 |
* |
|
290 |
* @since Symbian TB9.2 |
|
291 |
* @param aStartCharacter The start writing flag |
|
292 |
* @return ETrue If begine writing. |
|
293 |
*/ |
|
294 |
TInt SetScreenSize(TSize& aSize); |
|
295 |
||
296 |
||
297 |
/** |
|
298 |
* Set high light flag for candidate list |
|
299 |
* |
|
300 |
* @since Symbian TB9.2 |
|
301 |
* @param aIsHighlight The flag to decide highlight default cell or not |
|
302 |
* @return None |
|
303 |
*/ |
|
304 |
void SetHighlight(const TBool aIsHighlight); |
|
305 |
||
306 |
/** |
|
307 |
* Get high light flag for candidate list |
|
308 |
* |
|
309 |
* @since Symbian TB9.2 |
|
310 |
* @return ETrue If highlight the default cell to candidate list |
|
311 |
*/ |
|
312 |
TBool Highlight(); |
|
313 |
||
314 |
/** |
|
315 |
* Get top guide line from hwr engine |
|
316 |
* |
|
317 |
* @since Symbian TB9.2 |
|
318 |
*/ |
|
319 |
void GetTopGuideLinePos(TInt& aPos); |
|
320 |
||
321 |
/** |
|
322 |
* Get bottom guide line from hwr engine |
|
323 |
* |
|
324 |
* @since Symbian TB9.2 |
|
325 |
*/ |
|
326 |
void GetBottomGuideLinePos(TInt& aPos); |
|
327 |
||
328 |
/** |
|
329 |
* Set first candidate type according to editor's text in cursor. |
|
330 |
* @since s60 v5.2 |
|
331 |
*/ |
|
332 |
void SetFirstCandidateType(TFirstCandidateType aFirstCandType); |
|
333 |
||
334 |
/** |
|
335 |
* Check if the passed char is latin number |
|
336 |
* |
|
337 |
* @since s60 v5.2 |
|
338 |
* @param aChar The passed unicode |
|
339 |
* @return ETrue if it is, EFalse otherwise |
|
340 |
*/ |
|
341 |
TBool IsLatinNumber(TUint16 aChar); |
|
342 |
||
343 |
/** |
|
344 |
* Check if the passed char is latin char |
|
345 |
* |
|
346 |
* @since s60 v5.2 |
|
347 |
* @param aChar The passed unicode |
|
348 |
* @return ETrue if it is, EFalse otherwise |
|
349 |
*/ |
|
350 |
TBool IsLatinChar(TUint16 aChar); |
|
351 |
||
352 |
/** |
|
353 |
* Check if the passed char is arabic number |
|
354 |
* |
|
355 |
* @since s60 v5.2 |
|
356 |
* @param aChar The passed unicode |
|
357 |
* @return ETrue if it is, EFalse otherwise |
|
358 |
*/ |
|
359 |
TBool IsArabicNumber(TUint16 aChar); |
|
360 |
||
361 |
/** |
|
362 |
* Check if it is in number only mode. |
|
363 |
* |
|
364 |
* @since s60 v5.2 |
|
365 |
* @param None |
|
366 |
* @return ETrue if it is, EFalse otherwise |
|
367 |
*/ |
|
368 |
TBool IsNumberOnlyMode(); |
|
369 |
||
370 |
/** |
|
371 |
* check if it is native number mode. |
|
372 |
* |
|
373 |
* @since s60 v5.2 |
|
374 |
* @param None |
|
375 |
* @return ETrue if it is, EFalse otherwise |
|
376 |
*/ |
|
377 |
TBool IsNativeNumMode(); |
|
378 |
private: |
|
379 |
||
380 |
/** |
|
381 |
* C++ constructor |
|
382 |
* |
|
383 |
* @since Symbian TB9.2 |
|
384 |
* @return None |
|
385 |
*/ |
|
386 |
CPeninputFingerHwrArDataStore(CPeninputFingerHwrArLayout* aLayout); |
|
387 |
||
388 |
/** |
|
389 |
* Second phase constructor |
|
390 |
* |
|
391 |
* @since Symbian TB9.2 |
|
392 |
* @return None |
|
393 |
*/ |
|
394 |
void ConstructL( CPtiEngine* aPtiEngine ); |
|
395 |
||
396 |
/** |
|
397 |
* Initialize the key mapping list |
|
398 |
* |
|
399 |
* @since Symbian TB9.2 |
|
400 |
* @return None |
|
401 |
*/ |
|
402 |
void InitKeyMappingListL(); |
|
403 |
||
404 |
||
405 |
/** |
|
406 |
* Judge if a language is Arabic |
|
407 |
* |
|
408 |
* @since Symbian TB9.2 |
|
409 |
* @param aLanguage Given language code |
|
410 |
* @return ETrue if aLanguage is Chinese, otherwise EFalse |
|
411 |
*/ |
|
412 |
TBool IsArabicLanguage( TInt aLanguage ); |
|
413 |
||
414 |
/** |
|
415 |
* Set engine language |
|
416 |
* |
|
417 |
* @since Symbian TB9.2 |
|
418 |
* @param aLanguage Given language code |
|
419 |
* @return None |
|
420 |
*/ |
|
421 |
void SetEngineLanguageL( TInt aLanguage ); |
|
422 |
||
423 |
/** |
|
424 |
* Set language show text |
|
425 |
* |
|
426 |
* @since Symbian TB9.2 |
|
427 |
* @param aLanguage language code |
|
428 |
* @return None |
|
429 |
*/ |
|
430 |
void SetLanguageShowText( TInt aLanguage ); |
|
431 |
||
432 |
/** |
|
433 |
* Reorder candidate list according to pre character type in editor. |
|
434 |
* @since s60 v5.2 |
|
435 |
* @param None. |
|
436 |
* @return None. |
|
437 |
*/ |
|
438 |
void ReorderCandidates(); |
|
439 |
||
440 |
private:// data |
|
441 |
||
442 |
||
443 |
/** |
|
444 |
* candidate list (Own) |
|
445 |
*/ |
|
446 |
RPointerArray<HBufC> iCandidates; |
|
447 |
||
448 |
/** |
|
449 |
* The candidate range start index |
|
450 |
*/ |
|
451 |
RArray<TInt> iRangeStartPos; |
|
452 |
||
453 |
/** |
|
454 |
* Permitted ranges |
|
455 |
*/ |
|
456 |
RArray<TInt> iPermittedRanges; |
|
457 |
||
458 |
/** |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
459 |
* Current range |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
460 |
*/ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
461 |
TFingerHwrRange iCurrentRange; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
462 |
|
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
463 |
/** |
44 | 464 |
* Permitted range in int format |
465 |
*/ |
|
466 |
TInt iIntRange; |
|
467 |
||
468 |
/** |
|
469 |
* Current case |
|
470 |
*/ |
|
471 |
TInt iCase; |
|
472 |
||
473 |
/** |
|
474 |
* Current language |
|
475 |
*/ |
|
476 |
TInt iLanguage; |
|
477 |
||
478 |
/** |
|
479 |
* Pen size |
|
480 |
*/ |
|
481 |
TSize iPenSize; |
|
482 |
||
483 |
/** |
|
484 |
* Pen color |
|
485 |
*/ |
|
486 |
TRgb iPenColor; |
|
487 |
||
488 |
/** |
|
489 |
* The repository (Own); |
|
490 |
*/ |
|
491 |
CRepository* iRepositoryFep; |
|
492 |
||
493 |
/** |
|
494 |
* repository object. |
|
495 |
*/ |
|
496 |
CRepository* iCommonEngineRepository; |
|
497 |
||
498 |
/** |
|
499 |
* The engine (Own); |
|
500 |
*/ |
|
501 |
CPeninputFingerHwrArEngine* iHwrEngine; |
|
502 |
||
503 |
/** |
|
504 |
* The permited cases |
|
505 |
*/ |
|
506 |
TInt iPermittedCases; |
|
507 |
||
508 |
/** |
|
509 |
* The current number key map |
|
510 |
*/ |
|
511 |
TAknEditorNumericKeymap iCurrentNumberMode; |
|
512 |
||
513 |
/** |
|
514 |
* Keymapping id array |
|
515 |
*/ |
|
516 |
RArray<TInt> iKeyMappingIdList; |
|
517 |
||
518 |
/** |
|
519 |
* Keymapping string array |
|
520 |
*/ |
|
521 |
RPointerArray<HBufC> iKeyMappingStringList; |
|
522 |
||
523 |
/** |
|
524 |
* Language show text |
|
525 |
*/ |
|
526 |
TBuf<KLanguageStringLength> iLanguageShowText; |
|
527 |
||
528 |
/** |
|
529 |
* User defined key mapping (Own) |
|
530 |
*/ |
|
531 |
HBufC* iUserDefinedResource; |
|
532 |
||
533 |
/** |
|
534 |
* Finger hwr layout (not own) |
|
535 |
*/ |
|
536 |
CPeninputFingerHwrArLayout* iLayout; |
|
537 |
||
538 |
/** |
|
539 |
* Start writing flag |
|
540 |
*/ |
|
541 |
TBool iStartCharacter; |
|
542 |
||
543 |
/** |
|
544 |
* Highlight default writing candidate flag |
|
545 |
*/ |
|
546 |
TBool iIsHighlightCell; |
|
547 |
||
548 |
/** |
|
549 |
* The first stroke flag |
|
550 |
*/ |
|
551 |
TBool iIsFirstStroke; |
|
552 |
||
553 |
/** |
|
554 |
* default key mapping for normal editor(not number-only). |
|
555 |
* Own |
|
556 |
*/ |
|
557 |
HBufC* iDefaultNumberMapping; |
|
558 |
||
559 |
/** |
|
560 |
* First candidate type. |
|
561 |
*/ |
|
562 |
TFirstCandidateType iFirstCandidateType; |
|
563 |
||
564 |
/** |
|
565 |
* the number mode flag |
|
566 |
*/ |
|
567 |
TBool iIsNativeNumMode; |
|
568 |
}; |
|
569 |
||
570 |
||
571 |
#endif //C_PENINPUTFINGERHWRARDATASTORE_H |