author | Simon Howkins <simonh@symbian.org> |
Mon, 15 Nov 2010 14:00:51 +0000 | |
branch | RCL_3 |
changeset 59 | 7febbd162ded |
parent 56 | 8152b1f1763a |
permissions | -rw-r--r-- |
44 | 1 |
/* |
2 |
* Copyright (c) 2009-2010 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: header for finger hwr UiLayout |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef C_PENINPUTFINGERHWRARLAYOUT_H |
|
20 |
#define C_PENINPUTFINGERHWRARLAYOUT_H |
|
21 |
||
22 |
// INCLUDES |
|
23 |
#include "peninputpluginutils.h" |
|
24 |
#include "peninputlayout.h" |
|
25 |
#include "peninputfingerhwrarstoreconstants.h" |
|
26 |
#include "peninputfingerhwrarcontrolid.h" |
|
27 |
||
28 |
// FORWARD DECLARATIONS |
|
29 |
class CPeninputFingerHwrArStateManagerBase; |
|
30 |
class CPeninputFingerHwrArDataStore; |
|
31 |
class CRepository; |
|
32 |
class CPeninputFingerHwrArWnd; |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
33 |
class CPeninputFingerHwrArCallBack; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
34 |
|
44 | 35 |
// class DECLARATIONS |
36 |
||
37 |
/** |
|
38 |
* class CPeninputHwrfscnLayout. |
|
39 |
* |
|
40 |
* Chinese full screen handwriting ui layout class. |
|
41 |
* |
|
42 |
* @lib peninputfingerhwr.lib |
|
43 |
* @since S60 v5.0 |
|
44 |
*/ |
|
45 |
class CPeninputFingerHwrArLayout : public CFepUiLayout |
|
46 |
{ |
|
47 |
public: |
|
48 |
/** |
|
49 |
* The writing speed. |
|
50 |
* |
|
51 |
*@since S60 v5.0 |
|
52 |
*/ |
|
53 |
enum TWritingSpeed |
|
54 |
{ |
|
55 |
EWritingSpeedVeryFast = 1, |
|
56 |
EWritingSpeedFast, |
|
57 |
EWritingSpeedNormal, |
|
58 |
EWritingSpeedSlow, |
|
59 |
EWritingSpeedVerySlow |
|
60 |
}; |
|
61 |
public: |
|
62 |
/** |
|
63 |
* Symbian constructor. |
|
64 |
* |
|
65 |
* @since S60 5.0 |
|
66 |
* |
|
67 |
* @param aLayoutOwner The MLayoutOwner |
|
68 |
* @param aInitData Init data for layout |
|
69 |
* @return Pointer to created CPeninputHwrfscnLayout object |
|
70 |
*/ |
|
71 |
static CPeninputFingerHwrArLayout* NewL(MLayoutOwner* aLayoutOwner, |
|
72 |
const TAny* aInitData); |
|
73 |
||
74 |
public: |
|
75 |
//from CFepUiLayout |
|
76 |
/** |
|
77 |
* From CFepUiLayout. |
|
78 |
* Handle layout command event |
|
79 |
* |
|
80 |
* @since Series 60 5.0 |
|
81 |
* @param aCmd Command Id. |
|
82 |
* @param aData Data for command. |
|
83 |
* @return Errors when return value small than 0. |
|
84 |
*/ |
|
85 |
TInt HandleCommand(const TInt aCmd, TUint8* aData); |
|
86 |
||
87 |
/** |
|
88 |
* From CFepUiLayout. |
|
89 |
* Handle layout command event |
|
90 |
* |
|
91 |
* @since Series 60 5.0 |
|
92 |
* @param aCmd Command Id. |
|
93 |
* @param aData Data for command. |
|
94 |
* @return Errors when return value small than 0. |
|
95 |
*/ |
|
96 |
TInt HandleCommandL(const TInt aCmd, TUint8* aData); |
|
97 |
||
98 |
/** |
|
99 |
* From CFepUiLayout. |
|
100 |
* Inform layout the size changing event |
|
101 |
* |
|
102 |
* @since Series 60 5.0 |
|
103 |
* @param pData The event data. |
|
104 |
* @return KErrNone if successfully size changing. |
|
105 |
*/ |
|
106 |
TInt SizeChanged(const TAny* pData); |
|
107 |
||
108 |
/** |
|
109 |
* From CFepUiLayout. |
|
110 |
* Handle editor text coming |
|
111 |
* Called by animation dll when app editor text is coming. |
|
112 |
* If a ui layout has a editor area, it must implements this function to get the text |
|
113 |
* |
|
114 |
* @since Series 60 5.0 |
|
115 |
* @param aData The fep input context field data |
|
116 |
* @return KErrNone is operation succeeded. |
|
117 |
*/ |
|
118 |
TInt OnAppEditorTextComing(const TFepInputContextFieldData& aData); |
|
119 |
||
120 |
/** |
|
121 |
* From CFepUiLayout. |
|
122 |
* Handle application info change |
|
123 |
* |
|
124 |
* @since Series 60 5.0 |
|
125 |
* @param aInfo The information. |
|
126 |
* @param aType The information type. |
|
127 |
* @return none |
|
128 |
*/ |
|
129 |
void HandleAppInfoChange(const TDesC& aInfo, TPeninputAppInfo aType); |
|
130 |
||
131 |
||
132 |
/** |
|
133 |
* From CFepUiLayout |
|
134 |
* Called by owner when the system resource changed event. |
|
135 |
* |
|
136 |
* @since S60 v4.0 |
|
137 |
* @param aType the event type |
|
138 |
* @return KErrNone if successfully size changing. |
|
139 |
*/ |
|
140 |
TInt OnResourceChange(TInt aType); |
|
141 |
||
142 |
/** |
|
143 |
* From MPenUiLayoutBase |
|
144 |
* Return the peninput ui type |
|
145 |
* |
|
146 |
* @since Series 60 5.0 |
|
147 |
* @return The ui type @see TPenInputUiType |
|
148 |
*/ |
|
149 |
TInt PenInputType(); |
|
150 |
||
151 |
/** |
|
152 |
* From MFepLayoutBase |
|
153 |
* Called by owner when the layout is going to be hidden |
|
154 |
* |
|
155 |
* @since S60 5.0 |
|
156 |
* @return none |
|
157 |
*/ |
|
158 |
void OnDeActivate(); |
|
159 |
void CallBackL(); |
|
160 |
||
161 |
/** |
|
162 |
* Check if the First string will be allowed to submitted directly to editor without selection |
|
163 |
*/ |
|
164 |
TBool IsAllowedToSubmitDefaultCandiate(); |
|
165 |
||
166 |
public: |
|
167 |
//from MEventObserver; |
|
168 |
/** |
|
169 |
* From MEventObserver |
|
170 |
* handle control event. |
|
171 |
* |
|
172 |
* @since Series 60 5.0 |
|
173 |
* @param aEventType The event type |
|
174 |
* @param aCtrl The control who sends the event |
|
175 |
* @param aEventData The event data |
|
176 |
* @return none |
|
177 |
*/ |
|
178 |
void HandleControlEvent(TInt aEventType, CFepUiBaseCtrl* aCtrl, |
|
179 |
const TDesC& aEventData); |
|
180 |
void HandleControlEventL(TInt aEventType, CFepUiBaseCtrl* aCtrl, |
|
181 |
const TDesC& aEventData); |
|
182 |
||
183 |
public: |
|
184 |
||
185 |
/** |
|
186 |
* Get the data stroe object. |
|
187 |
* |
|
188 |
* @since Series 60 5.0 |
|
189 |
* @return The CPeninputHwrfscnDataStore reference |
|
190 |
*/ |
|
191 |
CPeninputFingerHwrArDataStore& DataStore(); |
|
192 |
||
193 |
/** |
|
194 |
* Replace the char before the cursor in forground app with a new char. |
|
195 |
* |
|
196 |
* @since S60 5.0 |
|
197 |
* @param aOldCharCode The old char need to be replaced |
|
198 |
* @param aNewCharCode The new char for replacing the old char |
|
199 |
* @return none |
|
200 |
*/ |
|
201 |
void Replace(const TDesC& aOldCharCode, const TDesC& aNewCharCode, |
|
202 |
const TBool aIsPart = EFalse); |
|
203 |
||
204 |
/** |
|
205 |
* Submit string to layout owner. |
|
206 |
* |
|
207 |
* @since S60 5.0 |
|
208 |
* @param aCharCode The buffer needed to be submitted. |
|
209 |
* @return none |
|
210 |
*/ |
|
211 |
void SubmitStringToFep(const TDesC& aCharCode); |
|
212 |
||
213 |
/** |
|
214 |
* Submit char to layout owner. |
|
215 |
* |
|
216 |
* @since S60 5.0 |
|
217 |
* @param aCharCode The buffer needed to be submitted. |
|
218 |
* @return none |
|
219 |
*/ |
|
220 |
void SubmitCharToFep(const TInt aCharCode); |
|
221 |
||
222 |
/** |
|
223 |
* repository callback for settings. |
|
224 |
* |
|
225 |
* @since S60 5.0 |
|
226 |
* @param aPtr callback data. |
|
227 |
* @return error code. |
|
228 |
*/ |
|
229 |
static TInt HandleGSRepositoryCallBack(TAny* aPtr); |
|
230 |
||
231 |
/** |
|
232 |
* load default settings. |
|
233 |
* |
|
234 |
* @since S60 5.0 |
|
235 |
* @param aSetPosFlag The buffer needed to be submitted. |
|
236 |
* @return none |
|
237 |
*/ |
|
238 |
void LoadAndPublishDefaultL(); |
|
239 |
||
240 |
||
241 |
/** |
|
242 |
* sync stroke end mark of writingbox with hwr engine. |
|
243 |
* |
|
244 |
* @param aEndMark a TPoint object as new stroke end mark. |
|
245 |
* @return none |
|
246 |
*/ |
|
247 |
void SyncHwrStrokeEndMark(const TPoint& aEndMark); |
|
248 |
||
249 |
private: |
|
250 |
/** |
|
251 |
* C++ constructor |
|
252 |
* |
|
253 |
* @since S60 5.0 |
|
254 |
* @param aLayoutOwner The MLayoutOwner pointer. |
|
255 |
* @return none |
|
256 |
*/ |
|
257 |
CPeninputFingerHwrArLayout(MLayoutOwner* aLayoutOwner); |
|
258 |
||
259 |
/** |
|
260 |
* standard c++ destructor. |
|
261 |
* |
|
262 |
* @since S60 5.0 |
|
263 |
* @return none |
|
264 |
*/ |
|
265 |
~CPeninputFingerHwrArLayout(); |
|
266 |
||
267 |
/** |
|
268 |
* Symbian second-phase constructor |
|
269 |
* |
|
270 |
* @since S60 5.0 |
|
271 |
* @param aInitData The init data passed by layout engine. |
|
272 |
* @return none |
|
273 |
*/ |
|
274 |
void ConstructL(const TAny* aInitData); |
|
275 |
||
276 |
||
277 |
/** |
|
278 |
* Create the hwr box window |
|
279 |
* |
|
280 |
* @since S60 5.0 |
|
281 |
* @return none |
|
282 |
*/ |
|
283 |
void CreateHwrWindowL(); |
|
284 |
||
285 |
/** |
|
286 |
* Create the state manager |
|
287 |
* |
|
288 |
* @since S60 5.0 |
|
289 |
* @return none |
|
290 |
*/ |
|
291 |
void CreateStateManagerL(); |
|
292 |
||
293 |
||
294 |
private: |
|
295 |
/** |
|
296 |
* handler of button down event. |
|
297 |
* |
|
298 |
* @since S60 5.0 |
|
299 |
* @param aEventType event type id. |
|
300 |
* @param aCtrl event src. |
|
301 |
* @param aEventData event data. |
|
302 |
* @return none |
|
303 |
*/ |
|
304 |
void OnCtrlButtonDownL(TInt aEventType, CFepUiBaseCtrl* aCtrl, |
|
305 |
const TDesC& aEventData); |
|
306 |
||
307 |
/** |
|
308 |
* handler of button up event. |
|
309 |
* |
|
310 |
* @since S60 5.0 |
|
311 |
* @param aEventType event type id. |
|
312 |
* @param aCtrl event src. |
|
313 |
* @param aEventData event data. |
|
314 |
* @return none |
|
315 |
*/ |
|
316 |
void OnCtrlButtonUpL(TInt aEventType, CFepUiBaseCtrl* aCtrl, |
|
317 |
const TDesC& aEventData); |
|
318 |
||
319 |
/** |
|
320 |
* handler of rep-button clicked event. |
|
321 |
* |
|
322 |
* @since S60 5.0 |
|
323 |
* @param aCtrl event src. |
|
324 |
* @param aData event data. |
|
325 |
* @return none |
|
326 |
*/ |
|
327 |
void OnRepButtonClickedL(CFepUiBaseCtrl* aCtrl, const TDesC& aData); |
|
328 |
||
329 |
/** |
|
330 |
* clicked event handler of the BACKSPACE button. |
|
331 |
* |
|
332 |
* @since S60 5.0 |
|
333 |
* @return none |
|
334 |
*/ |
|
335 |
void OnBackspaceClickedL(); |
|
336 |
||
337 |
/** |
|
338 |
* handler of virtual key down event. |
|
339 |
* |
|
340 |
* @since S60 5.0 |
|
341 |
* @param aCtrl event src. |
|
342 |
* @param aData event data. |
|
343 |
* @return none |
|
344 |
*/ |
|
345 |
void OnVirtualKeyDownL(CFepUiBaseCtrl* aCtrl, const TDesC& aData); |
|
346 |
||
347 |
/** |
|
348 |
* handler of virtual key up event. |
|
349 |
* |
|
350 |
* @since S60 5.0 |
|
351 |
* @param aCtrl event src. |
|
352 |
* @param aData event data. |
|
353 |
* @return none |
|
354 |
*/ |
|
355 |
void OnVirtualKeyUpL(CFepUiBaseCtrl* aCtrl, const TDesC& aData); |
|
356 |
||
357 |
/** |
|
358 |
* handler of candidate list event. |
|
359 |
* |
|
360 |
* @since S60 5.0 |
|
361 |
* @param aCtrl event src. |
|
362 |
* @param aData event data. |
|
363 |
* @return none |
|
364 |
*/ |
|
365 |
void OnCandidateSelectedL(CFepUiBaseCtrl* aCtrl, const TDesC& aData); |
|
366 |
||
367 |
/** |
|
368 |
* clicked event handler of icf. |
|
369 |
* |
|
370 |
* @since S60 5.0 |
|
371 |
* @return none |
|
372 |
*/ |
|
373 |
void OnIcfClicked(); |
|
374 |
||
375 |
/** |
|
376 |
* handler of StrokeStarted event. |
|
377 |
* |
|
378 |
* @since S60 5.0 |
|
379 |
* @return none |
|
380 |
*/ |
|
381 |
void OnHwrStrokeStartedL(); |
|
382 |
||
383 |
/** |
|
384 |
* handler of StrokeFinished event. |
|
385 |
* |
|
386 |
* @since S60 5.0 |
|
387 |
* @return none |
|
388 |
*/ |
|
389 |
void OnHwrStrokeFinishedL(); |
|
390 |
||
391 |
/** |
|
392 |
* handler of CharacterFinished event. |
|
393 |
* |
|
394 |
* @since S60 5.0 |
|
395 |
* @return none |
|
396 |
*/ |
|
397 |
void OnHwrCharacterFinishedL(); |
|
398 |
||
399 |
private: |
|
400 |
/** |
|
401 |
* get value from repository |
|
402 |
* |
|
403 |
* @since S60 v5.0 |
|
404 |
* @param aWatcher repository reader. |
|
405 |
* @param aId value id. |
|
406 |
* @return value |
|
407 |
*/ |
|
408 |
TInt GetNewValue(CAknFepRepositoryWatcher* aWatcher, const TInt aId); |
|
409 |
||
410 |
/** |
|
411 |
* get hwr trail color from repository |
|
412 |
* |
|
413 |
* @since S60 v5.0 |
|
414 |
* @return color value. |
|
415 |
*/ |
|
416 |
TInt GetPenTrailColor(); |
|
417 |
||
418 |
||
419 |
/** |
|
420 |
* set hwr writing speed. |
|
421 |
* |
|
422 |
* @since S60 v5.0 |
|
423 |
* @param aWritingSpeed speed |
|
424 |
* @return none |
|
425 |
*/ |
|
426 |
void SetWritingSpeed(const TInt aWritingSpeed); |
|
427 |
||
428 |
/** |
|
429 |
* set hwr writing pen width. |
|
430 |
* |
|
431 |
* @since S60 v5.0 |
|
432 |
* @param aPenSize The pen size |
|
433 |
* @return none |
|
434 |
*/ |
|
435 |
void SetBoxPenSize(const TSize aPenSize); |
|
436 |
||
437 |
/** |
|
438 |
* set hwr writing pen color. |
|
439 |
* |
|
440 |
* @since S60 v5.0 |
|
441 |
* @param aWritingSpeed speed |
|
442 |
* @return none |
|
443 |
*/ |
|
444 |
void SetBoxPenColor(const TInt aPenColor); |
|
445 |
||
446 |
/** |
|
447 |
* set guide line on or off. |
|
448 |
* |
|
449 |
* @since S60 v5.0 |
|
450 |
* @param aGuideLineOn guide line on or off. |
|
451 |
* @return none |
|
452 |
*/ |
|
453 |
void SetGuideLineOn(const TBool aGuideLineOn); |
|
454 |
||
455 |
/** |
|
456 |
* change current state manager to standby state. |
|
457 |
* |
|
458 |
* @since S60 v5.0 |
|
459 |
* @return none |
|
460 |
*/ |
|
461 |
void ChangeCurStateToStandby(); |
|
462 |
||
463 |
/** |
|
464 |
* handler of NumMapping changed event. |
|
465 |
* |
|
466 |
* @since S60 5.0 |
|
467 |
* @return none |
|
468 |
*/ |
|
469 |
void OnNumMappingChangedL(); |
|
470 |
/** |
|
471 |
* revert special characters direction before sending to editor. |
|
472 |
* |
|
473 |
* @since S60 v5.2 |
|
474 |
* @return none |
|
475 |
*/ |
|
476 |
TBool RevertSymbolDirection(TInt aInChar, TInt & aOutChar); |
|
477 |
||
478 |
private: |
|
479 |
||
480 |
/** |
|
481 |
* main window. |
|
482 |
* not own |
|
483 |
*/ |
|
484 |
CPeninputFingerHwrArWnd* iHwrWnd; |
|
485 |
||
486 |
/** |
|
487 |
* The data store |
|
488 |
* Own |
|
489 |
*/ |
|
490 |
CPeninputFingerHwrArDataStore* iDataStore; |
|
491 |
||
492 |
/** |
|
493 |
* The state manager |
|
494 |
* Own |
|
495 |
*/ |
|
496 |
CPeninputFingerHwrArStateManagerBase* iStateMgr; |
|
497 |
||
498 |
/** |
|
499 |
* The resource Id |
|
500 |
* |
|
501 |
*/ |
|
502 |
TInt iResId; |
|
503 |
||
504 |
/** |
|
505 |
* Repository watcher |
|
506 |
*/ |
|
507 |
CAknFepRepositoryWatcher* iGSRepositoryWatcher; |
|
508 |
||
509 |
/** |
|
510 |
* Repository object. |
|
511 |
*/ |
|
512 |
CRepository* iRepositorySetting; |
|
513 |
||
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
514 |
/** |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
515 |
* repository object. |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
516 |
*/ |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
517 |
// CRepository* iCommonEngineRepository; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
518 |
|
44 | 519 |
/** |
520 |
* Check if the stroke of drawing the character on the |
|
521 |
* HWR box is started |
|
522 |
*/ |
|
523 |
TBool iIsStrokeOfDrawingCharacerStarted; |
|
524 |
||
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
525 |
CPeninputFingerHwrArCallBack* iCallBack; |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
526 |
|
44 | 527 |
/** |
528 |
* Check if the editor is MFNE |
|
529 |
*/ |
|
530 |
TBool iIsEditorMFNE; |
|
531 |
||
532 |
/** |
|
533 |
* Last overlap index. |
|
534 |
*/ |
|
535 |
TInt iLastOverlapIdx; |
|
536 |
}; |
|
537 |
#endif //C_PENINPUTFINGERHWRARLAYOUT_H |