|
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 TAknFepInputStateInitialIndicPredictive Method. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 #include "AknFepUiInputStateInitialIndicPredictive.h" |
|
30 #include "AknFepUIManagerStateInterface.h" //MAknFepUIManagerStateInterface |
|
31 #include "AknFepManagerUIInterface.h" //MAknFepManagerUIInterface |
|
32 #include "AknFepManager.h" |
|
33 #include "AknFepCaseManager.h" //CAknFepCaseManager |
|
34 |
|
35 #include <PtiEngine.h> |
|
36 #include <PtiDefs.h> |
|
37 |
|
38 // ----------------------------------------------------------------------------- |
|
39 // TAknFepInputStateInitialIndicPredictive::TAknFepInputStateInitialIndicPredictive |
|
40 |
|
41 // C++ default constructor can NOT contain any code, that |
|
42 // might leave or if it is absolutely necessary then MUST be trapped. |
|
43 // ----------------------------------------------------------------------------- |
|
44 |
|
45 TAknFepInputStateInitialIndicPredictive:: |
|
46 TAknFepInputStateInitialIndicPredictive( MAknFepUIManagerStateInterface* aOwner, |
|
47 TLanguage aLanguage ) |
|
48 :TAknFepInputStateInitialMultitapBase( aOwner ) |
|
49 { |
|
50 CPtiEngine* ptiengine = iOwner->PtiEngine(); |
|
51 ptiengine->ClearCurrentWord(); |
|
52 TRAP_IGNORE( ptiengine->ActivateLanguageL( aLanguage ) ) |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // TAknFepInputStateInitialIndicPredictive::HandleKeyL |
|
57 |
|
58 // Handles the logic of Intial state Predictive Indic input. |
|
59 // ----------------------------------------------------------------------------- |
|
60 |
|
61 TBool TAknFepInputStateInitialIndicPredictive::HandleKeyL( TInt aKey, TKeyPressLength aLength ) |
|
62 { |
|
63 MAknFepManagerUIInterface* fepMan = iOwner->FepMan(); |
|
64 TBool ret = ETrue; |
|
65 |
|
66 if ( aKey == EPtiKey0 ) |
|
67 { |
|
68 TAknFepInputStateInitialMultitapBase::HandleKeyL( aKey, aLength ); |
|
69 } |
|
70 else if ( aKey == EPtiKeyStar ) |
|
71 { |
|
72 if (aLength == EShortKeyPress) |
|
73 { |
|
74 if (fepMan->IsFlagSet(CAknFepManager::EFlagLineFeedCharacter) && |
|
75 fepMan->IsFlagSet(CAknFepManager::EFlagInsideMultitapInlineEditingTransaction)) |
|
76 { |
|
77 // User is interrupting multitap timer with star key, but there |
|
78 // is line feed event waiting. Make sure that it is handled first. |
|
79 fepMan->CommitInlineEditL(); |
|
80 } |
|
81 |
|
82 if (!fepMan->EditSubmenuInUse()) |
|
83 { |
|
84 if (fepMan->IsAbleToLaunchSCT()) |
|
85 { |
|
86 fepMan->LaunchSpecialCharacterTableL(); |
|
87 return ( ETrue ); |
|
88 } |
|
89 } |
|
90 else |
|
91 { |
|
92 fepMan->ClearCcpuFlag(CAknFepManager::ECcpuStateIgnoreStarUp); |
|
93 } |
|
94 } |
|
95 else |
|
96 { |
|
97 if (fepMan->EditSubmenuInUse() && fepMan->IsAbleToLaunchSCT()) |
|
98 { |
|
99 fepMan->LaunchSpecialCharacterTableL(); |
|
100 } |
|
101 } |
|
102 } |
|
103 else |
|
104 { |
|
105 if ( fepMan->IsFlagSet( CAknFepManager::EFlagSuppressInputStateChange ) ) |
|
106 { |
|
107 // Long keypress of numeric keypress, we want to simply return EFalse |
|
108 // to enter a number into the editor, rather than move back to |
|
109 // entry state, so just clear the flag |
|
110 fepMan->ClearFlag( CAknFepManager::EFlagSuppressInputStateChange ); |
|
111 } |
|
112 else |
|
113 { |
|
114 fepMan->TryCloseUiL(); //expires the multitap timer |
|
115 iOwner->ChangeState( EEntry ); |
|
116 fepMan->SendUIActivatedNotification(); |
|
117 } |
|
118 ret = EFalse; |
|
119 } |
|
120 return ret; |
|
121 } |
|
122 |
|
123 // End of File |