author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:34:44 +0300 | |
branch | RCL_3 |
changeset 50 | 5a1685599b76 |
parent 44 | ecbabf52600f |
child 56 | 8152b1f1763a |
permissions | -rw-r--r-- |
44 | 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: split qwerty layout |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// System includes |
|
20 |
#include <aknfeppeninputenums.h> // Command from fep or IME to plugin |
|
21 |
#include <AknFepGlobalEnums.h> // Define EPluginInputModeHwr |
|
22 |
#include <peninputcmd.h> // Use global signal |
|
23 |
#include <peninputlayoutchoicelist.h> |
|
24 |
#include <peninputlayoutbutton.h> |
|
25 |
#include <peninputdragbutton.h> |
|
26 |
#include <peninputcommonlayoutglobalenum.h> |
|
27 |
#include <coemain.h> |
|
28 |
#include <peninputlayoutbubblectrl.h> |
|
29 |
#include <peninputlayoutmultilineicf.h> |
|
30 |
#include <peninputscrollablelist.h> |
|
31 |
#include <s32mem.h> |
|
32 |
||
33 |
#include <peninputrangebar.h> |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
34 |
#include <peninputpopupbubble.h> |
44 | 35 |
|
36 |
// User includes |
|
37 |
#include "peninputsplitqwerty.hrh" |
|
38 |
#include "peninputuistatemgrinterface.h" |
|
39 |
#include "peninputsplitqwertylayout.h" |
|
40 |
#include "peninputsplitqwertywindow.h" |
|
41 |
#include "peninputsplitqwertydatamgr.h" |
|
42 |
#include "peninputsplitqwertyuistatestandby.h" |
|
43 |
#include "peninputsplitqwertyuistatepopup.h" |
|
44 |
#include "peninputdataconverter.h" |
|
45 |
||
46 |
// ======== MEMBER FUNCTIONS ======== |
|
47 |
const TInt KNumberOfDottedChar = 16; |
|
48 |
||
49 |
const TUint16 thaiUnicodeOri[KNumberOfDottedChar] = |
|
50 |
{ |
|
51 |
0x0E31,0x0E33,0x0E34,0x0E35,0x0E36,0x0E37,0x0E38,0x0E39, |
|
52 |
0x0E3A,0x0E47,0x0E48,0x0E49,0x0E4A,0x0E4B,0x0E4C,0x0E4D |
|
53 |
}; |
|
54 |
||
55 |
const TUint16 thaiUnicodeNew[KNumberOfDottedChar] = |
|
56 |
{ |
|
57 |
0xF731,0xF733,0xF734,0xF735,0xF736,0xF737,0xF738,0xF739, |
|
58 |
0xF73A,0xF747,0xF748,0xF749,0xF74A,0xF74B,0xF74C,0xF74D |
|
59 |
}; |
|
60 |
||
61 |
// --------------------------------------------------------------------------- |
|
62 |
// Symbian constructor |
|
63 |
// --------------------------------------------------------------------------- |
|
64 |
// |
|
65 |
CPeninputSplitQwertyLayoutImp* CPeninputSplitQwertyLayoutImp::NewL( TAny* /*aInitParams*/ ) |
|
66 |
{ |
|
67 |
CPeninputSplitQwertyLayoutImp* |
|
68 |
self = new ( ELeave ) CPeninputSplitQwertyLayoutImp(); |
|
69 |
||
70 |
CleanupStack::PushL( self ); |
|
71 |
self->ConstructL(); |
|
72 |
CleanupStack::Pop( self ); |
|
73 |
return self; |
|
74 |
} |
|
75 |
||
76 |
// --------------------------------------------------------------------------- |
|
77 |
// C++ destructor |
|
78 |
// --------------------------------------------------------------------------- |
|
79 |
// |
|
80 |
CPeninputSplitQwertyLayoutImp::~CPeninputSplitQwertyLayoutImp() |
|
81 |
{ |
|
82 |
} |
|
83 |
||
84 |
// --------------------------------------------------------------------------- |
|
85 |
// Create fep ui layout |
|
86 |
// --------------------------------------------------------------------------- |
|
87 |
// |
|
88 |
CFepUiLayout* CPeninputSplitQwertyLayoutImp::CreateFepUiLayoutL( |
|
89 |
MLayoutOwner* aLayoutOwner, |
|
90 |
const TAny* aData ) |
|
91 |
{ |
|
92 |
CPeninputSplitQwertyLayout* |
|
93 |
uiLayout = CPeninputSplitQwertyLayout::NewL( aLayoutOwner, aData ); |
|
94 |
||
95 |
return uiLayout; |
|
96 |
} |
|
97 |
||
98 |
// --------------------------------------------------------------------------- |
|
99 |
// C++ constructor |
|
100 |
// --------------------------------------------------------------------------- |
|
101 |
// |
|
102 |
CPeninputSplitQwertyLayoutImp::CPeninputSplitQwertyLayoutImp() |
|
103 |
{ |
|
104 |
} |
|
105 |
||
106 |
// --------------------------------------------------------------------------- |
|
107 |
// Symbian constructor |
|
108 |
// --------------------------------------------------------------------------- |
|
109 |
// |
|
110 |
void CPeninputSplitQwertyLayoutImp::ConstructL() |
|
111 |
{ |
|
112 |
} |
|
113 |
||
114 |
||
115 |
// --------------------------------------------------------------------------- |
|
116 |
// Symbian constructor |
|
117 |
// --------------------------------------------------------------------------- |
|
118 |
// |
|
119 |
CPeninputSplitQwertyLayout* CPeninputSplitQwertyLayout::NewL( |
|
120 |
MLayoutOwner* aLayoutOwner, const TAny* aInitData ) |
|
121 |
{ |
|
122 |
CPeninputSplitQwertyLayout* self = |
|
123 |
new (ELeave) CPeninputSplitQwertyLayout( aLayoutOwner ); |
|
124 |
||
125 |
CleanupStack::PushL( self ); |
|
126 |
self->ConstructL( aInitData ); |
|
127 |
CleanupStack::Pop( self ); |
|
128 |
||
129 |
return self; |
|
130 |
} |
|
131 |
||
132 |
// --------------------------------------------------------------------------- |
|
133 |
// C++ destructor |
|
134 |
// --------------------------------------------------------------------------- |
|
135 |
// |
|
136 |
CPeninputSplitQwertyLayout::~CPeninputSplitQwertyLayout() |
|
137 |
{ |
|
138 |
} |
|
139 |
||
140 |
// --------------------------------------------------------------------------- |
|
141 |
// Handle layout command event |
|
142 |
// --------------------------------------------------------------------------- |
|
143 |
// |
|
144 |
TInt CPeninputSplitQwertyLayout::HandleCommand( TInt aCmd, TUint8* aData ) |
|
145 |
{ |
|
146 |
CPeninputCommonLayoutExt::HandleCommand( aCmd, aData ); |
|
147 |
CPeninputSplitQwertyWindow* |
|
148 |
vkbWindow = static_cast<CPeninputSplitQwertyWindow*>(iLayoutWindow); |
|
149 |
||
150 |
switch ( aCmd ) |
|
151 |
{ |
|
152 |
case ECmdPenInputWindowOpen: |
|
153 |
{ |
|
154 |
UiStateMgr()->SetCurrentUiState( EPeninputVkbUiStateStandby ); |
|
155 |
} |
|
156 |
break; |
|
157 |
case ECmdPenInputWindowClose: |
|
158 |
{ |
|
159 |
vkbWindow->UnLatchDeadKey(); |
|
160 |
UiStateMgr()->SetCurrentUiState( EPeninputVkbUiStateNone ); |
|
161 |
} |
|
162 |
break; |
|
163 |
case ECmdPenInputLanguage: |
|
164 |
{ |
|
165 |
vkbWindow->SetSwitchlistLanguage( *aData ); |
|
166 |
vkbWindow->SetDeadKey(); |
|
167 |
TRAP_IGNORE( |
|
168 |
vkbWindow->ConstructAccentListL( *aData ); |
|
169 |
vkbWindow->ConstructRangeLabelListL( *aData ) |
|
170 |
); |
|
171 |
} |
|
172 |
break; |
|
173 |
case ECmdPenInputRange: |
|
174 |
{ |
|
175 |
TRAP_IGNORE( vkbWindow->UpdateRangeCtrlsL() ); |
|
176 |
} |
|
177 |
break; |
|
178 |
case ECmdPenInputIsSecretText: |
|
179 |
{ |
|
180 |
vkbWindow->SetSwitchlistSecretFlag( *aData ); |
|
181 |
} |
|
182 |
break; |
|
183 |
case ECmdPenInputDimArrowKeys: |
|
184 |
{ |
|
185 |
TBool IsDimArrowKeys = *aData; |
|
186 |
vkbWindow->DimArrowKeys( IsDimArrowKeys ); |
|
187 |
} |
|
188 |
break; |
|
189 |
case ECmdPenInputSetPromptText: |
|
190 |
break; |
|
191 |
case ECmdPenInputCharacterPreview: |
|
192 |
{ |
|
193 |
vkbWindow->ShowBubble( *aData ); |
|
194 |
} |
|
195 |
break; |
|
196 |
case ECmdPenInputInEditWordQueryDlg: |
|
197 |
{ |
|
198 |
iInEditWordQueryDlg = *aData; |
|
199 |
} |
|
200 |
break; |
|
201 |
case ECmdPeninputITIStatus: |
|
202 |
{ |
|
203 |
// Set the flag to indicate if FSQ with ITI feature is opened |
|
204 |
iITIEnabled = CPeninputDataConverter::AnyToInt( aData ); |
|
205 |
} |
|
206 |
break; |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
207 |
case ECmdPenInputFingerMatchIndicator: |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
208 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
209 |
if ( iLayoutType == EPluginInputModeFSQ ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
210 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
211 |
TRAP_IGNORE( vkbWindow->UpdateSplitIndiBubbleL( aData )); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
212 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
213 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
214 |
break; |
44 | 215 |
default: |
216 |
{ |
|
217 |
} |
|
218 |
break; |
|
219 |
} |
|
220 |
||
221 |
return KErrNone; |
|
222 |
} |
|
223 |
||
224 |
// --------------------------------------------------------------------------- |
|
225 |
// Handle control event |
|
226 |
// --------------------------------------------------------------------------- |
|
227 |
// |
|
228 |
void CPeninputSplitQwertyLayout::HandleControlEvent( TInt aEventType, |
|
229 |
CFepUiBaseCtrl* aCtrl, |
|
230 |
const TDesC& aEventData ) |
|
231 |
{ |
|
232 |
switch ( aEventType ) |
|
233 |
{ |
|
234 |
case EEventVirtualKeyUp: |
|
235 |
{ |
|
236 |
TRAP_IGNORE( HandleVirtualKeyUpL( aEventType, aCtrl, aEventData ) ); |
|
237 |
} |
|
238 |
break; |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
239 |
case EEventVirtualKeyDown: |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
240 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
241 |
HandleVirtualKeyDown(); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
242 |
CPeninputCommonLayoutExt::HandleControlEvent( aEventType, |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
243 |
aCtrl, aEventData ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
244 |
break; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
245 |
} |
44 | 246 |
default: |
247 |
{ |
|
248 |
CPeninputCommonLayoutExt::HandleControlEvent( aEventType, |
|
249 |
aCtrl, aEventData ); |
|
250 |
} |
|
251 |
break; |
|
252 |
} |
|
253 |
} |
|
254 |
||
255 |
// --------------------------------------------------------------------------- |
|
256 |
// Handle editor text coming |
|
257 |
// --------------------------------------------------------------------------- |
|
258 |
// |
|
259 |
TInt CPeninputSplitQwertyLayout::OnAppEditorTextComing( |
|
260 |
const TFepInputContextFieldData& aData ) |
|
261 |
{ |
|
262 |
return CPeninputCommonLayoutExt::OnAppEditorTextComing( aData ); |
|
263 |
} |
|
264 |
||
265 |
// --------------------------------------------------------------------------- |
|
266 |
// Inform layout the size changing event |
|
267 |
// --------------------------------------------------------------------------- |
|
268 |
// |
|
269 |
TInt CPeninputSplitQwertyLayout::SizeChanged( const TAny* aData ) |
|
270 |
{ |
|
271 |
CPeninputSplitQwertyWindow* |
|
272 |
win = static_cast<CPeninputSplitQwertyWindow*>( iLayoutWindow ); |
|
273 |
||
274 |
if ( win ) |
|
275 |
{ |
|
276 |
win->UpdateLafData(); |
|
277 |
||
278 |
win->UpdateLayoutPosAndSize(); |
|
279 |
} |
|
280 |
||
281 |
return CPeninputCommonLayoutExt::SizeChanged( aData ); |
|
282 |
} |
|
283 |
||
284 |
// --------------------------------------------------------------------------- |
|
285 |
// Inform UI that application infomation changed |
|
286 |
// --------------------------------------------------------------------------- |
|
287 |
// |
|
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
288 |
void CPeninputSplitQwertyLayout::HandleAppInfoChange( const TDesC& aInfo, |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
289 |
TPeninputAppInfo aType ) |
44 | 290 |
{ |
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
291 |
if ( LayoutWindow() ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
292 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
293 |
CPopupBubbleCtrl* splitIndibubble = static_cast<CPopupBubbleCtrl*> |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
294 |
(LayoutWindow()->Control(EPeninputWindowCtrlIdSplitIndiBubble)) ; |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
295 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
296 |
if ( splitIndibubble && ( aType == EAppIndicatorMsg ) && (iLayoutType == EPluginInputModeFSQ) ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
297 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
298 |
CPeninputSplitQwertyWindow* window = static_cast<CPeninputSplitQwertyWindow*>(iLayoutWindow); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
299 |
if ( aInfo.Length() > 0 && !iInEditWordQueryDlg) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
300 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
301 |
TRAP_IGNORE(splitIndibubble->SetTextL(aInfo)); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
302 |
window->SetSplitIndiBubbleSizeWithText(); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
303 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
304 |
else |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
305 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
306 |
TRAP_IGNORE(splitIndibubble->SetTextL(KNullDesC)); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
307 |
window->SetSplitIndiBubbleSizeWithoutText(); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
308 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
309 |
splitIndibubble->Draw(); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
310 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
311 |
} |
44 | 312 |
} |
313 |
||
314 |
// --------------------------------------------------------------------------- |
|
315 |
// Called by owner when the layout is going to be active |
|
316 |
// --------------------------------------------------------------------------- |
|
317 |
// |
|
318 |
void CPeninputSplitQwertyLayout::OnActivate() |
|
319 |
{ |
|
320 |
CPeninputCommonLayoutExt::OnActivate(); |
|
321 |
||
322 |
CPeninputSplitQwertyWindow* |
|
323 |
win = static_cast<CPeninputSplitQwertyWindow*>( iLayoutWindow ); |
|
324 |
||
325 |
if( win ) |
|
326 |
{ |
|
327 |
win->UpdateLayoutPosAndSize(); |
|
328 |
} |
|
329 |
} |
|
330 |
||
331 |
// --------------------------------------------------------------------------- |
|
332 |
// Tell whether this layout require transparency. |
|
333 |
// --------------------------------------------------------------------------- |
|
334 |
// |
|
335 |
TBool CPeninputSplitQwertyLayout::SemiTransparencyRequired() |
|
336 |
{ |
|
337 |
return ETrue; |
|
338 |
} |
|
339 |
||
340 |
// --------------------------------------------------------------------------- |
|
341 |
// C++ constructor |
|
342 |
// --------------------------------------------------------------------------- |
|
343 |
// |
|
344 |
CPeninputSplitQwertyLayout::CPeninputSplitQwertyLayout( MLayoutOwner* aLayoutOwner ) |
|
345 |
: CPeninputCommonLayoutExt( aLayoutOwner ) |
|
346 |
, iLayoutType( EPluginInputModeFSQ ) |
|
347 |
{ |
|
348 |
iInEditWordQueryDlg = EFalse; |
|
349 |
} |
|
350 |
||
351 |
// --------------------------------------------------------------------------- |
|
352 |
// Symbian constructor |
|
353 |
// --------------------------------------------------------------------------- |
|
354 |
// |
|
355 |
void CPeninputSplitQwertyLayout::ConstructL( const TAny* aInitData ) |
|
356 |
{ |
|
357 |
// must set layout type first |
|
358 |
iLayoutType = EPluginInputModeFSQ; |
|
359 |
||
360 |
CPeninputCommonLayoutExt::ConstructL( aInitData ); |
|
361 |
||
362 |
CPeninputUiStateBase* state = NULL; |
|
363 |
CPeninputUiStateBase* initialState = NULL; |
|
364 |
||
365 |
//init state |
|
366 |
state = CPeninputUiStateBase::NewL( UiStateMgr(), this ); |
|
367 |
UiStateMgr()->AddUiState( state, EPeninputVkbUiStateNone ); |
|
368 |
initialState = state; |
|
369 |
||
370 |
//standby state |
|
371 |
state= CPeninputSplitQwertyUiStateStandby::NewL( UiStateMgr(), this ); |
|
372 |
UiStateMgr()->AddUiState( state, EPeninputVkbUiStateStandby ); |
|
373 |
||
374 |
//popup state |
|
375 |
state = CPeninputSplitQwertyUiStatePopup::NewL( UiStateMgr(), this ); |
|
376 |
UiStateMgr()->AddUiState( state, EPeninputVkbUiStatePopup ); |
|
377 |
||
378 |
UiStateMgr()->SetCurrentUiState( initialState ); |
|
379 |
} |
|
380 |
||
381 |
// --------------------------------------------------------------------------- |
|
382 |
// Factory method for creation of layout window |
|
383 |
// --------------------------------------------------------------------------- |
|
384 |
// |
|
385 |
void CPeninputSplitQwertyLayout::CreateLayoutWindowL() |
|
386 |
{ |
|
387 |
iLayoutWindow = CPeninputSplitQwertyWindow::NewL( this, this, UiStateMgr() ); |
|
388 |
} |
|
389 |
||
390 |
// --------------------------------------------------------------------------- |
|
391 |
// Factory method for creation resource config |
|
392 |
// --------------------------------------------------------------------------- |
|
393 |
// |
|
394 |
void CPeninputSplitQwertyLayout::CreateDataMgrL( const TAny* /*aInitData*/ ) |
|
395 |
{ |
|
396 |
iDataMgr = CPeninputSplitQwertyDataMgr::NewL( this ); |
|
397 |
} |
|
398 |
||
399 |
// --------------------------------------------------------------------------- |
|
400 |
// Get the layout type |
|
401 |
// --------------------------------------------------------------------------- |
|
402 |
// |
|
403 |
TInt CPeninputSplitQwertyLayout::LayoutType() |
|
404 |
{ |
|
405 |
return iLayoutType; |
|
406 |
} |
|
407 |
||
408 |
// --------------------------------------------------------------------------- |
|
409 |
// Handle virtual key event |
|
410 |
// --------------------------------------------------------------------------- |
|
411 |
// |
|
412 |
void CPeninputSplitQwertyLayout::HandleVirtualKeyUpL( TInt aEventType, |
|
413 |
CFepUiBaseCtrl* aCtrl, |
|
414 |
const TDesC& aEventData ) |
|
415 |
{ |
|
416 |
CPeninputSplitQwertyWindow* |
|
417 |
win = static_cast<CPeninputSplitQwertyWindow*>( iLayoutWindow ); |
|
418 |
||
419 |
TBool flag = win->HandleVirtualKeyUpEvent( aEventType, aCtrl, aEventData ); |
|
420 |
if( !flag ) |
|
421 |
{ |
|
422 |
HBufC* number = HBufC::NewL( 1 ); |
|
423 |
TPtrC eventDataPtr = aEventData; |
|
424 |
TInt len = aEventData.Length(); |
|
425 |
if ( len > 1 ) |
|
426 |
{ |
|
427 |
TVirtualKeyEventData* data = (TVirtualKeyEventData*) aEventData.Ptr(); |
|
428 |
TUint16 inputCode = data->iKeyEvent.iCode; |
|
429 |
TUint16 outputCode = inputCode; |
|
430 |
TBool isDottedChar = EFalse; |
|
431 |
for ( TInt i = 0; i < KNumberOfDottedChar; i++ ) |
|
432 |
{ |
|
433 |
if ( thaiUnicodeNew[i] == inputCode ) |
|
434 |
{ |
|
435 |
outputCode = thaiUnicodeOri[i]; |
|
436 |
isDottedChar = ETrue; |
|
437 |
break; |
|
438 |
} |
|
439 |
} |
|
440 |
if ( isDottedChar ) |
|
441 |
{ |
|
442 |
number->Des().Append( outputCode ); |
|
443 |
data->iKeyData.Set( *number ); |
|
444 |
eventDataPtr.Set( reinterpret_cast<TUint16*>(data), |
|
445 |
sizeof(*data)/sizeof(TUint16) ); |
|
446 |
} |
|
447 |
} |
|
448 |
||
449 |
CPeninputCommonLayoutExt::HandleControlEvent( aEventType, aCtrl, |
|
450 |
eventDataPtr ); |
|
451 |
delete number; |
|
452 |
} |
|
453 |
} |
|
454 |
||
50
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
455 |
// --------------------------------------------------------------------------- |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
456 |
// Handle virtual key down event |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
457 |
// --------------------------------------------------------------------------- |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
458 |
// |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
459 |
void CPeninputSplitQwertyLayout::HandleVirtualKeyDown() |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
460 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
461 |
CPeninputSplitQwertyWindow* window = |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
462 |
static_cast<CPeninputSplitQwertyWindow*>( iLayoutWindow ); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
463 |
|
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
464 |
if ( window ) |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
465 |
{ |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
466 |
window->HandleVirtualKeyDownEvent(); |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
467 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
468 |
} |
5a1685599b76
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
469 |
|
44 | 470 |
// End Of File |