|
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: vkb layout |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CAKNFEPVKBLAYOUT_H |
|
20 #define C_CAKNFEPVKBLAYOUT_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <aknfepglobalenums.h> |
|
24 #include <peninputlayout.h> |
|
25 #include <peninputlayoutplugininterface.h> |
|
26 #include "peninputvkblayoutcontext.h" |
|
27 #include "peninputcmdparam.h" |
|
28 |
|
29 /** class forward decalaration */ |
|
30 class CAknFepVkbDataMgr; |
|
31 class CAknFepVkbUiStateMgr; |
|
32 class CAknFepVkbWindow; |
|
33 class CPtiEngine; |
|
34 |
|
35 /** |
|
36 * peninputvkbcn layout interface implemtation |
|
37 * |
|
38 * @lib peninputvkbcn.lib |
|
39 * @since S60 v3.2 |
|
40 */ |
|
41 class CAknFepVkbLayoutImp : public CFepUiLayoutInterface |
|
42 { |
|
43 public: |
|
44 |
|
45 /** |
|
46 * Symbian constructor. |
|
47 * |
|
48 * @since S60 v3.2 |
|
49 * @param aInitParams Init data for layout |
|
50 * @return Pointer to created CAknFepHwrBxLayoutImp object |
|
51 */ |
|
52 static CAknFepVkbLayoutImp* NewL(TAny* aInitParams); |
|
53 |
|
54 |
|
55 static CAknFepVkbLayoutImp* NewFsqL( TAny* aInitParams ); |
|
56 |
|
57 /** |
|
58 * destructor. |
|
59 * |
|
60 * @since S60 v3.2 |
|
61 * @return None |
|
62 */ |
|
63 virtual ~CAknFepVkbLayoutImp(); |
|
64 |
|
65 //from CFepUiLayoutInterface |
|
66 |
|
67 /** |
|
68 * From CFepUiLayoutInterface. |
|
69 * Handle layout command event |
|
70 * |
|
71 * @since S60 v3.2 |
|
72 * @param aLayoutOwner The layout owner |
|
73 * @param aData The data for creating layout |
|
74 * @return Pointer to created CFepUiLayout object |
|
75 */ |
|
76 CFepUiLayout* CreateFepUiLayoutL(MLayoutOwner* aLayoutOwner,const TAny* aData); |
|
77 |
|
78 private: |
|
79 |
|
80 /** |
|
81 * C++ default constructor |
|
82 * |
|
83 * @since S60 v3.2 |
|
84 * @return None |
|
85 */ |
|
86 CAknFepVkbLayoutImp(); |
|
87 |
|
88 /** |
|
89 * Symbian second-phase constructor |
|
90 * |
|
91 * @since S60 v3.2 |
|
92 * @param aIsFsq Is Full screen qwert mode |
|
93 * @return None |
|
94 */ |
|
95 void ConstructL( TBool aIsFsq ); |
|
96 |
|
97 private:// data |
|
98 TBool iIsFsq; |
|
99 }; |
|
100 |
|
101 /** |
|
102 * peninputvkbcn layout |
|
103 * |
|
104 * @lib peninputvkbcn.lib |
|
105 * @since S60 v3.2 |
|
106 */ |
|
107 class CAknFepVkbLayout : public CFepUiLayout, |
|
108 public MAknFepVkbLayoutContext |
|
109 { |
|
110 |
|
111 public: |
|
112 |
|
113 /** |
|
114 * Symbian constructor. |
|
115 * |
|
116 * @since S60 v3.2 |
|
117 * @param aInitData Init data for layout |
|
118 * @return Pointer to created CAknFepHwrBxLayout object |
|
119 */ |
|
120 static CAknFepVkbLayout* NewL(MLayoutOwner* aLayoutOwner, const TAny* aInitData, TBool aIsFsq); |
|
121 |
|
122 /** |
|
123 * destructor. |
|
124 * |
|
125 * @since S60 v3.2 |
|
126 * @return None |
|
127 */ |
|
128 virtual ~CAknFepVkbLayout(); |
|
129 |
|
130 /** |
|
131 * Get data manager. |
|
132 * |
|
133 * @since S60 v3.2 |
|
134 * @return The data manager |
|
135 */ |
|
136 CAknFepVkbDataMgr* DataMgr() const; |
|
137 |
|
138 /** |
|
139 * Get vkb window. |
|
140 * |
|
141 * @since S60 v3.2 |
|
142 * @return The vkb window |
|
143 */ |
|
144 CAknFepVkbWindow* Window() const; |
|
145 |
|
146 //from CFepUiLayout |
|
147 |
|
148 /** |
|
149 * From CFepUiLayout. |
|
150 * Handle layout command event |
|
151 * |
|
152 * @since S60 v3.2 |
|
153 * @param aCmd Command Id. |
|
154 * @param aData Data for command. |
|
155 * @return Errors when return value small than 0. |
|
156 */ |
|
157 TInt HandleCommand(TInt aCmd, TUint8* aData); |
|
158 |
|
159 /** |
|
160 * From CFepUiLayout. |
|
161 * Inform layout the size changing event |
|
162 * |
|
163 * @since S60 v3.2 |
|
164 * @param pData The event data. |
|
165 * @return KErrNone if successfully size changing. |
|
166 */ |
|
167 TInt SizeChanged(const TAny* pData); |
|
168 |
|
169 /** |
|
170 * From CFepUiLayout. |
|
171 * Handle the event from control |
|
172 * |
|
173 * @since S60 v3.2 |
|
174 * @param aEventType The event type |
|
175 * @param aCtrl The sender |
|
176 * @param aEventData The event data. |
|
177 * @return None |
|
178 */ |
|
179 void HandleControlEvent(TInt aEventType, CFepUiBaseCtrl* aCtrl, const TDesC& aEventData); |
|
180 |
|
181 /** |
|
182 * From CFepUiLayout. |
|
183 * Handle editor text coming |
|
184 * Called by animation dll when app editor text is coming. |
|
185 * If a ui layout has a editor area, it must implements this function to get the text |
|
186 * |
|
187 * @since S60 v3.2 |
|
188 * @param aTotalTextLen The total editor text len |
|
189 * @param aTextStartPos The position of the selection in whole editor text |
|
190 * @param aCursolSel The cursor selection in the editor |
|
191 * @param aText The text sent by fep. |
|
192 * @return KErrNone is operation succeeded. |
|
193 */ |
|
194 TInt OnAppEditorTextComing( const TFepInputContextFieldData& aData); |
|
195 |
|
196 /** |
|
197 * From CFepUiLayout. |
|
198 * Handle raw event key |
|
199 * |
|
200 * @since S60 v3.2 |
|
201 * @param aData the key raw event data |
|
202 * @return ETrue if the key was handled, otherwise EFalse |
|
203 */ |
|
204 TBool HandleRawKeyEventL(const TRawEvent& aKeyEvent); |
|
205 |
|
206 /** |
|
207 * From CFepUiLayout |
|
208 * Get the layout type, vkb or hwr. It's now similar to LayoutType which defines in |
|
209 * another interface. |
|
210 * |
|
211 * @since S60 v3.2 |
|
212 * @return The layout type |
|
213 */ |
|
214 TInt PenInputType(); |
|
215 |
|
216 void SetPositionFromOutside(const TPoint& aNewPos); |
|
217 |
|
218 void HandleAppInfoChange(const TDesC& aInfo, |
|
219 TPeninputAppInfo aType); |
|
220 |
|
221 //from MAknFepVkbLayoutContext |
|
222 |
|
223 |
|
224 /** |
|
225 * Send event to vkb window |
|
226 * |
|
227 * @since S60 v3.2 |
|
228 * @param aEventType The event type |
|
229 * @param aCtrl The sender |
|
230 * @param aEventData The event data. |
|
231 * @return None |
|
232 */ |
|
233 void SendEventToVkbControl(TInt aEventType, CFepUiBaseCtrl* aCtrl, |
|
234 const TDesC& aEventData = KNullDesC); |
|
235 |
|
236 /** |
|
237 * Request data from data provider |
|
238 * |
|
239 * @since S60 v3.2 |
|
240 * @param aDataType The data request |
|
241 * @return The data you request |
|
242 */ |
|
243 TInt RequestData(TAknFepDataType aDataType); |
|
244 |
|
245 /** |
|
246 * Get resource utils |
|
247 * |
|
248 * @since S60 v3.2 |
|
249 * @param aEventType Event type |
|
250 * @param aData Event data |
|
251 * @return The resource utils |
|
252 */ |
|
253 void SetData(TAknFepDataType aDataType,TInt aData); |
|
254 |
|
255 /** |
|
256 * Sendkey to fep |
|
257 * |
|
258 * @since S60 v3.2 |
|
259 * @param aEventType Event type |
|
260 * @param aEventData Event data |
|
261 * @return None. |
|
262 */ |
|
263 void Sendkey(TInt aEventType,const TDesC& aEventData = KNullDesC); |
|
264 |
|
265 /** |
|
266 * Force edit gain focus |
|
267 * |
|
268 * @since S60 v3.2 |
|
269 * @param aWhichEdit The control id which will get focus |
|
270 * @return None. |
|
271 */ |
|
272 void ForceEditGainFocus(TInt aWhichEdit); |
|
273 |
|
274 /** |
|
275 * Reset all status in layout |
|
276 * |
|
277 * @since S60 v3.2 |
|
278 * @return None. |
|
279 */ |
|
280 void Reset(); |
|
281 |
|
282 /** |
|
283 * Get the length in composition field |
|
284 * |
|
285 * @since S60 v3.2 |
|
286 * @return The string length in composition field |
|
287 */ |
|
288 TInt CompositionFieldStringLength(); |
|
289 |
|
290 /** |
|
291 * Get candidates |
|
292 * |
|
293 * @since S60 v3.2 |
|
294 * @param aInputString the input string sent to engine |
|
295 * @param aIsPredictive The flag showing predictive or not |
|
296 * @param aForNextPage Is this for next page candidate |
|
297 * @return The canidates count |
|
298 */ |
|
299 TInt GetCandidatesL(const TDesC& aInputString, |
|
300 const TBool aIsPredictive, |
|
301 TBool aForNextPage = EFalse); |
|
302 |
|
303 /** |
|
304 * Clear trigger string |
|
305 * |
|
306 * @since S60 v3.2 |
|
307 * @return None |
|
308 */ |
|
309 void ClearTriggerString(); |
|
310 |
|
311 /** |
|
312 * Set current range |
|
313 * |
|
314 * @since S60 v3.2 |
|
315 * @param aRange The range need to set |
|
316 * @param aNeedSave The flag need to save or not |
|
317 * @return None. |
|
318 */ |
|
319 void SetCurrentRange(TInt aRange, TBool aNeedSave = EFalse, TBool aNotify = EFalse); |
|
320 |
|
321 /** |
|
322 * SemiTransparencyRequired. Tell whether this layout require transparency. |
|
323 * This is to save memory used in mask bitmap. If transparency not deeded, |
|
324 * We use black-white bitmap. |
|
325 * |
|
326 * @since S60 v3.2 |
|
327 * @return ETrue if layout require transparency, otherwise EFalse. |
|
328 */ |
|
329 TBool SemiTransparencyRequired(); |
|
330 private: |
|
331 |
|
332 /** |
|
333 * C++ default constructor |
|
334 * |
|
335 * @since S60 v3.2 |
|
336 * @return None |
|
337 */ |
|
338 CAknFepVkbLayout(MLayoutOwner* aLayoutOwner); |
|
339 |
|
340 /** |
|
341 * Symbian second-phase constructor |
|
342 * |
|
343 * @since S60 v3.2 |
|
344 * @param aInitData Init data of layout |
|
345 * @return None |
|
346 */ |
|
347 void ConstructL(const TAny* aInitData, TBool aIsFsq); |
|
348 |
|
349 /** |
|
350 * Change input language |
|
351 * |
|
352 * @since S60 v3.2 |
|
353 * @param aLangID The language id you want to change to |
|
354 * @return None |
|
355 */ |
|
356 void ChangeInputLanguage(TInt aLangID); |
|
357 |
|
358 /** |
|
359 * do when case change |
|
360 * |
|
361 * @since S60 v3.2 |
|
362 * @return None. |
|
363 */ |
|
364 void DoCaseChange(TInt aCase); |
|
365 |
|
366 /** |
|
367 * Handle focus gained event |
|
368 * |
|
369 * @since S60 v3.2 |
|
370 * @param aCtrl The sender |
|
371 * @param aEventData The event data. |
|
372 * @return None |
|
373 */ |
|
374 void HandleFocusGained(CFepUiBaseCtrl* aCtrl, const TDesC& aEventData); |
|
375 |
|
376 /** |
|
377 * From CFepUiLayout. |
|
378 * Test whether the position is valid. |
|
379 * This is used to test the target position when draging controls to some place |
|
380 * |
|
381 * @since S60 v4.0 |
|
382 * @param aRect The rect to be checked. |
|
383 * @param aDragbar The dragbar being dragged |
|
384 * @param aVInfo The valid information in vertial dirtection. ETrue is vertical |
|
385 * moving is valid.It's only used when aRect is not valid but moving in |
|
386 * vertical direction is valid. |
|
387 * @param aHInfo The valid information in horizontal dirtection. ETrue is |
|
388 * horizontal moving is valid.It's only used when aRect is not |
|
389 * valid but moving in vertical direction is valid. |
|
390 * @param aFlag ETrue if whole layout is moving, otherwise, only components moving |
|
391 * @return ETue if aRect is a valid position. Otherwise, EFalse. |
|
392 */ |
|
393 TBool IsValidDestination(const TRect& aRect, |
|
394 CDragBar* aDragBar, |
|
395 TBool& aVInfo,TBool& aHInfo, |
|
396 TBool aFlag); |
|
397 |
|
398 void HandleMergedBtnClicked( TInt aCase ); |
|
399 |
|
400 /** |
|
401 * Handle show tooltip command |
|
402 * |
|
403 * @since S60 v5.0 |
|
404 * @param aData pointer is sent from FEP, point to a TPtrC |
|
405 * @return None |
|
406 */ |
|
407 void HandleShowTooltipOnFSQCmdL( TUint8* aData ); |
|
408 |
|
409 /** |
|
410 * Handle show candidate list command |
|
411 * |
|
412 * @since S60 v5.0 |
|
413 * @param aData pointer is sent from FEP, point to a TPtrC |
|
414 * @return None |
|
415 */ |
|
416 void HandleShowCandidateListOnFSQCmdL( TUint8* aData ); |
|
417 |
|
418 /** |
|
419 * Read text stored in a block of memory into HBufC |
|
420 * |
|
421 * @since S60 v5.0 |
|
422 * @param aData aStartPtr the starting address of a block of memory with a |
|
423 * string in it |
|
424 * @param aLength The length of the string |
|
425 * @return pointer of a HBufC storing the string in it |
|
426 */ |
|
427 HBufC* ReadTextInfoHBufCL( const TUint16* aStartPtr, TInt aLength ); |
|
428 private: //data |
|
429 |
|
430 TInt iLayoutType; |
|
431 /** |
|
432 * The data manager |
|
433 * Own |
|
434 */ |
|
435 CAknFepVkbDataMgr* iDataMgr; |
|
436 |
|
437 /** |
|
438 * The ui state manager |
|
439 * Own |
|
440 */ |
|
441 CAknFepVkbUiStateMgr* iUiStateMgr; |
|
442 |
|
443 /** |
|
444 * The vkb window |
|
445 * Own |
|
446 */ |
|
447 CAknFepVkbWindow* iVkbWindow; |
|
448 |
|
449 /** |
|
450 * The flag showing need to deal focus gained or not |
|
451 * Own |
|
452 */ |
|
453 TBool iNeedDealFocusGained; |
|
454 |
|
455 /** |
|
456 * The vkb resource id |
|
457 */ |
|
458 TInt iResId; |
|
459 |
|
460 /** |
|
461 * The ptiengine |
|
462 * Not own |
|
463 */ |
|
464 CPtiEngine* iPtiEngine; |
|
465 |
|
466 /* |
|
467 * Indicate if ITI is enabled. |
|
468 */ |
|
469 TBool iITIEnabled; |
|
470 }; |
|
471 |
|
472 #endif // C_CAKNFEPVKBLAYOUT_H |
|
473 |
|
474 //End Of File |