|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Implementation of the vkb ui state machine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // user includes |
|
20 #include "peninputvkbuistate.h" |
|
21 #include "peninputvkbevent.h" |
|
22 |
|
23 |
|
24 // ======== MEMBER FUNCTIONS ======== |
|
25 |
|
26 // Implementation of Class CAknFepVkbUiState |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CAknFepVkbUiState::CAknFepVkbUiState |
|
30 // (other items were commented in a header). |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 CAknFepVkbUiState::CAknFepVkbUiState(MAknFepVkbUiStateMgr* aUiStateMgr, |
|
34 MAknFepVkbLayoutContext* aContext) |
|
35 :iUiStateMgr(aUiStateMgr),iContext(aContext) |
|
36 { |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CAknFepVkbUiState::ConstructL |
|
41 // (other items were commented in a header). |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 void CAknFepVkbUiState::ConstructL() |
|
45 { |
|
46 } |
|
47 |
|
48 // ----------------------------------------------------------------------------- |
|
49 // CAknFepVkbUiState::NewL |
|
50 // (other items were commented in a header). |
|
51 // ----------------------------------------------------------------------------- |
|
52 // |
|
53 CAknFepVkbUiState* CAknFepVkbUiState::NewL(MAknFepVkbUiStateMgr* aUiStateMgr, |
|
54 MAknFepVkbLayoutContext* aContext) |
|
55 { |
|
56 CAknFepVkbUiState* self = new ( ELeave ) CAknFepVkbUiState(aUiStateMgr,aContext); |
|
57 CleanupStack::PushL(self); |
|
58 self->ConstructL(); |
|
59 CleanupStack::Pop(); |
|
60 return self; |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // CAknFepVkbUiState::~CAknFepVkbUiState |
|
65 // (other items were commented in a header). |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 CAknFepVkbUiState::~CAknFepVkbUiState() |
|
69 { |
|
70 } |
|
71 |
|
72 // ----------------------------------------------------------------------------- |
|
73 // CAknFepVkbUiState::HandleKeyEventL |
|
74 // (other items were commented in a header). |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 TBool CAknFepVkbUiState::HandleKeyEventL(const TRawEvent& /*aData*/) |
|
78 { |
|
79 return EFalse; |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CAknFepVkbUiState::HandleControlEvent |
|
84 // (other items were commented in a header). |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 TBool CAknFepVkbUiState::HandleControlEvent(TInt aEventType, const TDesC& aEventData) |
|
88 { |
|
89 if (aEventType == EEventVirtualKeyUp) |
|
90 { |
|
91 return HandleVkbEvent(aEventType, aEventData); |
|
92 } |
|
93 else if (aEventType == EPeninputLayoutEventBack) |
|
94 { |
|
95 return HandleBackEvent(aEventType, aEventData); |
|
96 } |
|
97 else if (aEventType == EVkbEventLeftArrow || aEventType == EVkbEventRightArrow) |
|
98 { |
|
99 return HandleArrowKeyEvent(aEventType, aEventData); |
|
100 } |
|
101 else if ((aEventType == EVkbEventKeyEnter) || |
|
102 (aEventType == EVkbEventKeySpace)) |
|
103 { |
|
104 return HandleEnterSpaceEvent(aEventType, aEventData); |
|
105 } |
|
106 else |
|
107 { |
|
108 return EFalse; |
|
109 } |
|
110 } |
|
111 |
|
112 // ----------------------------------------------------------------------------- |
|
113 // CAknFepVkbUiState::HandleArrowKeyEvent |
|
114 // (other items were commented in a header). |
|
115 // ----------------------------------------------------------------------------- |
|
116 // |
|
117 TBool CAknFepVkbUiState::HandleArrowKeyEvent(TInt /*aEventType*/, |
|
118 const TDesC& /*aEventData*/) |
|
119 { |
|
120 return ETrue; |
|
121 } |
|
122 |
|
123 // ----------------------------------------------------------------------------- |
|
124 // CAknFepVkbUiState::HandleVkbEvent |
|
125 // (other items were commented in a header). |
|
126 // ----------------------------------------------------------------------------- |
|
127 // |
|
128 TBool CAknFepVkbUiState::HandleVkbEvent(TInt /*aEventType*/, |
|
129 const TDesC& /*aEventData*/) |
|
130 { |
|
131 return ETrue; |
|
132 } |
|
133 |
|
134 // ----------------------------------------------------------------------------- |
|
135 // CAknFepVkbUiState::HandleBackEvent |
|
136 // (other items were commented in a header). |
|
137 // ----------------------------------------------------------------------------- |
|
138 // |
|
139 TBool CAknFepVkbUiState::HandleBackEvent(TInt /*aEventType*/, |
|
140 const TDesC& /*aEventData*/) |
|
141 { |
|
142 return ETrue; |
|
143 } |
|
144 |
|
145 // ----------------------------------------------------------------------------- |
|
146 // CAknFepVkbUiState::HandleEnterSpaceTabEvent |
|
147 // (other items were commented in a header). |
|
148 // ----------------------------------------------------------------------------- |
|
149 // |
|
150 TBool CAknFepVkbUiState::HandleEnterSpaceEvent(TInt /*aEventType*/, |
|
151 const TDesC& /*aEventData*/) |
|
152 { |
|
153 return ETrue; |
|
154 } |
|
155 |
|
156 // ----------------------------------------------------------------------------- |
|
157 // CAknFepVkbUiState::IsFilterUnicode |
|
158 // (other items were commented in a header). |
|
159 // ----------------------------------------------------------------------------- |
|
160 // |
|
161 TBool CAknFepVkbUiState::IsFilterUnicode(TUint16 aUnicode) |
|
162 { |
|
163 for (TInt i=0; i < KLengthSymbolNeedToFilter; i++) |
|
164 { |
|
165 if ( aUnicode == KSymbolsNeedToFilter[i] ) |
|
166 { |
|
167 return ETrue; |
|
168 } |
|
169 } |
|
170 |
|
171 return EFalse; |
|
172 } |
|
173 |
|
174 // ----------------------------------------------------------------------------- |
|
175 // CAknFepVkbUiState::SendKey |
|
176 // (other items were commented in a header). |
|
177 // ----------------------------------------------------------------------------- |
|
178 // |
|
179 TBool CAknFepVkbUiState::SendKey(const TDesC& aEventData) |
|
180 { |
|
181 TPtrC ptr = aEventData.Left(1); |
|
182 iContext->Sendkey(ESignalKeyEvent,ptr); |
|
183 return ETrue; |
|
184 } |
|
185 |
|
186 // End Of File |