|
1 /* |
|
2 * Copyright (c) 2002-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: peninput HWR data manager |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PENINPUTHWRBOXDATAMGR_H |
|
20 #define C_PENINPUTHWRBOXDATAMGR_H |
|
21 |
|
22 // System includes |
|
23 #include <peninputdatamgr.h> |
|
24 |
|
25 const TInt KCharacterRangePopupMaxRow = 4; |
|
26 |
|
27 // Forward decalaration |
|
28 class MPeninputLayoutContext; |
|
29 class CPeninputHwrBoxRecognizer; |
|
30 class CPtiEngine; |
|
31 /** |
|
32 * Peninput HWR data management class |
|
33 * This class manager the data of HWR |
|
34 * |
|
35 * @lib peninputhwrboxjp.lib |
|
36 * @since S60 v3.2 |
|
37 */ |
|
38 class CPeninputHwrBoxDataMgr : public CPeninputDataMgr |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Two-phased constructor |
|
43 * |
|
44 * @since S60 v3.2 |
|
45 * @param aContext The layout context |
|
46 * @return The pointer to CPeninputHwrBoxDataMgr object |
|
47 */ |
|
48 static CPeninputHwrBoxDataMgr* NewL(MPeninputLayoutContext* aContext); |
|
49 |
|
50 /** |
|
51 * Two-phased constructor |
|
52 * |
|
53 * @since S60 v3.2 |
|
54 * @param aContext The layout context |
|
55 * @return The pointer to CPeninputHwrBoxDataMgr object |
|
56 */ |
|
57 static CPeninputHwrBoxDataMgr* NewLC(MPeninputLayoutContext* aContext); |
|
58 |
|
59 /** |
|
60 * Destructor |
|
61 * |
|
62 * @since S60 v3.2 |
|
63 * @return None |
|
64 */ |
|
65 virtual ~CPeninputHwrBoxDataMgr(); |
|
66 |
|
67 /** |
|
68 * Do recoginize by engine |
|
69 * |
|
70 * @since S60 v3.2 |
|
71 * @param aTraceData The trace data. |
|
72 * @return None |
|
73 */ |
|
74 void DoRecognize(const RArray<TPoint>& aTraceData); |
|
75 |
|
76 /** |
|
77 * Get the candidate count |
|
78 * |
|
79 * @since S60 v3.2 |
|
80 * @return The count of candidate |
|
81 */ |
|
82 TInt CandidateCount() const; |
|
83 |
|
84 /** |
|
85 * Set permitted ranges |
|
86 * |
|
87 * @since S60 v3.2 |
|
88 * @param aPermittedRanges The permitted ranges. |
|
89 * @return None |
|
90 */ |
|
91 void SetPermittedRanges(TInt aPermittedRanges); |
|
92 |
|
93 /** |
|
94 * Get the permitted ranges count |
|
95 * |
|
96 * @since S60 v3.2 |
|
97 * @return The count of permitted ranges |
|
98 */ |
|
99 TInt PermittedRangesCount() const; |
|
100 |
|
101 /** |
|
102 * Set premary range |
|
103 * |
|
104 * @since S60 v3.2 |
|
105 * @param aPremaryRange The premary range |
|
106 * @return None |
|
107 */ |
|
108 void SetPremaryRange(TInt aPremaryRange); |
|
109 |
|
110 /** |
|
111 * Set the candidate list. |
|
112 * |
|
113 * @since S60 v3.2 |
|
114 * @return None |
|
115 */ |
|
116 void SetCandidates(); |
|
117 |
|
118 /** |
|
119 * Get WritingSpeed |
|
120 * |
|
121 * @since S60 v3.2 |
|
122 * @return WritingSpeed. |
|
123 */ |
|
124 TInt WritingSpeed() const; |
|
125 |
|
126 /** |
|
127 * Get PenSize |
|
128 * |
|
129 * @since S60 v3.2 |
|
130 * @return PenSize. |
|
131 */ |
|
132 TSize PenSize() const; |
|
133 |
|
134 /** |
|
135 * Get PenColor |
|
136 * |
|
137 * @since S60 v3.2 |
|
138 * @return PenColor. |
|
139 */ |
|
140 TRgb PenColor() const; |
|
141 |
|
142 /** |
|
143 * Get the candidate. |
|
144 * |
|
145 * @since S60 v3.2 |
|
146 * @param aIndex The index of candidate |
|
147 * @param aCharCode The result candidate |
|
148 * @return Candidate char code |
|
149 */ |
|
150 void GetCandidate(TInt aIndex, TDes& aCharCode) const; |
|
151 /** |
|
152 * Clear the candidate list. |
|
153 * |
|
154 * @since S60 v3.2 |
|
155 * @return None |
|
156 */ |
|
157 void ClearCandidates(); |
|
158 |
|
159 // From base class CPeninputDataMgr |
|
160 |
|
161 /** |
|
162 * From CPeninputDataMgr |
|
163 * Initialize the pen data |
|
164 * instesd of "void InitMore();" |
|
165 * |
|
166 * @since S60 v3.2 |
|
167 * @return None |
|
168 */ |
|
169 void InitMoreJpL(); |
|
170 |
|
171 /** |
|
172 * From CPeninputDataMgr |
|
173 * Call back function, which is called when some key changed |
|
174 * |
|
175 * @since S60 v3.2 |
|
176 * @param aChangedKey The key whose value is changed |
|
177 * @return None |
|
178 */ |
|
179 void HandleGSRepositoryChange( TInt aChangedKey ); |
|
180 |
|
181 /** |
|
182 * Get PtiEngine |
|
183 * |
|
184 * @since S60 v3.2 |
|
185 * @return ptiengine. |
|
186 */ |
|
187 CPtiEngine* PtiEngine(); |
|
188 |
|
189 /** |
|
190 * Get Predictive flag |
|
191 * |
|
192 * @since S60 v3.2 |
|
193 * @return The predictive flag. |
|
194 */ |
|
195 TBool Predictive() const; |
|
196 |
|
197 /** |
|
198 * Get full or half flag |
|
199 * |
|
200 * @since S60 v3.2 |
|
201 * @return The full or half flag. |
|
202 */ |
|
203 TInt FullHalf() const; |
|
204 |
|
205 /** |
|
206 * Get Conversion flag |
|
207 * |
|
208 * @since S60 v3.2 |
|
209 * @return The Conversion flag. |
|
210 */ |
|
211 TBool Conversion() const; |
|
212 |
|
213 /** |
|
214 * Get The Character range popup text array |
|
215 * |
|
216 * @since S60 v3.2 |
|
217 * @return ptiengine. |
|
218 */ |
|
219 CDesCArrayFlat* CharacterRangeArray(); |
|
220 |
|
221 /** |
|
222 * Get The Character range Id from popup index |
|
223 * |
|
224 * @since S60 v3.2 |
|
225 * @return Character range Id. |
|
226 */ |
|
227 TInt CharacterRangeId() const; |
|
228 |
|
229 /** |
|
230 * Get CharacterRange Popup index |
|
231 * |
|
232 * @since S60 v3.2 |
|
233 * @param aIndex |
|
234 * @return Character Popup index. |
|
235 */ |
|
236 TInt CurrentCharacterRangeIndex() const; |
|
237 |
|
238 /** |
|
239 * Set ptiEngine InputMode by new range |
|
240 * |
|
241 * @since S60 v3.2 |
|
242 * @param aRange The new Range |
|
243 * @return None. |
|
244 */ |
|
245 void SetEngineInputMode(TInt aRange); |
|
246 |
|
247 /** |
|
248 * Set predictive |
|
249 * |
|
250 * @since S60 v3.2 |
|
251 * @param aPredictive ETrue:show prediction pane EFalse:not show |
|
252 * @return None. |
|
253 */ |
|
254 void SetPredictive(TBool aPredictive); |
|
255 |
|
256 /** |
|
257 * Set full or half |
|
258 * |
|
259 * @since S60 v3.2 |
|
260 * @param aFullHalf 0:half 1:full |
|
261 * @return None. |
|
262 */ |
|
263 void SetFullHalf(TInt aFullHalf); |
|
264 |
|
265 /** |
|
266 * Set backspace or delete |
|
267 * |
|
268 * @since S60 v3.2 |
|
269 * @param aClear 0:backspace 1:delete |
|
270 * @return None. |
|
271 */ |
|
272 void SetClear(TInt aClear); |
|
273 |
|
274 /** |
|
275 * Set Conversion Flag |
|
276 * |
|
277 * @since S60 v3.2 |
|
278 * @param aConversion ETrue:Convert EFalse:not Convert |
|
279 * @return None. |
|
280 */ |
|
281 void SetConversion(TBool aConversion); |
|
282 |
|
283 /** |
|
284 * Set CharacterRange Popup index |
|
285 * |
|
286 * @since S60 v3.2 |
|
287 * @param aIndex |
|
288 * @return None. |
|
289 */ |
|
290 void SetCurrentCharacterRangeIndex(TInt aIndex); |
|
291 |
|
292 /** |
|
293 * From CPeninputDataMgr |
|
294 * Reset data contained in data manager |
|
295 * |
|
296 * @since S60 v3.2 |
|
297 * @return None |
|
298 */ |
|
299 void Reset(); |
|
300 |
|
301 /** |
|
302 * Set writing area size |
|
303 * |
|
304 * @since S60 v3.2 |
|
305 * @param aSize Size of input area |
|
306 * @return None |
|
307 */ |
|
308 void SetInputAreaSize( const TSize& aSize ); |
|
309 |
|
310 |
|
311 /** |
|
312 * Clear direction |
|
313 * |
|
314 * @since S60 v3.2 |
|
315 * @return TInt 1:delete 0:backspace |
|
316 */ |
|
317 TInt ClearDirection() const; |
|
318 |
|
319 protected: |
|
320 |
|
321 /** |
|
322 * Constructor |
|
323 * |
|
324 * @since S60 v3.2 |
|
325 * @param aContext The layout context |
|
326 * @return None |
|
327 */ |
|
328 CPeninputHwrBoxDataMgr( MPeninputLayoutContext* aContext ); |
|
329 |
|
330 /** |
|
331 * 2nd constructor function |
|
332 * |
|
333 * @since S60 v3.2 |
|
334 * @return None. |
|
335 */ |
|
336 void ConstructL(); |
|
337 |
|
338 /** |
|
339 * Transfer the pen's writing speed |
|
340 * |
|
341 * @since S60 v3.2 |
|
342 * @param aWritingSpeed The value of pen's writing speed |
|
343 * @return TInt value to indicating writing speed |
|
344 */ |
|
345 TInt TransferWritingSpeed( TInt aWritingSpeed ) const; |
|
346 |
|
347 /** |
|
348 * Notify HWR's engine to change the setting |
|
349 * |
|
350 * @since S60 v3.2 |
|
351 * @param aType The key whose value will be set |
|
352 * @param aData The value will be set |
|
353 * @return None |
|
354 */ |
|
355 void NotifyEngine( TPeninputDataType aType, TAny* aData ); |
|
356 |
|
357 /** |
|
358 * Set Character range popup |
|
359 * |
|
360 * @since S60 v3.2 |
|
361 * @param aPermittedRanges The permitted ranges. |
|
362 * @return None |
|
363 */ |
|
364 void SetCharacterRangePopupL(TInt aPermittedRanges); |
|
365 |
|
366 private: |
|
367 |
|
368 /** |
|
369 * candidate list |
|
370 */ |
|
371 RPointerArray<HBufC> iCandidates; |
|
372 |
|
373 /** |
|
374 * The candidate range start index |
|
375 */ |
|
376 RArray<TInt> iRangeStartPos; |
|
377 |
|
378 /** |
|
379 * Permitted ranges |
|
380 */ |
|
381 RArray<TInt> iPermittedRanges; |
|
382 |
|
383 /** |
|
384 * The pti engine |
|
385 * Own |
|
386 */ |
|
387 CPtiEngine* iPtiEngine; |
|
388 |
|
389 /** |
|
390 * The Recognizer (Own); |
|
391 */ |
|
392 CPeninputHwrBoxRecognizer* iHwrBoxRecognizer; |
|
393 |
|
394 /** |
|
395 * Writing speed |
|
396 */ |
|
397 TInt iWritingSpeed; |
|
398 |
|
399 /** |
|
400 * Pen size |
|
401 */ |
|
402 TSize iPenSize; |
|
403 |
|
404 /** |
|
405 * Pen color |
|
406 */ |
|
407 TRgb iPenColor; |
|
408 |
|
409 /** |
|
410 * prediction pane on/off |
|
411 */ |
|
412 TBool iPredictive; |
|
413 |
|
414 /** |
|
415 * 0:half 1:full |
|
416 */ |
|
417 TInt iFullHalf; |
|
418 |
|
419 /** |
|
420 * backspace or delete |
|
421 * 1:delete 0:Backspace |
|
422 */ |
|
423 TInt iClear; |
|
424 |
|
425 /** |
|
426 * Conversion on/off |
|
427 */ |
|
428 TBool iConversion; |
|
429 |
|
430 /** |
|
431 * The Character range popup text array |
|
432 * Own |
|
433 */ |
|
434 CDesCArrayFlat* iCharacterRangeArray; |
|
435 |
|
436 /** |
|
437 * The Character range popup rangeId array |
|
438 */ |
|
439 TFixedArray<TInt, KCharacterRangePopupMaxRow> iCharacterRangeIdArray; |
|
440 |
|
441 /** |
|
442 * CharacterRange Popup index(default:0) |
|
443 */ |
|
444 TInt iCurrentCharacterRangeIndex; |
|
445 }; |
|
446 |
|
447 #endif // C_PENINPUTHWRBOXDATAMGR_H |