|
1 /* |
|
2 * Copyright (c) 2002-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: Provides the TAknFepUiInputStateInitialKatakana methods. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 // INCLUDE FILES |
|
30 #include "AknFepUiInputStateInitialKatakana.h" |
|
31 #include "AknFepUIManagerStateInterface.h" // MAknFepUIManagerStateInterface |
|
32 #include "AknFepManagerUIInterface.h" // MAknFepManagerUIInterface |
|
33 #include "AknFepGlobalEnums.h" |
|
34 |
|
35 #include <PtiDefs.h> // keys |
|
36 #include <PtiEngine.h> |
|
37 |
|
38 // CONSTANTS |
|
39 |
|
40 /** |
|
41 * TAknFepUiInputStateInitialKatakana class. |
|
42 * |
|
43 */ |
|
44 //============================ MEMBER FUNCTIONS ============================== |
|
45 |
|
46 // --------------------------------------------------------------------------- |
|
47 // TAknFepUiInputStateInitialKatakana::TAknFepUiInputStateInitialKatakana |
|
48 // C++ default Constructor |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 TAknFepUiInputStateInitialKatakana::TAknFepUiInputStateInitialKatakana( |
|
52 MAknFepUIManagerStateInterface* aOwner, |
|
53 MAknFepUICtrlContainerJapanese* aUIContainer) |
|
54 :TAknFepUiInputStateInitialJapaneseBase(aOwner, aUIContainer) |
|
55 { |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------------------------- |
|
59 // TAknFepUiInputStateInitialKatakana::InitializeStateL |
|
60 // Initialize State |
|
61 // --------------------------------------------------------------------------- |
|
62 // |
|
63 void TAknFepUiInputStateInitialKatakana::InitializeStateL() |
|
64 { |
|
65 TAknFepUiInputStateInitialJapaneseBase::InitializeStateL(); |
|
66 |
|
67 // Setup PtiEngine |
|
68 CPtiEngine* ptiEngine = iOwner->PtiEngine(); |
|
69 ptiEngine->ClearCurrentWord(); |
|
70 // Set Character Mode |
|
71 SetInputMode(iOwner->FepMan()->CharacterWidth()); |
|
72 } |
|
73 |
|
74 // --------------------------------------------------------------------------- |
|
75 // TAknFepUiInputStateInitialKatakana::HandleCommandL |
|
76 // Handling command |
|
77 // --------------------------------------------------------------------------- |
|
78 // |
|
79 void TAknFepUiInputStateInitialKatakana::HandleCommandL(TInt aCommandId) |
|
80 { |
|
81 if (aCommandId == EJapanFepCmdModeFullWidth |
|
82 || aCommandId == EJapanFepCmdModeHalfWidth) |
|
83 { |
|
84 // Set Character Mode |
|
85 SetInputMode(iOwner->FepMan()->CharacterWidth()); |
|
86 } |
|
87 } |
|
88 |
|
89 // --------------------------------------------------------------------------- |
|
90 // TAknFepUiInputStateInitialKatakana::SetInputMode |
|
91 // Setting input mode to PtiEngine |
|
92 // --------------------------------------------------------------------------- |
|
93 // |
|
94 void TAknFepUiInputStateInitialKatakana::SetInputMode(const TWidthChar aWidth) |
|
95 { |
|
96 CPtiEngine* ptiEngine = iOwner->PtiEngine(); |
|
97 TPtiEngineInputMode inputmode = EPtiEngineInputModeNone; |
|
98 switch(aWidth) |
|
99 { |
|
100 case EHalfWidthChar: |
|
101 inputmode = (iOwner->IsQwerty())? |
|
102 EPtiEngineKatakanaQwerty |
|
103 : EPtiEngineKatakana; |
|
104 break; |
|
105 |
|
106 case EFullWidthChar: |
|
107 inputmode = (iOwner->IsQwerty())? |
|
108 EPtiEngineFullWidthKatakanaQwerty |
|
109 : EPtiEngineFullWidthKatakana; |
|
110 break; |
|
111 |
|
112 default: // no operation |
|
113 break; |
|
114 } |
|
115 if (inputmode != EPtiEngineInputModeNone) |
|
116 { |
|
117 ptiEngine->SetInputMode(inputmode); |
|
118 } |
|
119 } |
|
120 // End of file |