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) 2007 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 |
* Provides the TAknFepInputStateEntryMiniQwertyStrokePhrase, |
|
16 |
* TAknFepInputStateEditingMiniQwertyStrokePhrase, |
|
17 |
* TAknFepUiInputStateCandidateMiniQwertyStrokePhrase methods. |
|
18 |
* |
|
19 |
*/ |
|
20 |
||
21 |
||
22 |
||
23 |
||
24 |
||
25 |
||
26 |
||
27 |
||
28 |
||
29 |
||
30 |
||
31 |
||
32 |
// System includes |
|
33 |
#include <PtiEngine.h> |
|
34 |
#include <PtiUserDicEntry.h> |
|
35 |
#include <aknnotewrappers.h> //CAknWarningNote |
|
36 |
#include <aknfep.rsg> |
|
37 |
||
38 |
// User includes |
|
39 |
#include "AknFepUiCtrlContainerChinese.h" |
|
40 |
#include "AknFepUICtrlCandidatePane.h" |
|
41 |
#include "AknFepUICtrlInputPane.h" |
|
42 |
#include "aknfepuictrleditpane.h" //phrase creation |
|
43 |
#include "AknFepUIManagerStateInterface.h" |
|
44 |
#include "AknFepManager.h" |
|
45 |
#include "aknfepuiinputstateminiqwertystrokephrase.h" |
|
46 |
const TInt KManualChangeState = 0; |
|
47 |
||
48 |
// --------------------------------------------------------------------------- |
|
49 |
// TAknFepInputStateEntryMiniQwertyStrokePhrase::TAknFepInputStateEntryMiniQwertyStrokePhrase |
|
50 |
// C++ default constructor |
|
51 |
// --------------------------------------------------------------------------- |
|
52 |
// |
|
53 |
TAknFepInputStateEntryMiniQwertyStrokePhrase::TAknFepInputStateEntryMiniQwertyStrokePhrase( |
|
54 |
MAknFepUIManagerStateInterface* aOwner, |
|
55 |
MAknFepUICtrlContainerChinese* aUIContainer ): |
|
56 |
TAknFepInputMiniQwertyStrokePhraseBase( aOwner, aUIContainer ) |
|
57 |
{ |
|
58 |
iState = EEntry; |
|
59 |
UIContainer()->SetLayout( MAknFepUICtrlContainerChinese::ELayoutKeystroke ); |
|
60 |
UIContainer()->FocusCandidatePane( ETrue ); |
|
61 |
UIContainer()->CandidatePane()->SelectFirstPhrase(); |
|
62 |
UIContainer()->CandidatePane()->ShowCandidateOrdinals( EFalse ); |
|
63 |
UIContainer()->SetFepMan( iOwner->FepMan() ); |
|
64 |
// so that it could handle EKeyCBA1 |
|
65 |
iOwner->FepMan()->EntryPhrase( ETrue ); |
|
66 |
RefreshUI(); |
|
67 |
} |
|
68 |
// --------------------------------------------------------------------------- |
|
69 |
// TAknFepInputStateEntryMiniQwertyStrokePhraseCreation::HandleKeyL |
|
70 |
// Handle system key press event. |
|
71 |
// --------------------------------------------------------------------------- |
|
72 |
// |
|
73 |
TBool TAknFepInputStateEntryMiniQwertyStrokePhrase::HandleKeyL( TInt aKey, |
|
74 |
TKeyPressLength aLength ) |
|
75 |
{ |
|
76 |
TBool ret = ETrue; |
|
77 |
MAknFepUICtrlContainerChinese* uiContainer = UIContainer(); |
|
78 |
MAknFepUICtrlCandidatePane* candidatePane = UIContainer()->CandidatePane(); |
|
79 |
switch ( aKey ) |
|
80 |
{ |
|
81 |
case EStdKeyLeftFunc: //chr key |
|
82 |
case EKeyLeftShift: |
|
83 |
case EKeyRightShift: |
|
84 |
case EKeyLeftCtrl: |
|
85 |
case EKeyRightCtrl: |
|
86 |
case EKeyRightFunc://fn |
|
87 |
case EKeyLeftFunc: // fn |
|
88 |
{ |
|
89 |
iOwner->FepMan()->TryCloseUiL(); |
|
90 |
ret = EFalse; |
|
91 |
break; |
|
92 |
} |
|
93 |
case EStdKeyDevice1: // cancel key |
|
94 |
{ |
|
95 |
iOwner->FepMan()->TryCloseUiL(); |
|
96 |
break; |
|
97 |
} |
|
98 |
case EStdKeyEnter: |
|
99 |
case EStdKeySingleQuote: // The "&" key |
|
100 |
{ |
|
101 |
iOwner->FepMan()->PlaySound( EAvkonSIDStandardKeyClick ); |
|
102 |
break; |
|
103 |
} |
|
104 |
case EStdKeyUpArrow: |
|
105 |
{ |
|
106 |
if ( candidatePane->IsFirstPage() ) |
|
107 |
{ |
|
108 |
UIContainer()->EditPaneWindow()->SetAutoChangeStateFlag( KManualChangeState ); |
|
109 |
iOwner->ChangeState( EMiniQwertyEdit ); |
|
110 |
} |
|
111 |
else |
|
112 |
{ |
|
113 |
candidatePane->PreviousCandidatePage(); |
|
114 |
candidatePane->SetCandidateBuffer(); |
|
115 |
candidatePane->SelectFirst(); |
|
116 |
UpdateIndicator(); |
|
117 |
} |
|
118 |
break; |
|
119 |
} |
|
120 |
case EStdKeyDownArrow: |
|
121 |
{ |
|
122 |
ret = TAknFepInputStateCandidateQwertyBaseChinesePhrase::HandleKeyL( aKey, aLength ); |
|
123 |
break; |
|
124 |
} |
|
125 |
case EStdKeyRightArrow: |
|
126 |
{ |
|
127 |
if ( candidatePane->VisibleCandidateCount()!= 1 ) |
|
128 |
{ |
|
129 |
uiContainer->EditPaneWindow()->SetCandidateRefreshFlag( ETrue ); |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
130 |
iOwner->ChangeState( ECandidate ); |
44 | 131 |
candidatePane->SelectNext(); |
132 |
} |
|
133 |
break; |
|
134 |
} |
|
135 |
case EStdKeyLeftArrow: |
|
136 |
{ |
|
137 |
if ( candidatePane->VisibleCandidateCount()!= 1 ) |
|
138 |
{ |
|
139 |
uiContainer->EditPaneWindow()->SetCandidateRefreshFlag( ETrue ); |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
140 |
iOwner->ChangeState( ECandidate ); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
141 |
TInt numbertotal = UIContainer()->CandidatePane()->VisibleCandidateCount(); |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
142 |
UIContainer()->CandidatePane()->SelectIndex( numbertotal-1 ); |
44 | 143 |
} |
144 |
break; |
|
145 |
} |
|
146 |
case EStdKeyDevice0: //select key |
|
147 |
case EStdKeyDevice3: // msk |
|
148 |
{ |
|
149 |
TPtrC text = uiContainer->CandidatePane()->CurrentPhraseCandidate(); |
|
150 |
if ( text.Length() && aLength != ELongKeyPress ) |
|
151 |
{ |
|
152 |
if ( !CommitInlineEEPL( text ) ) |
|
153 |
{ |
|
154 |
DoActionAfterCommit(); |
|
155 |
} |
|
156 |
else |
|
157 |
{ |
|
158 |
if ( CheckFirstGroupStroke() ) |
|
159 |
{ |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
160 |
iOwner->ChangeState( ECandidate ); |
44 | 161 |
} |
162 |
else |
|
163 |
{ |
|
164 |
uiContainer->EditPaneWindow()->SetAutoChangeStateFlag( EAutoChangeStateFromInput ); |
|
165 |
iOwner->ChangeState( EMiniQwertyEdit ); |
|
166 |
} |
|
167 |
} |
|
168 |
} |
|
169 |
break; |
|
170 |
} |
|
171 |
default: |
|
172 |
// chr + character |
|
173 |
if ( iOwner->FepMan()->IsFlagSet( CAknFepManager::EFlagQwertyChrKeyDepressed ) ) |
|
174 |
{ |
|
175 |
iOwner->FepMan()->TryCloseUiL(); |
|
176 |
ret = EFalse; |
|
177 |
} |
|
178 |
else if ( CAknFepFnKeyManager::EFnKeyNext == iOwner->FepMan()->FnKeyState() || CAknFepFnKeyManager::EFnKeyLock |
|
179 |
== iOwner->FepMan()->FnKeyState() || CAknFepFnKeyManager::EFnKeyDown |
|
180 |
== iOwner->FepMan()->FnKeyState() ) //fn play error tone |
|
181 |
{ |
|
182 |
iOwner->FepMan()->PlaySound( EAvkonSIDErrorTone ); |
|
183 |
} |
|
184 |
else |
|
185 |
{ |
|
186 |
ret = TAknFepInputMiniQwertyStrokePhraseBase::HandleKeyL( |
|
187 |
aKey, aLength ); |
|
188 |
} |
|
189 |
break; |
|
190 |
} |
|
191 |
return ret; |
|
192 |
} |
|
193 |
||
194 |
// --------------------------------------------------------------------------- |
|
195 |
// TAknFepInputStateEditingMiniQwertyStrokePhrase::TAknFepInputStateEditingMiniQwertyStrokePhrase |
|
196 |
// C++ default constructor |
|
197 |
// --------------------------------------------------------------------------- |
|
198 |
// |
|
199 |
TAknFepInputStateEditingMiniQwertyStrokePhrase::TAknFepInputStateEditingMiniQwertyStrokePhrase( |
|
200 |
MAknFepUIManagerStateInterface* aOwner, |
|
201 |
MAknFepUICtrlContainerChinese* aUIContainer ): |
|
202 |
TAknFepInputMiniQwertyStrokePhraseBase( aOwner, aUIContainer ) |
|
203 |
{ |
|
204 |
iState = EMiniQwertyEdit; |
|
205 |
MAknFepUICtrlContainerChinese* uiContainer = UIContainer(); |
|
206 |
RefreshUI(); |
|
207 |
uiContainer->FocusCandidatePane( EFalse ); |
|
208 |
uiContainer->CandidatePane()->ShowCandidateOrdinals( EFalse ); |
|
209 |
} |
|
210 |
// --------------------------------------------------------------------------- |
|
211 |
// TAknFepInputStateEditingMiniQwertyStrokePhrase::HandleKeyL |
|
212 |
// Handle system key press event. |
|
213 |
// --------------------------------------------------------------------------- |
|
214 |
// |
|
215 |
TBool TAknFepInputStateEditingMiniQwertyStrokePhrase::HandleKeyL( TInt aKey, |
|
216 |
TKeyPressLength aLength ) |
|
217 |
{ |
|
218 |
TBool ret = ETrue; |
|
219 |
MAknFepUICtrlContainerChinese* uiContainer = UIContainer(); |
|
220 |
MAknFepUICtrlCandidatePane* candidatePane = UIContainer()->CandidatePane(); |
|
221 |
||
222 |
//handle chr up when composition key with chr end |
|
223 |
//avoid closing UI |
|
224 |
if ( iOwner->FepMan()->GetComposChrFlag() && aKey == EStdKeyLeftFunc ) |
|
225 |
{ |
|
226 |
iOwner->FepMan()->SetComposChrFlag( EFalse ); |
|
227 |
return ETrue; |
|
228 |
} |
|
229 |
switch ( aKey ) |
|
230 |
{ |
|
231 |
case EKeyLeftShift: |
|
232 |
case EKeyRightShift: |
|
233 |
case EKeyLeftCtrl: |
|
234 |
case EKeyRightCtrl: |
|
235 |
case EKeyRightFunc://fn |
|
236 |
case EKeyLeftFunc: // fn |
|
237 |
{ |
|
238 |
if ( !uiContainer->EditPaneWindow()->GetAutoChangeStateFlag() |
|
239 |
|| uiContainer->EditPaneWindow()->PhraseArray()->Count() != 0) |
|
240 |
{ |
|
241 |
iOwner->FepMan()->PlaySound( EAvkonSIDStandardKeyClick ); |
|
242 |
} |
|
243 |
else |
|
244 |
{ |
|
245 |
iOwner->FepMan()->TryCloseUiL(); |
|
246 |
ret = EFalse; |
|
247 |
} |
|
248 |
break; |
|
249 |
} |
|
250 |
case EStdKeyLeftFunc: //chr key |
|
251 |
{ |
|
252 |
iOwner->FepMan()->TryCloseUiL(); |
|
253 |
ret =EFalse; |
|
254 |
} |
|
255 |
// inactive |
|
256 |
case EStdKeyUpArrow: |
|
257 |
{ |
|
258 |
break; |
|
259 |
} |
|
260 |
//if the canidate is empty ,inactive;else candiniate selecting state |
|
261 |
case EStdKeyDownArrow: |
|
262 |
{ |
|
263 |
if ( 0 != candidatePane->VisibleCandidateCount() ) |
|
264 |
{ |
|
265 |
uiContainer->EditPaneWindow()->SetChangeState( ETrue ); |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
266 |
iOwner->ChangeState( ECandidate ); |
44 | 267 |
} |
268 |
break; |
|
269 |
} |
|
270 |
case EStdKeyDevice1: //"cancle" key |
|
271 |
{ |
|
272 |
iOwner->FepMan()->TryCloseUiL(); |
|
273 |
break; |
|
274 |
} |
|
275 |
case EStdKeySingleQuote: |
|
276 |
case EStdKeyEnter: |
|
277 |
{ |
|
278 |
iOwner->FepMan()->PlaySound( EAvkonSIDStandardKeyClick ); |
|
279 |
break; |
|
280 |
} |
|
281 |
default: |
|
282 |
// chr + character |
|
283 |
if ( iOwner->FepMan()->IsFlagSet( CAknFepManager::EFlagQwertyChrKeyDepressed ) ) |
|
284 |
{ |
|
285 |
iOwner->FepMan()->SetComposChrFlag( ETrue ); |
|
286 |
if ( !uiContainer->EditPaneWindow()->GetAutoChangeStateFlag() |
|
287 |
|| uiContainer->EditPaneWindow()->PhraseArray()->Count() != 0) |
|
288 |
{ |
|
289 |
iOwner->FepMan()->PlaySound(EAvkonSIDStandardKeyClick); |
|
290 |
return ETrue; |
|
291 |
} |
|
292 |
else |
|
293 |
{ |
|
294 |
iOwner->FepMan()->TryCloseUiL(); |
|
295 |
return EFalse; |
|
296 |
} |
|
297 |
} |
|
298 |
else |
|
299 |
{ |
|
300 |
ret = TAknFepInputMiniQwertyStrokePhraseBase::HandleKeyL( |
|
301 |
aKey, aLength); |
|
302 |
break; |
|
303 |
} |
|
304 |
} |
|
305 |
return ret; |
|
306 |
} |
|
307 |
||
308 |
// --------------------------------------------------------------------------- |
|
309 |
// TAknFepUiInputStateCandidateMiniQwertyStrokePhrase::TAknFepUiInputStateCandidateMiniQwertyStrokePhrase |
|
310 |
// C++ default constructor |
|
311 |
// --------------------------------------------------------------------------- |
|
312 |
// |
|
313 |
TAknFepUiInputStateCandidateMiniQwertyStrokePhrase::TAknFepUiInputStateCandidateMiniQwertyStrokePhrase( |
|
314 |
MAknFepUIManagerStateInterface* aOwner, |
|
315 |
MAknFepUICtrlContainerChinese* aUIContainer ): |
|
316 |
TAknFepInputMiniQwertyStrokePhraseBase( aOwner, aUIContainer ) |
|
317 |
{ |
|
318 |
iState = ECandidate; |
|
319 |
MAknFepUICtrlContainerChinese* uiContainer = UIContainer(); |
|
320 |
uiContainer->FocusCandidatePane( ETrue ); |
|
321 |
uiContainer->CandidatePane()->ShowCandidateOrdinals( ETrue ); |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
322 |
uiContainer->CandidatePane()->SelectFirstPhrase(); |
44 | 323 |
if ( uiContainer->EditPaneWindow()->GetCandidateRefreshFlag() ) |
324 |
{ |
|
325 |
uiContainer->EditPaneWindow()->DisableCursor(); |
|
326 |
uiContainer->EditPaneWindow()->SetCandidateRefreshFlag( EFalse ); |
|
327 |
} |
|
328 |
else |
|
329 |
{ |
|
330 |
RefreshUI(); |
|
331 |
} |
|
332 |
} |
|
333 |
// --------------------------------------------------------------------------- |
|
334 |
// TAknFepUiInputStateCandidateMiniQwertyStrokePhrase::HandleKeyL |
|
335 |
// Handle system key press event. |
|
336 |
// --------------------------------------------------------------------------- |
|
337 |
// |
|
338 |
TBool TAknFepUiInputStateCandidateMiniQwertyStrokePhrase::HandleKeyL( |
|
339 |
TInt aKey, TKeyPressLength aLength ) |
|
340 |
{ |
|
341 |
MAknFepUICtrlContainerChinese* uiContainer = UIContainer(); |
|
342 |
TInt selected = uiContainer->CandidatePane()->SelectedIndex(); |
|
343 |
TInt numbertotal = uiContainer->CandidatePane()->VisibleCandidateCount(); |
|
344 |
TBool ret = ETrue; |
|
345 |
||
346 |
if ( iOwner->FepMan()->IsFlagSet( CAknFepManager::EFlagQwertyChrKeyDepressed ) |
|
347 |
|| iOwner->FepMan()->IsFlagSet( CAknFepManager::EFlagShiftKeyDepressed ) ) |
|
348 |
{ |
|
349 |
iOwner->FepMan()->PlaySound( EAvkonSIDErrorTone ); |
|
350 |
return ETrue; |
|
351 |
} |
|
352 |
||
353 |
switch ( aKey ) |
|
354 |
{ |
|
355 |
case EStdKeyBackspace: |
|
356 |
{ |
|
357 |
uiContainer->CandidatePane()->SetCandidateBuffer(); |
|
358 |
uiContainer->EditPaneWindow()->SetAutoChangeStateFlag( KManualChangeState ); |
|
359 |
uiContainer->EditPaneWindow()->SetChangeState( ETrue ); |
|
360 |
iOwner->ChangeState( EMiniQwertyEdit ); |
|
361 |
iOwner->FepMan()->UpdateCbaL( R_AKNFEP_SOFTKEYS_OK_SELECT_CANCEL ); |
|
362 |
} |
|
363 |
break; |
|
364 |
case EStdKeyLeftArrow: |
|
365 |
{ |
|
366 |
if ( selected == 0 ) |
|
367 |
{ |
|
368 |
uiContainer->CandidatePane()->SelectIndex( numbertotal-1 ); |
|
369 |
} |
|
370 |
else |
|
371 |
{ |
|
372 |
uiContainer->CandidatePane()->SelectIndex( selected - 1 ); |
|
373 |
} |
|
374 |
} |
|
375 |
break; |
|
376 |
case EStdKeyRightArrow: |
|
377 |
{ |
|
378 |
if ( selected == numbertotal-1 ) |
|
379 |
{ |
|
380 |
uiContainer->CandidatePane()->SelectIndex( 0 ); |
|
381 |
} |
|
382 |
else |
|
383 |
{ |
|
384 |
uiContainer->CandidatePane()->SelectIndex( selected + 1 ); |
|
385 |
} |
|
386 |
} |
|
387 |
break; |
|
388 |
case EStdKeyDownArrow: |
|
389 |
{ |
|
390 |
ret = TAknFepInputStateCandidateQwertyBaseChinesePhrase::HandleKeyL( aKey, aLength ); |
|
391 |
} |
|
392 |
break; |
|
393 |
case EStdKeyUpArrow: |
|
394 |
{ |
|
395 |
if ( uiContainer->CandidatePane()->IsFirstPage() ) |
|
396 |
{ |
|
397 |
uiContainer->EditPaneWindow()->SetAutoChangeStateFlag( KManualChangeState ); |
|
398 |
iOwner->ChangeState( EMiniQwertyEdit ); |
|
399 |
} |
|
400 |
else |
|
401 |
{ |
|
402 |
uiContainer->CandidatePane()->PreviousCandidatePage(); |
|
403 |
uiContainer->CandidatePane()->SetCandidateBuffer(); |
|
404 |
uiContainer->CandidatePane()->SelectFirstPhrase(); |
|
405 |
UpdateIndicator(); |
|
406 |
} |
|
407 |
} |
|
408 |
break; |
|
409 |
case EStdKeyDevice0: |
|
410 |
case EStdKeyDevice3: |
|
411 |
{ |
|
412 |
TPtrC text = uiContainer->CandidatePane()->CurrentPhraseCandidate(); |
|
413 |
if ( text.Length() && aLength != ELongKeyPress ) |
|
414 |
{ |
|
415 |
if ( !CommitInlineEEPL( text ) ) |
|
416 |
{ |
|
417 |
DoActionAfterCommit(); |
|
418 |
} |
|
419 |
else |
|
420 |
{ |
|
421 |
if ( CheckFirstGroupStroke() ) |
|
422 |
{ |
|
423 |
RefreshUI(); |
|
424 |
uiContainer->CandidatePane()->SelectFirstPhrase(); |
|
425 |
} |
|
426 |
else |
|
427 |
{ |
|
428 |
uiContainer->EditPaneWindow()->SetAutoChangeStateFlag( EAutoChangeStateFromCandidate ); |
|
429 |
iOwner->ChangeState( EMiniQwertyEdit ); |
|
430 |
} |
|
431 |
} |
|
432 |
} |
|
433 |
} |
|
434 |
break; |
|
435 |
case EStdKeyEnter: |
|
436 |
case EKeyLeftCtrl: |
|
437 |
case EKeyRightCtrl: |
|
438 |
case EKeyLeftShift: |
|
439 |
case EStdKeySpace: |
|
440 |
{ |
|
441 |
iOwner->FepMan()->PlaySound( EAvkonSIDErrorTone ); |
|
442 |
} |
|
443 |
break; |
|
444 |
// case EKeyRightShift: // need to check later |
|
445 |
// { |
|
446 |
// return ret; |
|
447 |
// } |
|
448 |
// break; |
|
449 |
default: |
|
450 |
return TAknFepInputMiniQwertyStrokePhraseBase::HandleKeyL( aKey, |
|
451 |
aLength ); |
|
452 |
} |
|
453 |
return ret; |
|
454 |
} |
|
455 |
// --------------------------------------------------------------------------- |
|
456 |
// TAknFepInputStateEditingMiniQwertyStrokePhrase::HandleCommandL |
|
457 |
// Handling Command |
|
458 |
// --------------------------------------------------------------------------- |
|
459 |
// |
|
460 |
void TAknFepInputStateEditingMiniQwertyStrokePhrase::HandleCommandL( |
|
461 |
TInt aCommandId ) |
|
462 |
{ |
|
463 |
MAknFepUICtrlContainerChinese* uiContainer = UIContainer( ); |
|
464 |
switch ( aCommandId ) |
|
465 |
{ |
|
466 |
// Handle the event frome command. |
|
467 |
case EAknSoftkeySelect: |
|
468 |
if ( !uiContainer->EditPaneWindow()->GetAutoChangeStateFlag( ) || uiContainer->EditPaneWindow()->PhraseArray()->Count( ) != 0 ) |
|
469 |
{ |
|
470 |
iOwner->FepMan()->PlaySound( EAvkonSIDStandardKeyClick ); |
|
471 |
} |
|
472 |
else |
|
473 |
{ |
|
474 |
iOwner->FepMan()->TryCloseUiL( ); |
|
475 |
} |
|
476 |
break; |
|
477 |
default: |
|
478 |
TAknFepInputStateChineseBase::HandleCommandL( aCommandId ); |
|
479 |
break; |
|
480 |
} |
|
481 |
} |
|
482 |
||
483 |
||
484 |
// --------------------------------------------------------------------------- |
|
485 |
// TAknFepInputStateEntryMiniQwertyStrokePhrase::HandleCommandL |
|
486 |
// Handling Command |
|
487 |
// --------------------------------------------------------------------------- |
|
488 |
// |
|
489 |
void TAknFepInputStateEntryMiniQwertyStrokePhrase::HandleCommandL( |
|
490 |
TInt aCommandId ) |
|
491 |
{ |
|
492 |
MAknFepUICtrlContainerChinese* uiContainer = UIContainer(); |
|
493 |
TPtrC text = uiContainer->CandidatePane()->CurrentPhraseCandidate(); |
|
494 |
switch ( aCommandId ) |
|
495 |
{ |
|
496 |
// Handle the event frome command. |
|
497 |
case EAknSoftkeySelect: |
|
498 |
if ( text.Length() ) |
|
499 |
{ |
|
500 |
if ( !CommitInlineEEPL( text ) ) |
|
501 |
{ |
|
502 |
DoActionAfterCommit(); |
|
503 |
} |
|
504 |
else |
|
505 |
{ |
|
506 |
if ( CheckFirstGroupStroke() ) |
|
507 |
{ |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
508 |
iOwner->ChangeState( ECandidate ); |
44 | 509 |
} |
510 |
else |
|
511 |
{ |
|
512 |
uiContainer->EditPaneWindow()->SetAutoChangeStateFlag( |
|
513 |
EAutoChangeStateFromInput ); |
|
514 |
iOwner->ChangeState( EMiniQwertyEdit ); |
|
515 |
} |
|
516 |
} |
|
517 |
} |
|
518 |
break; |
|
519 |
default: |
|
520 |
TAknFepInputStateChineseBase::HandleCommandL( aCommandId ); |
|
521 |
break; |
|
522 |
} |
|
523 |
} |
|
524 |
||
525 |
// --------------------------------------------------------------------------- |
|
526 |
// TAknFepUiInputStateCandidateMiniQwertyStrokePhrase::HandleCommandL |
|
527 |
// Handling Command |
|
528 |
// --------------------------------------------------------------------------- |
|
529 |
// |
|
530 |
void TAknFepUiInputStateCandidateMiniQwertyStrokePhrase::HandleCommandL( |
|
531 |
TInt aCommandId ) |
|
532 |
{ |
|
533 |
MAknFepUICtrlContainerChinese* uiContainer = UIContainer(); |
|
534 |
TPtrC text = uiContainer->CandidatePane()->CurrentPhraseCandidate(); |
|
535 |
switch ( aCommandId ) |
|
536 |
{ |
|
537 |
// Handle the event frome command. |
|
538 |
case EAknSoftkeySelect: |
|
539 |
if ( text.Length() ) |
|
540 |
{ |
|
541 |
if ( !CommitInlineEEPL( text ) ) |
|
542 |
{ |
|
543 |
DoActionAfterCommit(); |
|
544 |
} |
|
545 |
else |
|
546 |
{ |
|
547 |
if ( CheckFirstGroupStroke() ) |
|
548 |
{ |
|
549 |
RefreshUI(); |
|
550 |
uiContainer->CandidatePane()->SelectFirstPhrase(); |
|
551 |
} |
|
552 |
else |
|
553 |
{ |
|
554 |
uiContainer->EditPaneWindow()->SetAutoChangeStateFlag( |
|
555 |
EAutoChangeStateFromCandidate ); |
|
556 |
iOwner->ChangeState( EMiniQwertyEdit ); |
|
557 |
} |
|
558 |
} |
|
559 |
} |
|
560 |
break; |
|
561 |
default: |
|
562 |
TAknFepInputStateChineseBase::HandleCommandL( aCommandId ); |
|
563 |
break; |
|
564 |
} |
|
565 |
} |