89 #ifdef RD_INTELLIGENT_TEXT_INPUT |
89 #ifdef RD_INTELLIGENT_TEXT_INPUT |
90 ptiengine->SetKeyboardType(iOwner->FepMan()->KeyboardLayout()); |
90 ptiengine->SetKeyboardType(iOwner->FepMan()->KeyboardLayout()); |
91 #endif |
91 #endif |
92 } |
92 } |
93 |
93 |
|
94 TInt TAknFepInputStateInitialChineseGenericQwerty::ToneMark(TInt aKey, TDes& aResult) |
|
95 { |
|
96 CPtiEngine* ptiengine = iOwner->PtiEngine(); |
|
97 TInt number = 0; |
|
98 aResult.Zero(); |
|
99 if(ptiengine) |
|
100 { |
|
101 TBuf<KMaxName> data; |
|
102 ptiengine->MappingDataForKey((TPtiKey)aKey, data, EPtiCaseLower); |
|
103 if(data.Length() > 0) |
|
104 { |
|
105 for(TInt i = 0; i < data.Length(); i++) |
|
106 { |
|
107 if(data[i] == KZhuyinTone2 || data[i] == KZhuyinTone3 || data[i] == KZhuyinTone4 || data[i] == KZhuyinTone5) |
|
108 { |
|
109 if(aResult.MaxLength() > i) |
|
110 { |
|
111 aResult.Append(data[i]); |
|
112 number++; |
|
113 } |
|
114 } |
|
115 } |
|
116 } |
|
117 } |
|
118 return number; |
|
119 } |
|
120 |
94 TBool TAknFepInputStateInitialChineseGenericQwerty::HandleKeyL(TInt aKey, TKeyPressLength aLength) |
121 TBool TAknFepInputStateInitialChineseGenericQwerty::HandleKeyL(TInt aKey, TKeyPressLength aLength) |
95 { |
122 { |
96 CPtiEngine* ptiengine = iOwner->PtiEngine(); |
123 CPtiEngine* ptiengine = iOwner->PtiEngine(); |
97 |
124 |
98 TBool ret = EFalse; |
125 TBool ret = EFalse; |
122 && !fepMan->IsFlagSet(CAknFepManager::EFlagQwertyShiftMode) |
149 && !fepMan->IsFlagSet(CAknFepManager::EFlagQwertyShiftMode) |
123 && !fepMan->IsFlagSet(CAknFepManager::EFlagShiftKeyDepressed) |
150 && !fepMan->IsFlagSet(CAknFepManager::EFlagShiftKeyDepressed) |
124 && !fepMan->IsFlagSet(CAknFepManager::EFlagQwertyChrKeyDepressed)) |
151 && !fepMan->IsFlagSet(CAknFepManager::EFlagQwertyChrKeyDepressed)) |
125 { |
152 { |
126 TBuf<1> ToneMarkBuf; |
153 TBuf<1> ToneMarkBuf; |
127 #ifdef RD_INTELLIGENT_TEXT_INPUT |
154 if(ToneMark(aKey, ToneMarkBuf) > 0) |
128 if( keyboardType == EPtiKeyboardQwerty4x12) |
155 |
129 { |
156 |
130 #endif |
157 |
131 switch(aKey) |
|
132 { |
|
133 case EPtiKeyQwerty3: |
|
134 ToneMarkBuf.Append(KZhuyinTone3); |
|
135 break; |
|
136 |
|
137 case EPtiKeyQwerty4: |
|
138 ToneMarkBuf.Append(KZhuyinTone4); |
|
139 break; |
|
140 |
|
141 case EPtiKeyQwerty6: |
|
142 ToneMarkBuf.Append(KZhuyinTone2); |
|
143 break; |
|
144 |
|
145 case EPtiKeyQwerty7: |
|
146 ToneMarkBuf.Append(KZhuyinTone5); |
|
147 break; |
|
148 default: |
|
149 break; |
|
150 } |
|
151 #ifdef RD_INTELLIGENT_TEXT_INPUT |
|
152 } |
|
153 else |
|
154 if (keyboardType == EPtiKeyboardQwerty4x10 || keyboardType |
|
155 == EPtiKeyboardQwerty3x11) |
|
156 { |
158 { |
157 switch (aKey) |
159 |
158 { |
160 |
159 case EPtiKeyQwertyE: |
161 |
160 ToneMarkBuf.Append(KZhuyinTone3); |
|
161 break; |
|
162 |
|
163 case EPtiKeyQwertyR: |
|
164 ToneMarkBuf.Append(KZhuyinTone4); |
|
165 break; |
|
166 |
|
167 case EPtiKeyQwertyY: |
|
168 ToneMarkBuf.Append(KZhuyinTone2); |
|
169 break; |
|
170 |
|
171 case EPtiKeyQwertyU: |
|
172 ToneMarkBuf.Append(KZhuyinTone5); |
|
173 break; |
|
174 default: |
|
175 break; |
|
176 } |
|
177 } |
|
178 #endif |
|
179 |
162 |
180 MAknFepManagerUIInterface* fepMan = iOwner->FepMan(); |
163 MAknFepManagerUIInterface* fepMan = iOwner->FepMan(); |
181 fepMan->NewCharacterL(ToneMarkBuf); |
164 fepMan->NewCharacterL(ToneMarkBuf); |
182 fepMan->CommitInlineEditL(); |
165 fepMan->CommitInlineEditL(); |
183 if (fepMan->IsFlagSet(CAknFepManager::EFlagEditorFull)) |
166 if (fepMan->IsFlagSet(CAknFepManager::EFlagEditorFull)) |
184 { |
167 { |
185 fepMan->ClearFlag(CAknFepManager::EFlagEditorFull); |
168 fepMan->ClearFlag(CAknFepManager::EFlagEditorFull); |
186 iOwner->FepMan()->TryCloseUiL(); |
169 iOwner->FepMan()->TryCloseUiL(); |
187 } |
170 } |
188 ret = ETrue; |
171 ret = ETrue; |
|
172 } |
189 } |
173 } |
190 else if(iOwner->IsValidChineseInputKeyQwerty(aKey) && |
174 else if(iOwner->IsValidChineseInputKeyQwerty(aKey) && |
191 !fepMan->IsFlagSet(CAknFepManager::EFlagQwertyChrKeyDepressed) && |
175 !fepMan->IsFlagSet(CAknFepManager::EFlagQwertyChrKeyDepressed) && |
192 #ifdef RD_INTELLIGENT_TEXT_INPUT |
176 #ifdef RD_INTELLIGENT_TEXT_INPUT |
193 !fepMan->IsFlagSet(CAknFepManager::EFlagQwertyShiftMode) && |
177 !fepMan->IsFlagSet(CAknFepManager::EFlagQwertyShiftMode) && |
334 } |
318 } |
335 #endif |
319 #endif |
336 return response; |
320 return response; |
337 } |
321 } |
338 |
322 |
|
323 //-------------------------------------------------------------------------- |
|
324 // The gate to decide whether it is a character is whether it has valid mapping |
|
325 // If return ETrue, the key will pass to ptiengine. |
|
326 //-------------------------------------------------------------------------- |
|
327 // |
339 TBool TAknFepInputStateInitialChineseGenericQwerty::IsCharacter(TInt aKey) |
328 TBool TAknFepInputStateInitialChineseGenericQwerty::IsCharacter(TInt aKey) |
340 { |
329 { |
341 TBool response = EFalse; |
330 TBool response = EFalse; |
342 if (aKey >= EPtiKeyQwertyA && aKey <= EPtiKeyQwertyZ) |
331 CPtiEngine* ptiengine = iOwner->PtiEngine(); |
|
332 MAknFepManagerUIInterface* fepMan = iOwner->FepMan(); |
|
333 TPtiTextCase textCase = EPtiCaseLower; |
|
334 if (ptiengine && fepMan) |
|
335 { |
|
336 TBuf<KMaxName> data; |
|
337 ptiengine->MappingDataForKey((TPtiKey)aKey, data, textCase); |
|
338 if (data.Length() > 0) |
|
339 { |
|
340 response = ETrue; |
|
341 } |
|
342 } |
|
343 |
|
344 // exception Z might has no mapping but need to put into ptiengine. |
|
345 if(!response && aKey == EPtiKeyQwertyZ) |
343 { |
346 { |
344 response = ETrue; |
347 response = ETrue; |
345 } |
348 } |
346 return response; |
349 return response; |
347 } |
350 } |