|
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: |
|
15 * |
|
16 */ |
|
17 #ifndef T_PENINPUTCHNITUTDATA_H |
|
18 #define T_PENINPUTCHNITUTDATA_H |
|
19 |
|
20 #include <peninputlayoutbasecontrol.h> |
|
21 #include <aknfeppeninputenums.h> |
|
22 #include <PtiDefs.h> |
|
23 #include <e32keys.h> |
|
24 |
|
25 #include "peninputgenericitutcustomization.h" |
|
26 |
|
27 const TInt KInvalidScanCode = -1; |
|
28 const TInt KInvalidCtrlId = -1; |
|
29 |
|
30 enum TItutDataType |
|
31 { |
|
32 EScreenSize = EItutPosConfigurableLast + 1, |
|
33 ELayoutOffset, |
|
34 ELayoutRect, |
|
35 EIcfRect, |
|
36 EIcfFont, |
|
37 EBackspaceRect, |
|
38 ESwitchRect, |
|
39 EArrowLeftRect, |
|
40 EArrowRightRect, |
|
41 EArrowUpRect, |
|
42 EArrowDownRect, |
|
43 EOptionsRect, |
|
44 ECloseRect, |
|
45 EImIndicatorRect, // whole rect of label like indicator |
|
46 EImIndicatorOuterRect, // rect of button like indicator, it is also need EImIndicatorRect info |
|
47 EKeypadRect, |
|
48 EKeypadCellRects, |
|
49 EKeypadLeftTextLine, |
|
50 EKeypadRightTextLine1, |
|
51 EKeypadRightTextLine2, |
|
52 EKeypadRightTextLine3, |
|
53 EDropdownlistUnitWidth, |
|
54 EDropdownlistUnitHeight, |
|
55 EDropdownlistHorizontalMargin, |
|
56 EDropdownlistVerticalMargin, |
|
57 EDropdownListNaviWidth, |
|
58 EDropdownListSpinBtnHeight, |
|
59 EDropdownListSpellLTPos, |
|
60 EDropdownListCandsLTPos, |
|
61 EDropdownListPuncLTPos, |
|
62 EDropdownListFont, |
|
63 EDropdownListTextMargin, |
|
64 EDropdownListTextColor, |
|
65 ESpellRect, // used to indicate stroke and zhuyin spelling |
|
66 ESpellFont, |
|
67 ESpellTextColor, |
|
68 ELanguage, |
|
69 EInputMode, |
|
70 ECase, |
|
71 EChnCandidates, |
|
72 EChnPuncCandidates, |
|
73 EMatchSelectionTlPos, |
|
74 EMatchSelectionItemSize, |
|
75 EMatchSelectionItemMargin, |
|
76 EMatchSelectionTextLine, |
|
77 ESwitchInnerRect, |
|
78 ELeftInnerRect, |
|
79 ERightInnerRect, |
|
80 EBackspaceInnerRect, |
|
81 EUpInnerRect, |
|
82 EDownInnerRect, |
|
83 ECloseInnerRect, |
|
84 EOptionInnerRect, |
|
85 EBtnTextLine, |
|
86 ESpellICFRect, |
|
87 ESpellClrRect, |
|
88 ESpellClrInnerRect, |
|
89 ESpellEditIndicatorRect, |
|
90 ESpellTextCancle, |
|
91 ESpellQueryPaneRect, |
|
92 ELatinOnly, |
|
93 EPreviewBubbleRect, |
|
94 EPreviewBubbleInnerRect, |
|
95 EPreviewBubbleFont, |
|
96 EPreviewBubbleTextlayout, |
|
97 }; |
|
98 |
|
99 enum TControlId |
|
100 { |
|
101 ECtrlIdICF = 1000, |
|
102 ECtrlIdBackspace, |
|
103 ECtrlIdSwitch, |
|
104 ECtrlIdArrowLeft, |
|
105 ECtrlIdArrowRight, |
|
106 ECtrlIdArrowUp, |
|
107 ECtrlIdArrowDown, |
|
108 ECtrlIdOptions, |
|
109 ECtrlIdClose, |
|
110 ECtrlIdStdItut, |
|
111 ECtrlIdSpellICF, // used to display spelling of stroke and zhuyin |
|
112 ECtrlIdSpellCandsList, |
|
113 ECtrlIdStdCandsList, |
|
114 ECtrlIdPuncCandsList, |
|
115 ECtrlIdInputSwitch, |
|
116 ECtrlIdMatchSelection, |
|
117 ECtrlIdBackground, // used to display background |
|
118 ECtrlIdIndicator, |
|
119 ECtrlIdSpellIndicator, |
|
120 ECtrlIdOkBtn, |
|
121 ECtrlIdCancelBtn, |
|
122 ECtrlIdCancelWindow, |
|
123 ECtrlIdEditorMenu, |
|
124 ECtrlIdLastStdCtrl = ECtrlIdCancelBtn + 1 |
|
125 }; |
|
126 |
|
127 enum TItutCommand |
|
128 { |
|
129 EItutCmdCandidateSelected = EItutExtCmdLast + 1, |
|
130 EItutCmdGetNextCandidatePage, |
|
131 EItutCmdGetPreviousCandidatePage, |
|
132 EItutCmdCandidateExisted, |
|
133 EItutCmdPredictItemSelected, |
|
134 EItutCmdEnterSpellMode, |
|
135 EItutCmdArrowUp, |
|
136 EItutCmdArrowDown, |
|
137 EItutCmdCheckIcfEmpty |
|
138 }; |
|
139 |
|
140 enum TItutCandidatesIdx |
|
141 { |
|
142 EItutCandidates, |
|
143 EItutPuncCandidates |
|
144 }; |
|
145 |
|
146 class TItutKeyMapping |
|
147 { |
|
148 public: |
|
149 TInt iKeyIdx; |
|
150 TInt iCtrlId; // only valid when key is a button |
|
151 TInt iScanCode; // only valid when key is a virtual key in keyboard |
|
152 }; |
|
153 |
|
154 const TItutKeyMapping ItutKeymap[] = |
|
155 { |
|
156 {EItutKeyArrowLeft, ECtrlIdArrowLeft, KInvalidScanCode}, |
|
157 {EItutKeyArrowRight, ECtrlIdArrowRight, KInvalidScanCode}, |
|
158 {EItutKeyArrowUp, ECtrlIdArrowUp, KInvalidScanCode}, |
|
159 {EItutKeyArrowDown, ECtrlIdArrowDown, KInvalidScanCode}, |
|
160 {EItutKeyClear, ECtrlIdBackspace, KInvalidScanCode}, |
|
161 {EItutKeySwitchLayout, ECtrlIdSwitch, KInvalidScanCode}, |
|
162 {EItutKey1, KInvalidCtrlId, EPtiKey1}, |
|
163 {EItutKey2, KInvalidCtrlId, EPtiKey2}, |
|
164 {EItutKey3, KInvalidCtrlId, EPtiKey3}, |
|
165 {EItutKey4, KInvalidCtrlId, EPtiKey4}, |
|
166 {EItutKey5, KInvalidCtrlId, EPtiKey5}, |
|
167 {EItutKey6, KInvalidCtrlId, EPtiKey6}, |
|
168 {EItutKey7, KInvalidCtrlId, EPtiKey7}, |
|
169 {EItutKey8, KInvalidCtrlId, EPtiKey8}, |
|
170 {EItutKey9, KInvalidCtrlId, EPtiKey9}, |
|
171 {EItutKeyStar, KInvalidCtrlId, EStdKeyNkpAsterisk}, |
|
172 {EItutKey0, KInvalidCtrlId, EPtiKey0}, |
|
173 {EItutKeyHash, KInvalidCtrlId, EStdKeyHash}, |
|
174 }; |
|
175 |
|
176 const TInt LangsArr[] = |
|
177 { |
|
178 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, |
|
179 11, 12, 13, 14, 15, 17, 18, 20, 21, 22, |
|
180 23, 24, 25, 26, 27, 28, 39, 44, 45, 46, |
|
181 47, 48, 49, 51, 59, 67, 68, 70, 76, 78, |
|
182 79, 82, 83, 85, 91, 96, 102, 103, 401, 402, |
|
183 16, 42, 93, 54, 55, 57, 37, 50, 94, 33, |
|
184 29, 30, 31, 58, 72, 65, |
|
185 }; |
|
186 |
|
187 _LIT(KLatinExt, "latin"); |
|
188 _LIT(KCyrillicExt, "cyrillic"); |
|
189 _LIT(KGreekExt, "greek"); |
|
190 _LIT(KHebrewExt, "hebrew"); |
|
191 _LIT(KArabicExt, "arabic"); |
|
192 _LIT(KFarsiExt, "farsi"); |
|
193 _LIT(KUrduExt, "urdu"); |
|
194 _LIT(KThaiExt, "thai"); |
|
195 _LIT(KChnExt, "chinese"); |
|
196 _LIT(KDevanagiriExt, "devanagari"); |
|
197 _LIT(KHangulExt, "korean"); |
|
198 |
|
199 enum TScriptExtIndex |
|
200 { |
|
201 ELatinExt, |
|
202 ECyrillicExt, |
|
203 EGreekExt, |
|
204 EHebrewExt, |
|
205 EArabicExt, |
|
206 EFarsiExt, |
|
207 EUrduExt, |
|
208 EThaiExt, |
|
209 EChnExt, |
|
210 EDevanagiriExt, |
|
211 EHangulExt |
|
212 }; |
|
213 |
|
214 struct TScriptInfo |
|
215 { |
|
216 TBool iCaseSensitive; |
|
217 TInt iStartIdx; // lang start index in langs |
|
218 TInt iEndIdx; // lang end index in langs |
|
219 TScriptExtIndex iScriptExt; |
|
220 }; |
|
221 |
|
222 const TScriptInfo TScriptMapping[] = |
|
223 { |
|
224 {ETrue, 0, 49, ELatinExt}, |
|
225 {ETrue, 50, 52, ECyrillicExt}, |
|
226 {ETrue, 53, 54, EGreekExt}, |
|
227 {EFalse, 55, 55, EHebrewExt}, |
|
228 {EFalse, 56, 56, EArabicExt}, |
|
229 {EFalse, 57, 57, EFarsiExt}, |
|
230 {EFalse, 58, 58, EUrduExt}, |
|
231 {EFalse, 59, 59, EThaiExt}, |
|
232 {ETrue, 60, 62, EChnExt}, // chinese also include abc |
|
233 {ETrue, 63, 64, EDevanagiriExt}, |
|
234 {ETrue, 65, 65, EHangulExt}, |
|
235 }; |
|
236 |
|
237 #endif // T_PENINPUTCHNITUTDATA_H |
|
238 |
|
239 //End Of File |