44
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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 for arabic peninput finger hwr
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <peninputcmd.h>
|
|
19 |
|
|
20 |
#include "peninputfingerhwrarlayout.h"
|
|
21 |
#include "peninputfingerhwrarwnd.h"
|
|
22 |
#include "peninputfingerhwrarstatemanager.h"
|
|
23 |
#include "peninputfingerhwrardatastore.h"
|
|
24 |
#include "peninputfingerhwrarevent.h"
|
|
25 |
|
|
26 |
|
|
27 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
28 |
// CPeninputFingerHwrArStateHandlerBase class
|
|
29 |
// -----------------------------------------------------------------------------
|
|
30 |
// CPeninputFingerHwrArStateHandlerBase::CPeninputFingerHwrArStateHandlerBase()
|
|
31 |
// .
|
|
32 |
// -----------------------------------------------------------------------------
|
|
33 |
//
|
|
34 |
CPeninputFingerHwrArStateHandlerBase::CPeninputFingerHwrArStateHandlerBase(
|
|
35 |
CPeninputFingerHwrArStateManagerBase& aStateManager )
|
|
36 |
:iStateManager( aStateManager ),
|
|
37 |
iDataStore( aStateManager.HwrLayout().DataStore() )
|
|
38 |
{
|
|
39 |
|
|
40 |
}
|
|
41 |
|
|
42 |
// -----------------------------------------------------------------------------
|
|
43 |
// CPeninputFingerHwrArStateHandlerBase::~CPeninputFingerHwrArStateHandlerBase()
|
|
44 |
// .
|
|
45 |
// -----------------------------------------------------------------------------
|
|
46 |
//
|
|
47 |
CPeninputFingerHwrArStateHandlerBase::~CPeninputFingerHwrArStateHandlerBase()
|
|
48 |
{
|
|
49 |
|
|
50 |
}
|
|
51 |
|
|
52 |
|
|
53 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
54 |
// CPeninputFingerHwrStateManager class
|
|
55 |
// -----------------------------------------------------------------------------
|
|
56 |
// CPeninputFingerHwrStateManager::CPeninputFingerHwrStateManager()
|
|
57 |
// .
|
|
58 |
// -----------------------------------------------------------------------------
|
|
59 |
//
|
|
60 |
CPeninputFingerHwrArStateManagerBase::CPeninputFingerHwrArStateManagerBase(
|
|
61 |
CPeninputFingerHwrArLayout* aLayout )
|
|
62 |
:iLayout(aLayout)
|
|
63 |
{
|
|
64 |
|
|
65 |
}
|
|
66 |
|
|
67 |
// -----------------------------------------------------------------------------
|
|
68 |
// CPeninputFingerHwrStateManager::~CPeninputFingerHwrStateManager()
|
|
69 |
// .
|
|
70 |
// -----------------------------------------------------------------------------
|
|
71 |
//
|
|
72 |
CPeninputFingerHwrArStateManagerBase::~CPeninputFingerHwrArStateManagerBase()
|
|
73 |
{
|
|
74 |
}
|
|
75 |
|
|
76 |
// -----------------------------------------------------------------------------
|
|
77 |
// CPeninputFingerHwrStateManager::CosntructL()
|
|
78 |
// .
|
|
79 |
// -----------------------------------------------------------------------------
|
|
80 |
//
|
|
81 |
void CPeninputFingerHwrArStateManagerBase::BaseConstructL()
|
|
82 |
{
|
|
83 |
|
|
84 |
}
|
|
85 |
|
|
86 |
// -----------------------------------------------------------------------------
|
|
87 |
// CPeninputFingerHwrArStateManagerBase::SetState()
|
|
88 |
// .
|
|
89 |
// -----------------------------------------------------------------------------
|
|
90 |
//
|
|
91 |
void CPeninputFingerHwrArStateManagerBase::SetState( TInt /*aState*/ )
|
|
92 |
{
|
|
93 |
|
|
94 |
}
|
|
95 |
|
|
96 |
// -----------------------------------------------------------------------------
|
|
97 |
// CPeninputFingerHwrArStateManagerBase::IsStandbyState()
|
|
98 |
// .
|
|
99 |
// -----------------------------------------------------------------------------
|
|
100 |
//
|
|
101 |
TBool CPeninputFingerHwrArStateManagerBase::IsStandbyState()
|
|
102 |
{
|
|
103 |
if(iCurrentState == 0)
|
|
104 |
{
|
|
105 |
return ETrue;
|
|
106 |
}
|
|
107 |
|
|
108 |
return EFalse;
|
|
109 |
}
|
|
110 |
|
|
111 |
|
|
112 |
// -----------------------------------------------------------------------------
|
|
113 |
// CPeninputFingerHwrArStateManagerBase::HandleEventL()
|
|
114 |
// .
|
|
115 |
// -----------------------------------------------------------------------------
|
|
116 |
//
|
|
117 |
void CPeninputFingerHwrArStateManagerBase::HandleEventL( const TInt /*aEventType*/,
|
|
118 |
const TDesC& /*aEventData*/)
|
|
119 |
{
|
|
120 |
|
|
121 |
}
|
|
122 |
|
|
123 |
CPeninputFingerHwrArLayout& CPeninputFingerHwrArStateManagerBase::HwrLayout()
|
|
124 |
{
|
|
125 |
return *iLayout;
|
|
126 |
}
|
|
127 |
|
|
128 |
|
|
129 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
130 |
// CPeninputFingerHwrStateManager class
|
|
131 |
// -----------------------------------------------------------------------------
|
|
132 |
// CPeninputFingerHwrArStateManager::NewL()
|
|
133 |
// .
|
|
134 |
// -----------------------------------------------------------------------------
|
|
135 |
//
|
|
136 |
CPeninputFingerHwrArStateManager* CPeninputFingerHwrArStateManager::NewL(
|
|
137 |
CPeninputFingerHwrArLayout* aLayout )
|
|
138 |
{
|
|
139 |
CPeninputFingerHwrArStateManager* self = new( ELeave )
|
|
140 |
CPeninputFingerHwrArStateManager( aLayout );
|
|
141 |
CleanupStack::PushL( self );
|
|
142 |
self->ConstructL();
|
|
143 |
CleanupStack::Pop();
|
|
144 |
return self;
|
|
145 |
}
|
|
146 |
|
|
147 |
// -----------------------------------------------------------------------------
|
|
148 |
// CPeninputFingerHwrArStateManager::CPeninputFingerHwrStateManager()
|
|
149 |
// .
|
|
150 |
// -----------------------------------------------------------------------------
|
|
151 |
//
|
|
152 |
CPeninputFingerHwrArStateManager::CPeninputFingerHwrArStateManager(
|
|
153 |
CPeninputFingerHwrArLayout* aLayout )
|
|
154 |
:CPeninputFingerHwrArStateManagerBase( aLayout )
|
|
155 |
{
|
|
156 |
|
|
157 |
}
|
|
158 |
|
|
159 |
// -----------------------------------------------------------------------------
|
|
160 |
// CPeninputFingerHwrArStateManager::~CPeninputFingerHwrStateManager()
|
|
161 |
// .
|
|
162 |
// -----------------------------------------------------------------------------
|
|
163 |
//
|
|
164 |
CPeninputFingerHwrArStateManager::~CPeninputFingerHwrArStateManager()
|
|
165 |
{
|
|
166 |
for( int i = 0; i < EPeninputFingerHwrArStateCount; ++i )
|
|
167 |
{
|
|
168 |
delete iStateHandlers[i];
|
|
169 |
}
|
|
170 |
}
|
|
171 |
|
|
172 |
// -----------------------------------------------------------------------------
|
|
173 |
// CPeninputFingerHwrArStateManager::CosntructL()
|
|
174 |
// .
|
|
175 |
// -----------------------------------------------------------------------------
|
|
176 |
//
|
|
177 |
void CPeninputFingerHwrArStateManager::ConstructL()
|
|
178 |
{
|
|
179 |
BaseConstructL();
|
|
180 |
|
|
181 |
TInt i = 0;
|
|
182 |
|
|
183 |
iStates[i] = EPeninputFingerHwrArStateStandby;
|
|
184 |
iStateHandlers[i] = CPeninputFingerHwrArStateStandby::NewL( *this );
|
|
185 |
|
|
186 |
iStates[++i] = EPeninputFingerHwrArStateWriting;
|
|
187 |
iStateHandlers[i] = CPeninputFingerHwrArStateWriting::NewL( *this );
|
|
188 |
|
|
189 |
iStates[++i] = EPeninputFingerHwrArStateCandidateSelecting;
|
|
190 |
iStateHandlers[i] =
|
|
191 |
CPeninputFingerHwrArStateCandidateSelecting::NewL( *this );
|
|
192 |
|
|
193 |
iCurrentStateHandler = iStateHandlers[0];
|
|
194 |
iCurrentState = EPeninputFingerHwrArStateStandby;
|
|
195 |
}
|
|
196 |
|
|
197 |
// -----------------------------------------------------------------------------
|
|
198 |
// CPeninputFingerHwrArStateManager::SetState()
|
|
199 |
// .
|
|
200 |
// -----------------------------------------------------------------------------
|
|
201 |
//
|
|
202 |
void CPeninputFingerHwrArStateManager::SetState( TInt aState )
|
|
203 |
{
|
|
204 |
if( iCurrentState == aState )
|
|
205 |
{
|
|
206 |
return;
|
|
207 |
}
|
|
208 |
|
|
209 |
CPeninputFingerHwrArStateHandlerBase* newStateHandler = Find( (TPeninputFingerHwrArState)aState );
|
|
210 |
if( newStateHandler )
|
|
211 |
{
|
|
212 |
iCurrentState = (TPeninputFingerHwrArState)aState;
|
|
213 |
iCurrentStateHandler->OnExit();
|
|
214 |
iCurrentStateHandler = newStateHandler;
|
|
215 |
iCurrentStateHandler->OnEntry();
|
|
216 |
}
|
|
217 |
}
|
|
218 |
|
|
219 |
// -----------------------------------------------------------------------------
|
|
220 |
// CPeninputFingerHwrArStateManager::Find()
|
|
221 |
// .
|
|
222 |
// -----------------------------------------------------------------------------
|
|
223 |
//
|
|
224 |
CPeninputFingerHwrArStateHandlerBase* CPeninputFingerHwrArStateManager::Find(
|
|
225 |
TPeninputFingerHwrArState aState )
|
|
226 |
{
|
|
227 |
for( TInt i = 0; i < EPeninputFingerHwrArStateCount; i++ )
|
|
228 |
{
|
|
229 |
if( iStates[i] == aState )
|
|
230 |
{
|
|
231 |
return iStateHandlers[i];
|
|
232 |
}
|
|
233 |
}
|
|
234 |
return NULL;
|
|
235 |
}
|
|
236 |
|
|
237 |
// -----------------------------------------------------------------------------
|
|
238 |
// CPeninputFingerHwrArStateManager::HandleEventL()
|
|
239 |
// .
|
|
240 |
// -----------------------------------------------------------------------------
|
|
241 |
//
|
|
242 |
void CPeninputFingerHwrArStateManager::HandleEventL( const TInt aEventType,
|
|
243 |
const TDesC& aEventData )
|
|
244 |
{
|
|
245 |
iCurrentStateHandler->HandleEventL( aEventType, aEventData );
|
|
246 |
}
|
|
247 |
|
|
248 |
|
|
249 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
250 |
// CPeninputFingerHwrStateHandlerStandby class
|
|
251 |
// -----------------------------------------------------------------------------
|
|
252 |
// CPeninputFingerHwrStateHandlerStandby::CPeninputFingerHwrStateHandlerStandby()
|
|
253 |
// .
|
|
254 |
// -----------------------------------------------------------------------------
|
|
255 |
//
|
|
256 |
CPeninputFingerHwrArStateStandby::CPeninputFingerHwrArStateStandby(
|
|
257 |
CPeninputFingerHwrArStateManager& aStateManager )
|
|
258 |
:CPeninputFingerHwrArStateHandlerBase( aStateManager )
|
|
259 |
{
|
|
260 |
|
|
261 |
}
|
|
262 |
|
|
263 |
// -----------------------------------------------------------------------------
|
|
264 |
// CPeninputFingerHwrStateHandlerStandby::NewL()
|
|
265 |
// .
|
|
266 |
// -----------------------------------------------------------------------------
|
|
267 |
//
|
|
268 |
CPeninputFingerHwrArStateStandby* CPeninputFingerHwrArStateStandby::NewL(
|
|
269 |
CPeninputFingerHwrArStateManager& aStateManager )
|
|
270 |
{
|
|
271 |
CPeninputFingerHwrArStateStandby* self = new( ELeave )
|
|
272 |
CPeninputFingerHwrArStateStandby( aStateManager );
|
|
273 |
|
|
274 |
return self;
|
|
275 |
|
|
276 |
}
|
|
277 |
|
|
278 |
|
|
279 |
// -----------------------------------------------------------------------------
|
|
280 |
// CPeninputFingerHwrStateHandlerStandby::HandleEventL()
|
|
281 |
// .
|
|
282 |
// -----------------------------------------------------------------------------
|
|
283 |
//
|
|
284 |
void CPeninputFingerHwrArStateStandby::HandleEventL( const TInt aEventType,
|
|
285 |
const TDesC& /*aEventData*/ )
|
|
286 |
{
|
|
287 |
switch( aEventType )
|
|
288 |
{
|
|
289 |
case EEventHwrStrokeStarted:
|
|
290 |
{
|
|
291 |
iStateManager.SetState(
|
|
292 |
CPeninputFingerHwrArStateManager::EPeninputFingerHwrArStateWriting );
|
|
293 |
}
|
|
294 |
break;
|
|
295 |
default:
|
|
296 |
break;
|
|
297 |
}
|
|
298 |
}
|
|
299 |
|
|
300 |
// -----------------------------------------------------------------------------
|
|
301 |
// CPeninputFingerHwrStateHandlerStandby::OnEntry()
|
|
302 |
// .
|
|
303 |
// -----------------------------------------------------------------------------
|
|
304 |
//
|
|
305 |
void CPeninputFingerHwrArStateStandby::OnEntry()
|
|
306 |
{
|
|
307 |
// iDataStore.TriggerStr()->DeleteAll();
|
|
308 |
|
|
309 |
}
|
|
310 |
|
|
311 |
// -----------------------------------------------------------------------------
|
|
312 |
// CPeninputFingerHwrStateHandlerStandby::OnExit()
|
|
313 |
// .
|
|
314 |
// -----------------------------------------------------------------------------
|
|
315 |
//
|
|
316 |
void CPeninputFingerHwrArStateStandby::OnExit()
|
|
317 |
{
|
|
318 |
|
|
319 |
}
|
|
320 |
|
|
321 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
322 |
// CPeninputFingerHwrStateHandlerWriting class
|
|
323 |
// -----------------------------------------------------------------------------
|
|
324 |
// CPeninputFingerHwrArStateWriting::CPeninputFingerHwrStateHandlerWriting()
|
|
325 |
// .
|
|
326 |
// -----------------------------------------------------------------------------
|
|
327 |
//
|
|
328 |
CPeninputFingerHwrArStateWriting::CPeninputFingerHwrArStateWriting(
|
|
329 |
CPeninputFingerHwrArStateManager& aStateManager )
|
|
330 |
:CPeninputFingerHwrArStateHandlerBase( aStateManager )
|
|
331 |
{
|
|
332 |
|
|
333 |
}
|
|
334 |
|
|
335 |
// -----------------------------------------------------------------------------
|
|
336 |
// CPeninputFingerHwrArStateWriting::NewL()
|
|
337 |
// .
|
|
338 |
// -----------------------------------------------------------------------------
|
|
339 |
//
|
|
340 |
CPeninputFingerHwrArStateWriting* CPeninputFingerHwrArStateWriting::NewL(
|
|
341 |
CPeninputFingerHwrArStateManager& aStateManager )
|
|
342 |
{
|
|
343 |
CPeninputFingerHwrArStateWriting* self = new( ELeave )
|
|
344 |
CPeninputFingerHwrArStateWriting( aStateManager );
|
|
345 |
|
|
346 |
return self;
|
|
347 |
|
|
348 |
}
|
|
349 |
|
|
350 |
|
|
351 |
// -----------------------------------------------------------------------------
|
|
352 |
// CPeninputFingerHwrArStateWriting::HandleEventL()
|
|
353 |
// .
|
|
354 |
// -----------------------------------------------------------------------------
|
|
355 |
//
|
|
356 |
void CPeninputFingerHwrArStateWriting::HandleEventL( const TInt aEventType,
|
|
357 |
const TDesC& aEventData )
|
|
358 |
{
|
|
359 |
switch( aEventType )
|
|
360 |
{
|
|
361 |
case EEventHwrStrokeFinished:
|
|
362 |
{
|
|
363 |
OnEndStrokeL(aEventData);
|
|
364 |
}
|
|
365 |
break;
|
|
366 |
case EEventHwrCharacterTimerOut:
|
|
367 |
{
|
|
368 |
OnEndWritingL( aEventData );
|
|
369 |
}
|
|
370 |
break;
|
|
371 |
default:
|
|
372 |
break;
|
|
373 |
}
|
|
374 |
}
|
|
375 |
|
|
376 |
// -----------------------------------------------------------------------------
|
|
377 |
// CPeninputFingerHwrArStateWriting::OnEndStrokeL()
|
|
378 |
// .
|
|
379 |
// -----------------------------------------------------------------------------
|
|
380 |
//
|
|
381 |
void CPeninputFingerHwrArStateWriting::OnEndStrokeL( const TDesC& aEventData )
|
|
382 |
{
|
|
383 |
const RArray<TPoint>* aTraceData = ( RArray<TPoint>* )aEventData.Ptr();
|
|
384 |
iDataStore.DoRecognizeL( *aTraceData );
|
|
385 |
}
|
|
386 |
|
|
387 |
|
|
388 |
// -----------------------------------------------------------------------------
|
|
389 |
// CPeninputFingerHwrArStateWriting::OnEndWriting()
|
|
390 |
// .
|
|
391 |
// -----------------------------------------------------------------------------
|
|
392 |
//
|
|
393 |
void CPeninputFingerHwrArStateWriting::OnEndWritingL( const TDesC& /*aEventData*/ )
|
|
394 |
{
|
|
395 |
// record the default cell highlight flag.
|
|
396 |
iDataStore.SetHighlight(ETrue);
|
|
397 |
// This is a workarround to clear the recognizer.
|
|
398 |
RArray<TPoint> stroke_array;
|
|
399 |
stroke_array.Reset();
|
|
400 |
// Call recognize with a empty array of stroke is the condition
|
|
401 |
// to clear the context>
|
|
402 |
iDataStore.DoRecognizeL(stroke_array );
|
|
403 |
|
|
404 |
RPointerArray<HBufC> candidates = iDataStore.Candidate();
|
|
405 |
if ( candidates.Count() > 0 )
|
|
406 |
{
|
|
407 |
if(iStateManager.HwrLayout().IsAllowedToSubmitDefaultCandiate())
|
|
408 |
{
|
|
409 |
iStateManager.HwrLayout().SubmitStringToFep( *candidates[0]);
|
|
410 |
}
|
|
411 |
iStateManager.SetState( CPeninputFingerHwrArStateManager::
|
|
412 |
EPeninputFingerHwrArStateCandidateSelecting );
|
|
413 |
|
|
414 |
}
|
|
415 |
}
|
|
416 |
|
|
417 |
// -----------------------------------------------------------------------------
|
|
418 |
// CPeninputFingerHwrArStateWriting::OnEntry()
|
|
419 |
// .
|
|
420 |
// -----------------------------------------------------------------------------
|
|
421 |
//
|
|
422 |
void CPeninputFingerHwrArStateWriting::OnEntry()
|
|
423 |
{
|
|
424 |
|
|
425 |
}
|
|
426 |
|
|
427 |
// -----------------------------------------------------------------------------
|
|
428 |
// CPeninputFingerHwrArStateWriting::OnExit()
|
|
429 |
// .
|
|
430 |
// -----------------------------------------------------------------------------
|
|
431 |
//
|
|
432 |
void CPeninputFingerHwrArStateWriting::OnExit()
|
|
433 |
{
|
|
434 |
|
|
435 |
}
|
|
436 |
|
|
437 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
438 |
// CPeninputFingerHwrStateHandlerCandidateSelecting class
|
|
439 |
// -----------------------------------------------------------------------------
|
|
440 |
// CPeninputFingerHwrArStateCandidateSelecting::
|
|
441 |
// CPeninputFingerHwrArStateCandidateSelecting()
|
|
442 |
// .
|
|
443 |
// -----------------------------------------------------------------------------
|
|
444 |
//
|
|
445 |
CPeninputFingerHwrArStateCandidateSelecting::
|
|
446 |
CPeninputFingerHwrArStateCandidateSelecting(
|
|
447 |
CPeninputFingerHwrArStateManager& aStateManager )
|
|
448 |
:CPeninputFingerHwrArStateHandlerBase( aStateManager )
|
|
449 |
{
|
|
450 |
|
|
451 |
}
|
|
452 |
|
|
453 |
// -----------------------------------------------------------------------------
|
|
454 |
// CPeninputFingerHwrArStateCandidateSelecting::NewL()
|
|
455 |
// .
|
|
456 |
// -----------------------------------------------------------------------------
|
|
457 |
//
|
|
458 |
CPeninputFingerHwrArStateCandidateSelecting*
|
|
459 |
CPeninputFingerHwrArStateCandidateSelecting::NewL(
|
|
460 |
CPeninputFingerHwrArStateManager& aStateManager )
|
|
461 |
{
|
|
462 |
CPeninputFingerHwrArStateCandidateSelecting* self = new( ELeave )
|
|
463 |
CPeninputFingerHwrArStateCandidateSelecting( aStateManager );
|
|
464 |
|
|
465 |
return self;
|
|
466 |
}
|
|
467 |
|
|
468 |
|
|
469 |
// -----------------------------------------------------------------------------
|
|
470 |
// CPeninputFingerHwrArStateCandidateSelecting::HandleEventL()
|
|
471 |
// .
|
|
472 |
// -----------------------------------------------------------------------------
|
|
473 |
//
|
|
474 |
void CPeninputFingerHwrArStateCandidateSelecting::HandleEventL( const TInt aEventType,
|
|
475 |
const TDesC& aEventData )
|
|
476 |
{
|
|
477 |
switch( aEventType )
|
|
478 |
{
|
|
479 |
case EHwrEventCandidateSelected:
|
|
480 |
{
|
|
481 |
OnSelectedCandidatesL( aEventData );
|
|
482 |
}
|
|
483 |
break;
|
|
484 |
case EHwrEventKeyBack:
|
|
485 |
{
|
|
486 |
OnClickBackSpaceL();
|
|
487 |
}
|
|
488 |
break;
|
|
489 |
case EEventHwrStrokeStarted:
|
|
490 |
{
|
|
491 |
iStateManager.SetState( CPeninputFingerHwrArStateManager::
|
|
492 |
EPeninputFingerHwrArStateWriting );
|
|
493 |
}
|
|
494 |
break;
|
|
495 |
default:
|
|
496 |
break;
|
|
497 |
}
|
|
498 |
|
|
499 |
}
|
|
500 |
|
|
501 |
// -----------------------------------------------------------------------------
|
|
502 |
// CPeninputFingerHwrStateHandlerCandidateSelecting::OnSelectedCandidatesL()
|
|
503 |
// .
|
|
504 |
// -----------------------------------------------------------------------------
|
|
505 |
//
|
|
506 |
void CPeninputFingerHwrArStateCandidateSelecting::OnSelectedCandidatesL(
|
|
507 |
const TDesC& aEventData )
|
|
508 |
{
|
|
509 |
//get the candidate index
|
|
510 |
const TInt cellNo = aEventData[aEventData.Length()-1];
|
|
511 |
if (!iDataStore.IsValidCandidate( cellNo ))
|
|
512 |
{
|
|
513 |
iStateManager.SetState( CPeninputFingerHwrArStateManager::
|
|
514 |
EPeninputFingerHwrArStateStandby );
|
|
515 |
return;
|
|
516 |
}
|
|
517 |
|
|
518 |
TPtrC ptr;
|
|
519 |
ptr.Set( ( aEventData.Left( aEventData.Length() - 1 ) ) );
|
|
520 |
if(!iStateManager.HwrLayout().IsAllowedToSubmitDefaultCandiate())
|
|
521 |
{
|
|
522 |
iStateManager.HwrLayout().SubmitStringToFep( ptr);
|
|
523 |
}
|
|
524 |
else
|
|
525 |
{
|
|
526 |
RPointerArray<HBufC> candidates = iDataStore.Candidate();
|
|
527 |
//the selected char is not same as default
|
|
528 |
//replace the default candidate
|
|
529 |
HBufC* defaultCandidate = candidates[0];
|
|
530 |
if( *defaultCandidate != ptr )
|
|
531 |
{
|
|
532 |
iStateManager.HwrLayout().Replace( *defaultCandidate, ptr, EFalse);
|
|
533 |
}
|
|
534 |
}
|
|
535 |
iDataStore.SetArabicSymbolL();
|
|
536 |
}
|
|
537 |
|
|
538 |
|
|
539 |
// -----------------------------------------------------------------------------
|
|
540 |
// CPeninputFingerHwrStateHandlerCandidateSelecting::OnClickBackSpaceL()
|
|
541 |
// .
|
|
542 |
// -----------------------------------------------------------------------------
|
|
543 |
//
|
|
544 |
void CPeninputFingerHwrArStateCandidateSelecting::OnClickBackSpaceL()
|
|
545 |
{
|
|
546 |
iDataStore.SetHighlight(EFalse);
|
|
547 |
iDataStore.SetArabicSymbolL();
|
|
548 |
iStateManager.SetState( CPeninputFingerHwrArStateManager::
|
|
549 |
EPeninputFingerHwrArStateStandby );
|
|
550 |
}
|
|
551 |
|
|
552 |
|
|
553 |
|
|
554 |
// -----------------------------------------------------------------------------
|
|
555 |
// CPeninputFingerHwrStateHandlerCandidateSelecting::OnEntry()
|
|
556 |
// .
|
|
557 |
// -----------------------------------------------------------------------------
|
|
558 |
//
|
|
559 |
void CPeninputFingerHwrArStateCandidateSelecting::OnEntry()
|
|
560 |
{
|
|
561 |
}
|
|
562 |
|
|
563 |
// -----------------------------------------------------------------------------
|
|
564 |
// CPeninputFingerHwrStateHandlerCandidateSelecting::OnExit()
|
|
565 |
// .
|
|
566 |
// -----------------------------------------------------------------------------
|
|
567 |
//
|
|
568 |
void CPeninputFingerHwrArStateCandidateSelecting::OnExit()
|
|
569 |
{
|
|
570 |
|
|
571 |
}
|
|
572 |
//End of file
|