|
1 /* |
|
2 * Copyright (c) 2002 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 TAknFepInputStateInitialWesternPredictive methods. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 #include "AknFepUiInputStateInitialWesternPredictive.h" |
|
31 #include "AknFepUIManagerStateInterface.h" //MAknFepUIManagerStateInterface |
|
32 #include "AknFepManagerUIInterface.h" //MAknFepManagerUIInterface |
|
33 #include "AknFepManager.h" |
|
34 #include "AknFepCaseManager.h" //CAknFepCaseManager |
|
35 #include "AknFepUiIndicInputManager.h" |
|
36 |
|
37 #include <PtiEngine.h> |
|
38 #include <PtiDefs.h> |
|
39 |
|
40 TAknFepInputStateInitialWesternPredictive:: |
|
41 TAknFepInputStateInitialWesternPredictive(MAknFepUIManagerStateInterface* aOwner) |
|
42 :TAknFepInputStateInitialMultitapBase(aOwner) |
|
43 { |
|
44 } |
|
45 |
|
46 TBool TAknFepInputStateInitialWesternPredictive::HandleKeyL(TInt aKey, TKeyPressLength aLength) |
|
47 { |
|
48 MAknFepManagerUIInterface* fepMan = iOwner->FepMan(); |
|
49 TBool ret = ETrue; |
|
50 |
|
51 if (aKey == EPtiKey0) |
|
52 { |
|
53 TAknFepInputStateInitialMultitapBase::HandleKeyL(aKey, aLength); |
|
54 } |
|
55 else if (aKey == EPtiKeyStar) |
|
56 { |
|
57 if (aLength == EShortKeyPress) |
|
58 { |
|
59 if (fepMan->IsFlagSet(CAknFepManager::EFlagLineFeedCharacter) && |
|
60 fepMan->IsFlagSet(CAknFepManager::EFlagInsideMultitapInlineEditingTransaction)) |
|
61 { |
|
62 // User is interrupting multitap timer with star key, but there |
|
63 // is line feed event waiting. Make sure that it is handled first. |
|
64 fepMan->CommitInlineEditL(); |
|
65 } |
|
66 |
|
67 if (!fepMan->EditSubmenuInUse()) |
|
68 { |
|
69 if (fepMan->IsAbleToLaunchSCT()) |
|
70 { |
|
71 fepMan->LaunchSpecialCharacterTableL(); |
|
72 } |
|
73 } |
|
74 else |
|
75 { |
|
76 fepMan->ClearCcpuFlag(CAknFepManager::ECcpuStateIgnoreStarUp); |
|
77 } |
|
78 } |
|
79 else |
|
80 { |
|
81 if (fepMan->EditSubmenuInUse() && fepMan->IsAbleToLaunchSCT()) |
|
82 { |
|
83 fepMan->LaunchSpecialCharacterTableL(); |
|
84 } |
|
85 } |
|
86 } |
|
87 else |
|
88 { |
|
89 if (fepMan->IsFlagSet(CAknFepManager::EFlagSuppressInputStateChange)) |
|
90 { |
|
91 // Long keypress of numeric keypress, we want to simply return EFalse |
|
92 // to enter a number into the editor, rather than move back to |
|
93 // entry state, so just clear the flag |
|
94 fepMan->ClearFlag(CAknFepManager::EFlagSuppressInputStateChange); |
|
95 |
|
96 // Asyncronous case update after the number has been entered to the editor. |
|
97 fepMan->SimulateKeyEventL(EKeyF19); |
|
98 } |
|
99 else |
|
100 { |
|
101 fepMan->TryCloseUiL(); //expires the multitap timer |
|
102 iOwner->ChangeState(EEntry); |
|
103 fepMan->SendUIActivatedNotification(); |
|
104 } |
|
105 ret = EFalse; |
|
106 } |
|
107 return ret; |
|
108 } |
|
109 |
|
110 // End of file |