1 /* |
|
2 * Copyright (c) 2004 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: |
|
15 * CAknFepInputStateQwertyKorean implementation |
|
16 * |
|
17 */ |
|
18 |
|
19 #include "AknFepUiInputStateQwertyKorean.h" |
|
20 #include "AknFepUIManagerStateInterface.h" //MAknFepUIManagerStateInterface |
|
21 #include "AknFepManagerUIInterface.h" //MAknFepManagerUIInterface |
|
22 //#include "AknFepDbgKorean.h" |
|
23 |
|
24 #include <PtiEngine.h> |
|
25 #include <PtiDefs.h> |
|
26 #include <PtiKeyMappings.h> |
|
27 #include <PtiDefs.h> |
|
28 |
|
29 TAknFepInputStateQwertyKorean::TAknFepInputStateQwertyKorean( |
|
30 MAknFepUIManagerStateInterface* aOwner) |
|
31 : TAknFepInputStateQwerty(aOwner) |
|
32 { |
|
33 CPtiEngine& ptiEngine(*(aOwner->PtiEngine())); |
|
34 ptiEngine.SetInputMode(EPtiEngineQwertyKorean); |
|
35 ptiEngine.ClearCurrentWord(); |
|
36 } |
|
37 |
|
38 TAknFepInputStateQwertyKorean::~TAknFepInputStateQwertyKorean() |
|
39 { |
|
40 } |
|
41 |
|
42 TBool TAknFepInputStateQwertyKorean::HandleKeyL(TInt aKey, TKeyPressLength /*aLength*/) |
|
43 { |
|
44 // LOG2("KO.IS.QWERTY.HandleKeyL %d,%d",aKey,aLength); |
|
45 CPtiEngine& ptiEngine(*(iOwner->PtiEngine())); |
|
46 MAknFepManagerUIInterface& fepMan(*(iOwner->FepMan())); |
|
47 |
|
48 TPtrC text(ptiEngine.AppendKeyPress((TPtiKey)aKey)); |
|
49 TBuf<1> chr; |
|
50 for (TInt jj = 0; jj < text.Length(); jj++) |
|
51 { |
|
52 chr.Zero(); |
|
53 chr.Append(text[jj]); |
|
54 fepMan.NewCharacterL(chr); |
|
55 } |
|
56 return ETrue; |
|
57 } |
|
58 |
|
59 void TAknFepInputStateQwertyKorean::KeyTimerExpired() |
|
60 { |
|
61 // LOG1("KO.IS.QWERTY.KeyTimerExpired %d",iData); |
|
62 CPtiEngine& ptiEngine(*(iOwner->PtiEngine())); |
|
63 MAknFepManagerUIInterface& fepMan(*(iOwner->FepMan())); |
|
64 |
|
65 TPtrC text(ptiEngine.CurrentWord()); |
|
66 TBuf<1> chr; |
|
67 for (TInt jj = 0; jj < text.Length(); jj++) |
|
68 { |
|
69 chr.Zero(); |
|
70 chr.Append(text[jj]); |
|
71 TRAP_IGNORE( fepMan.NewCharacterL(chr) ); |
|
72 } |
|
73 |
|
74 //TRAPD(err, fepMan.CommitInlineEditL()) |
|
75 TRAP_IGNORE( fepMan.CommitInlineEditL() ) |
|
76 } |
|
77 |
|
78 //fepMan.StartInlineEditL(text); |
|
79 //iFepMan.StartInlineEditL() |
|
80 //virtual void SetCursorSelectionL(const TCursorSelection& aCurSel, TBool aSyncCursor) = 0; |
|