21
|
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 |
|
|
19 |
#ifndef C_PENINPUTFINGERHWRARSTATEMANAGER_H
|
|
20 |
#define C_PENINPUTFINGERHWRARSTATEMANAGER_H
|
|
21 |
|
|
22 |
//SYSTEM INCLUDES
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <e32cmn.h>
|
|
25 |
|
|
26 |
//FORWARD CLASS
|
|
27 |
class CPeninputFingerHwrArLayout;
|
|
28 |
class CPeninputFingerHwrArDataStore;
|
|
29 |
class CPeninputFingerHwrArStateManagerBase;
|
|
30 |
class CPeninputFingerHwrArStateManager;
|
|
31 |
|
|
32 |
|
|
33 |
/**
|
|
34 |
* Class MPeninputFingerHwrArStateHandler
|
|
35 |
*
|
|
36 |
* The state handler interfaces
|
|
37 |
*
|
|
38 |
* @lib peninputfingerhwrar.lib
|
|
39 |
* @since S60 v5.0
|
|
40 |
*/
|
|
41 |
class MPeninputFingerHwrArStateHandler
|
|
42 |
{
|
|
43 |
public:
|
|
44 |
/**
|
|
45 |
* Handle state event
|
|
46 |
*
|
|
47 |
* @since Symbian TB9.2
|
|
48 |
*/
|
|
49 |
virtual void HandleEventL( const TInt aEventType, const TDesC& aEventData ) = 0;
|
|
50 |
|
|
51 |
/**
|
|
52 |
* Handle the state entering action
|
|
53 |
*
|
|
54 |
* @since Symbian TB9.2
|
|
55 |
*/
|
|
56 |
virtual void OnEntry() = 0;
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Handle the state exiting action
|
|
60 |
*
|
|
61 |
* @since Symbian TB9.2
|
|
62 |
*/
|
|
63 |
virtual void OnExit() = 0;
|
|
64 |
};
|
|
65 |
|
|
66 |
|
|
67 |
/**
|
|
68 |
* The state handler base class.
|
|
69 |
*
|
|
70 |
* @since Symbian TB9.2.
|
|
71 |
*/
|
|
72 |
class CPeninputFingerHwrArStateHandlerBase :public CBase
|
|
73 |
,public MPeninputFingerHwrArStateHandler
|
|
74 |
{
|
|
75 |
|
|
76 |
public:
|
|
77 |
/**
|
|
78 |
* The handler base destructor
|
|
79 |
*
|
|
80 |
* @since Symbian TB9.2
|
|
81 |
*/
|
|
82 |
virtual ~CPeninputFingerHwrArStateHandlerBase();
|
|
83 |
|
|
84 |
protected:
|
|
85 |
/**
|
|
86 |
* The constructor.
|
|
87 |
*
|
|
88 |
* @since Symbian TB9.2
|
|
89 |
* @param aStateManager The reference to state manager. @see CPeninputFingerHwrStateManager.
|
|
90 |
*/
|
|
91 |
CPeninputFingerHwrArStateHandlerBase( CPeninputFingerHwrArStateManagerBase& aStateManager );
|
|
92 |
|
|
93 |
protected:
|
|
94 |
/**
|
|
95 |
* The reference to state manager.
|
|
96 |
*
|
|
97 |
* @since Symbian TB9.2
|
|
98 |
*/
|
|
99 |
CPeninputFingerHwrArStateManagerBase& iStateManager;
|
|
100 |
|
|
101 |
/**
|
|
102 |
* The data store reference
|
|
103 |
*
|
|
104 |
* @since Symbian TB9.2
|
|
105 |
*/
|
|
106 |
CPeninputFingerHwrArDataStore& iDataStore;
|
|
107 |
};
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
/**
|
|
112 |
* The finger hwr state manager base class.
|
|
113 |
*
|
|
114 |
* @since Symbian TB9.2
|
|
115 |
*/
|
|
116 |
class CPeninputFingerHwrArStateManagerBase : public CBase
|
|
117 |
{
|
|
118 |
public:
|
|
119 |
enum TStateManagerState
|
|
120 |
{
|
|
121 |
EStateStandBy = 0
|
|
122 |
};
|
|
123 |
public:
|
|
124 |
/**
|
|
125 |
* The destructor
|
|
126 |
*
|
|
127 |
*@since Symbian TB9.2
|
|
128 |
*/
|
|
129 |
virtual ~CPeninputFingerHwrArStateManagerBase();
|
|
130 |
|
|
131 |
public:
|
|
132 |
/**
|
|
133 |
* Handle the hwr box and canidate events
|
|
134 |
*
|
|
135 |
* @since Symbian TB9.2
|
|
136 |
* @param aEventType The event type
|
|
137 |
* @param aEventData The event data
|
|
138 |
*/
|
|
139 |
virtual void HandleEventL( const TInt aEventType, const TDesC& aEventData );
|
|
140 |
|
|
141 |
/**
|
|
142 |
* Return the layout reference
|
|
143 |
*
|
|
144 |
* @since Symbian TB9.2
|
|
145 |
* CPeninputFingerHwrArLayout& The hwr layout reference
|
|
146 |
*/
|
|
147 |
CPeninputFingerHwrArLayout& HwrLayout();
|
|
148 |
|
|
149 |
/**
|
|
150 |
* Is stanby state
|
|
151 |
*
|
|
152 |
* @since Symbian TB9.2
|
|
153 |
* TBool The standby state flag
|
|
154 |
*/
|
|
155 |
TBool IsStandbyState();
|
|
156 |
|
|
157 |
/**
|
|
158 |
* Set current state.
|
|
159 |
*
|
|
160 |
* @since Symbian TB9.2
|
|
161 |
* @param aState The state to be set. @See TPeninputFingerHwrState.
|
|
162 |
*/
|
|
163 |
virtual void SetState( TInt aState );
|
|
164 |
|
|
165 |
|
|
166 |
protected:
|
|
167 |
/**
|
|
168 |
* 2nd phase constructor.
|
|
169 |
*
|
|
170 |
* @since Symbian TB9.2
|
|
171 |
*/
|
|
172 |
void BaseConstructL();
|
|
173 |
|
|
174 |
/**
|
|
175 |
* The constructor.
|
|
176 |
*
|
|
177 |
* @since Symbian TB9.2
|
|
178 |
* @param aLayout The full screen HWR layout pointer.
|
|
179 |
*/
|
|
180 |
CPeninputFingerHwrArStateManagerBase( CPeninputFingerHwrArLayout* aLayout );
|
|
181 |
|
|
182 |
/**
|
|
183 |
* Pointer to the full screen hwr layout.
|
|
184 |
*
|
|
185 |
* Not own.
|
|
186 |
*/
|
|
187 |
CPeninputFingerHwrArLayout* iLayout;
|
|
188 |
|
|
189 |
/**
|
|
190 |
* The pointer to current state.
|
|
191 |
* Own
|
|
192 |
*/
|
|
193 |
CPeninputFingerHwrArStateHandlerBase* iCurrentStateHandler;
|
|
194 |
|
|
195 |
/**
|
|
196 |
* The current state.
|
|
197 |
* Own
|
|
198 |
*/
|
|
199 |
TInt iCurrentState;
|
|
200 |
|
|
201 |
};
|
|
202 |
|
|
203 |
/**
|
|
204 |
* The finger hwr state manager for arabic.
|
|
205 |
*
|
|
206 |
* @since Symbian TB9.2
|
|
207 |
*/
|
|
208 |
class CPeninputFingerHwrArStateManager : public CPeninputFingerHwrArStateManagerBase
|
|
209 |
{
|
|
210 |
public:
|
|
211 |
/**
|
|
212 |
* The factory function
|
|
213 |
*
|
|
214 |
* @since Symbian TB9.2
|
|
215 |
* @param aLayout The layout reference
|
|
216 |
* @return CPeninputFingerHwrArStateManager* The newly created CPeninputFingerHwrArStateManager object
|
|
217 |
*/
|
|
218 |
static CPeninputFingerHwrArStateManager* NewL( CPeninputFingerHwrArLayout* aLayout );
|
|
219 |
|
|
220 |
/**
|
|
221 |
* The destructor
|
|
222 |
*
|
|
223 |
*@since Symbian TB9.2
|
|
224 |
*/
|
|
225 |
~CPeninputFingerHwrArStateManager();
|
|
226 |
|
|
227 |
public:
|
|
228 |
/**
|
|
229 |
* The hwr states.
|
|
230 |
*
|
|
231 |
*@since Symbian TB9.2
|
|
232 |
*/
|
|
233 |
enum TPeninputFingerHwrArState
|
|
234 |
{
|
|
235 |
EPeninputFingerHwrArStateStandby = EStateStandBy,
|
|
236 |
EPeninputFingerHwrArStateWriting,
|
|
237 |
EPeninputFingerHwrArStateCandidateSelecting,
|
|
238 |
EPeninputFingerHwrArStateCount
|
|
239 |
};
|
|
240 |
|
|
241 |
public:
|
|
242 |
/**
|
|
243 |
* Handle the hwr box and canidate events
|
|
244 |
*
|
|
245 |
* @since Symbian TB9.2
|
|
246 |
* @param aEventType The event type
|
|
247 |
* @param aEventData The event data
|
|
248 |
*/
|
|
249 |
virtual void HandleEventL( const TInt aEventType, const TDesC& aEventData );
|
|
250 |
|
|
251 |
/**
|
|
252 |
* Set current state.
|
|
253 |
*
|
|
254 |
* @since Symbian TB9.2
|
|
255 |
* @param aState The state to be set. @See TPeninputFingerHwrState.
|
|
256 |
*/
|
|
257 |
virtual void SetState( TInt aState );
|
|
258 |
|
|
259 |
private:
|
|
260 |
/**
|
|
261 |
* The constructor.
|
|
262 |
*
|
|
263 |
* @since Symbian TB9.2
|
|
264 |
* @param aLayout The full screen HWR layout pointer.
|
|
265 |
*/
|
|
266 |
CPeninputFingerHwrArStateManager( CPeninputFingerHwrArLayout* aLayout );
|
|
267 |
|
|
268 |
/**
|
|
269 |
* 2nd phase constructor.
|
|
270 |
*
|
|
271 |
* @since Symbian TB9.2
|
|
272 |
*/
|
|
273 |
void ConstructL();
|
|
274 |
|
|
275 |
/**
|
|
276 |
* Find the current state object.
|
|
277 |
*
|
|
278 |
* @since Symbian TB9.2
|
|
279 |
* @param aState According to this state type,
|
|
280 |
* we could find the corresponding state obect.
|
|
281 |
*/
|
|
282 |
CPeninputFingerHwrArStateHandlerBase* Find( TPeninputFingerHwrArState );
|
|
283 |
|
|
284 |
private:
|
|
285 |
/**
|
|
286 |
* Store all states pointers.
|
|
287 |
* Own.
|
|
288 |
*/
|
|
289 |
CPeninputFingerHwrArStateHandlerBase* iStateHandlers[EPeninputFingerHwrArStateCount];
|
|
290 |
|
|
291 |
/**
|
|
292 |
* Store all states' types.
|
|
293 |
* Own
|
|
294 |
*/
|
|
295 |
TPeninputFingerHwrArState iStates[EPeninputFingerHwrArStateCount];
|
|
296 |
};
|
|
297 |
|
|
298 |
|
|
299 |
|
|
300 |
/**
|
|
301 |
* The Standby state class.
|
|
302 |
*
|
|
303 |
* @since Symbian TB9.2
|
|
304 |
*/
|
|
305 |
class CPeninputFingerHwrArStateStandby : public CPeninputFingerHwrArStateHandlerBase
|
|
306 |
{
|
|
307 |
public:
|
|
308 |
/**
|
|
309 |
* Factory function
|
|
310 |
*
|
|
311 |
* @since Symbian TB9.2
|
|
312 |
* @param aStateManager The reference to state manager. @see CPeninputFingerHwrStateManager.
|
|
313 |
* @return CPeninputFingerHwrStateHandlerStandby* Return the
|
|
314 |
CPeninputFingerHwrStateHandlerStandby object pointer.
|
|
315 |
*/
|
|
316 |
static CPeninputFingerHwrArStateStandby* NewL(
|
|
317 |
CPeninputFingerHwrArStateManager& aStateManager );
|
|
318 |
public:
|
|
319 |
|
|
320 |
/**
|
|
321 |
* Handle state event
|
|
322 |
*
|
|
323 |
* @since Symbian TB9.2
|
|
324 |
*/
|
|
325 |
void HandleEventL( const TInt aEventType, const TDesC& aEventData );
|
|
326 |
|
|
327 |
/**
|
|
328 |
* Handle the state entering action
|
|
329 |
*
|
|
330 |
* @since Symbian TB9.2
|
|
331 |
*/
|
|
332 |
void OnEntry();
|
|
333 |
|
|
334 |
/**
|
|
335 |
* Handle the state exiting action
|
|
336 |
*
|
|
337 |
* @since Symbian TB9.2
|
|
338 |
*/
|
|
339 |
void OnExit();
|
|
340 |
|
|
341 |
private:
|
|
342 |
/**
|
|
343 |
* The constructor
|
|
344 |
*
|
|
345 |
* @since Symbian TB9.2
|
|
346 |
* @param aStateManager The reference to state manager. @see CPeninputFingerHwrStateManager.
|
|
347 |
*/
|
|
348 |
CPeninputFingerHwrArStateStandby(
|
|
349 |
CPeninputFingerHwrArStateManager& aStateManager );
|
|
350 |
|
|
351 |
};
|
|
352 |
|
|
353 |
|
|
354 |
/**
|
|
355 |
* The Writing state class.
|
|
356 |
*
|
|
357 |
* @since Symbian TB9.2
|
|
358 |
*/
|
|
359 |
class CPeninputFingerHwrArStateWriting : public CPeninputFingerHwrArStateHandlerBase
|
|
360 |
{
|
|
361 |
public:
|
|
362 |
/**
|
|
363 |
* Factory function
|
|
364 |
*
|
|
365 |
* @since Symbian TB9.2
|
|
366 |
* @param aStateManager The reference to state manager. @see CPeninputFingerHwrStateManager.
|
|
367 |
* @return CPeninputFingerHwrStateHandlerWriting* Return the
|
|
368 |
CPeninputFingerHwrStateHandlerWriting object pointer.
|
|
369 |
*/
|
|
370 |
static CPeninputFingerHwrArStateWriting* NewL(
|
|
371 |
CPeninputFingerHwrArStateManager& aStateManager );
|
|
372 |
public:
|
|
373 |
|
|
374 |
/**
|
|
375 |
* Handle state event
|
|
376 |
*
|
|
377 |
* @since Symbian TB9.2
|
|
378 |
*/
|
|
379 |
void HandleEventL( const TInt aEventType, const TDesC& aEventData );
|
|
380 |
|
|
381 |
/**
|
|
382 |
* Handle the state entering action
|
|
383 |
*
|
|
384 |
* @since Symbian TB9.2
|
|
385 |
*/
|
|
386 |
void OnEntry();
|
|
387 |
|
|
388 |
/**
|
|
389 |
* Handle the state exiting action
|
|
390 |
*
|
|
391 |
* @since Symbian TB9.2
|
|
392 |
*/
|
|
393 |
void OnExit();
|
|
394 |
|
|
395 |
private:
|
|
396 |
/**
|
|
397 |
* The constructor
|
|
398 |
*
|
|
399 |
* @since Symbian TB9.2
|
|
400 |
* @param aStateManager The reference to state manager. @see CPeninputFingerHwrStateManager.
|
|
401 |
*/
|
|
402 |
CPeninputFingerHwrArStateWriting( CPeninputFingerHwrArStateManager& aStateManager );
|
|
403 |
|
|
404 |
private:
|
|
405 |
/**
|
|
406 |
* Handle the end stroke event
|
|
407 |
*
|
|
408 |
* @since Symbian TB9.2
|
|
409 |
* @param aEventData The trace data
|
|
410 |
*/
|
|
411 |
void OnEndStrokeL( const TDesC& aEventData );
|
|
412 |
|
|
413 |
/**
|
|
414 |
* Handle the end writing event
|
|
415 |
*
|
|
416 |
* @since Symbian TB9.2
|
|
417 |
* @param aEventData The trace data
|
|
418 |
*/
|
|
419 |
void OnEndWritingL( const TDesC& aEventData );
|
|
420 |
|
|
421 |
};
|
|
422 |
|
|
423 |
/**
|
|
424 |
* The CandidateSelecting state class for Chinese.
|
|
425 |
*
|
|
426 |
* @since Symbian TB9.2
|
|
427 |
*/
|
|
428 |
class CPeninputFingerHwrArStateCandidateSelecting : public CPeninputFingerHwrArStateHandlerBase
|
|
429 |
{
|
|
430 |
public:
|
|
431 |
/**
|
|
432 |
* Factory function
|
|
433 |
*
|
|
434 |
* @since Symbian TB9.2
|
|
435 |
* @param aStateManager The reference to state manager. @see CPeninputFingerHwrStateManager.
|
|
436 |
* @return CPeninputFingerHwrStateHandlerCandidateSelecting Return the
|
|
437 |
CPeninputFingerHwrStateHandlerCandidateSelecting object pointer.
|
|
438 |
*/
|
|
439 |
static CPeninputFingerHwrArStateCandidateSelecting* NewL(
|
|
440 |
CPeninputFingerHwrArStateManager& aStateManager );
|
|
441 |
public:
|
|
442 |
|
|
443 |
/**
|
|
444 |
* Handle state event
|
|
445 |
*
|
|
446 |
* @since Symbian TB9.2
|
|
447 |
*/
|
|
448 |
void HandleEventL( const TInt aEventType, const TDesC& aEventData );
|
|
449 |
|
|
450 |
/**
|
|
451 |
* Handle the state entering action
|
|
452 |
*
|
|
453 |
* @since Symbian TB9.2
|
|
454 |
*/
|
|
455 |
void OnEntry();
|
|
456 |
|
|
457 |
/**
|
|
458 |
* Handle the state exiting action
|
|
459 |
*
|
|
460 |
* @since Symbian TB9.2
|
|
461 |
*/
|
|
462 |
void OnExit();
|
|
463 |
|
|
464 |
private:
|
|
465 |
/**
|
|
466 |
* The constructor
|
|
467 |
*
|
|
468 |
* @since Symbian TB9.2
|
|
469 |
* @param aStateManager The reference to state manager. @see CPeninputFingerHwrStateManager.
|
|
470 |
*/
|
|
471 |
CPeninputFingerHwrArStateCandidateSelecting(
|
|
472 |
CPeninputFingerHwrArStateManager& aStateManager );
|
|
473 |
|
|
474 |
private:
|
|
475 |
/**
|
|
476 |
* Handle one candiate selected event
|
|
477 |
*
|
|
478 |
* @since Symbian TB9.2
|
|
479 |
* @param aEventData The selected candidate
|
|
480 |
*/
|
|
481 |
void OnSelectedCandidatesL( const TDesC& aEventData );
|
|
482 |
|
|
483 |
|
|
484 |
/**
|
|
485 |
* Handle backspace events
|
|
486 |
*
|
|
487 |
* @since Symbian TB9.2
|
|
488 |
*/
|
|
489 |
void OnClickBackSpaceL();
|
|
490 |
};
|
|
491 |
|
|
492 |
|
|
493 |
|
|
494 |
#endif //C_PENINPUTFINGERHWRARSTATEMANAGER_H
|