|
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: peninput japanese hwr window layout class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PENINPUTHWRBOXWINDOW_H |
|
20 #define C_PENINPUTHWRBOXWINDOW_H |
|
21 |
|
22 // System includes |
|
23 #include <peninputlayoutwindowjp.h> |
|
24 |
|
25 // Forward declarations |
|
26 class CFepUiBaseCtrl; |
|
27 class CAknFepCtrlEventButton; |
|
28 class CFepCtrlDropdownList; |
|
29 class CPeninputHwrBoxGroup; |
|
30 |
|
31 // Constants |
|
32 |
|
33 /** |
|
34 * Hwr layout window class |
|
35 * This class define methods to deal with window layout and |
|
36 * handle events sent to this window |
|
37 * |
|
38 * @lib peninputhwrboxjp.lib |
|
39 * @since S60 v3.2 |
|
40 */ |
|
41 class CPeninputHwrBoxWindow : public CPeninputLayoutWindowJp |
|
42 { |
|
43 |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Two-phased constructor |
|
48 * |
|
49 * @since S60 v3.2 |
|
50 * @param aUiLayout The plugin ui layout |
|
51 * @param aLayoutContext The hwr layout context |
|
52 * @return The pointer to CPeninputHwrBoxWindow object |
|
53 */ |
|
54 static CPeninputHwrBoxWindow* NewL( CFepUiLayout* aUiLayout, |
|
55 MPeninputLayoutContext* aLayoutContext ); |
|
56 |
|
57 /** |
|
58 * Destructor |
|
59 * |
|
60 * @since S60 v3.2 |
|
61 * @return None |
|
62 */ |
|
63 virtual ~CPeninputHwrBoxWindow(); |
|
64 |
|
65 // From base class CPeninputLayoutWindow |
|
66 |
|
67 /** |
|
68 * From CPeninputLayoutWindow |
|
69 * Handle control event |
|
70 * |
|
71 * @since S60 v3.2 |
|
72 * @param aEventType The event type |
|
73 * @param aCtrl The control who sends the event |
|
74 * @param aEventData The event data |
|
75 * @return None |
|
76 */ |
|
77 void HandleControlEvent( TInt aEventType, |
|
78 CFepUiBaseCtrl* aCtrl, |
|
79 const TDesC& aEventData ); |
|
80 |
|
81 /** |
|
82 * Handle pointer down event |
|
83 * |
|
84 * @since S60 V4.0 |
|
85 * @param aPoint The point position relative the layout |
|
86 * @return The control which handles the event. |
|
87 */ |
|
88 virtual CFepUiBaseCtrl* HandlePointerDownEventL(const TPoint& aPoint); |
|
89 |
|
90 /** |
|
91 * From CPeninputLayoutWindow |
|
92 * Get id of window config resource |
|
93 * |
|
94 * @since S60 v3.2 |
|
95 * @return The id of window config resource |
|
96 */ |
|
97 TInt GetWindowConfigResId(); |
|
98 |
|
99 /** |
|
100 * From CPeninputLayoutWindow |
|
101 * Get id of window resource |
|
102 * |
|
103 * @since S60 v3.2 |
|
104 * @return The id of window resource |
|
105 */ |
|
106 TInt GetWindowResId(); |
|
107 |
|
108 /** |
|
109 * From CPeninputLayoutWindow |
|
110 * Get file name of window config resource |
|
111 * |
|
112 * @since S60 v3.2 |
|
113 * @param aLangID The id of language |
|
114 * @return The file name of window config resource |
|
115 */ |
|
116 const TDesC& GetWindowConfigResFileName( TInt aLangID ); |
|
117 |
|
118 /** |
|
119 * From CPeninputLayoutWindow |
|
120 * Get file name of window resource |
|
121 * |
|
122 * @since S60 v3.2 |
|
123 * @return The file name of window resource |
|
124 */ |
|
125 const TDesC& GetWindowResFileName(); |
|
126 |
|
127 /** |
|
128 * From CPeninputLayoutWindow |
|
129 * Change unit size |
|
130 * |
|
131 * @since S60 v3.2 |
|
132 * @return The window rect |
|
133 */ |
|
134 const TRect ChangeUnitSize(); |
|
135 |
|
136 /** |
|
137 * From CPeninputLayoutWindow |
|
138 * Change size of client area |
|
139 * |
|
140 * @since S60 v3.2 |
|
141 * @param aLeftTopPoint The left top point of client area |
|
142 * @return None |
|
143 */ |
|
144 virtual void ChangeClientSize(); |
|
145 |
|
146 /** |
|
147 * From CPeninputLayoutWindow |
|
148 * Construct all controls specified in resource |
|
149 * |
|
150 * @since S60 v3.2 |
|
151 * @return None |
|
152 */ |
|
153 virtual void CreateAllControlsL(); |
|
154 |
|
155 /** |
|
156 * Set control fonts. Fonts info comes from resource |
|
157 * |
|
158 * @since S60 v3.2 |
|
159 * @return None |
|
160 */ |
|
161 void SetControlsFont(); |
|
162 |
|
163 /** |
|
164 * From CPeninputLayoutWindow |
|
165 * Pop up choice list |
|
166 * |
|
167 * @since S60 v3.2 |
|
168 * @return None |
|
169 */ |
|
170 void PopupChoiceList(); |
|
171 |
|
172 /** |
|
173 * From CPeninputLayoutWindow |
|
174 * Re-organize all controls in the assigned client area layout |
|
175 * |
|
176 * @since S60 v3.2 |
|
177 * @param aClientLayoutId The id of client area layout |
|
178 * @return None |
|
179 */ |
|
180 void ReorganizeControls( TInt aClientLayoutId, TBool aNeedReset ); |
|
181 |
|
182 /** |
|
183 * From CPeninputLayoutWindowJp |
|
184 * Get id of prediction pane scroll up button resource |
|
185 * |
|
186 * @since S60 v3.2 |
|
187 * @return The id of prediction pane scroll up button resource |
|
188 */ |
|
189 TInt GetScrollUpBtnResId(); |
|
190 |
|
191 /** |
|
192 * From CPeninputLayoutWindowJp |
|
193 * Get id of prediction pane scroll down button resource |
|
194 * |
|
195 * @since S60 v3.2 |
|
196 * @return The id of prediction pane scroll down button resource |
|
197 */ |
|
198 TInt GetScrollDownBtnResId(); |
|
199 |
|
200 /** |
|
201 * Do when case changed |
|
202 * |
|
203 * @since S60 v3.2 |
|
204 * @param aNewCase The new case |
|
205 * @return None |
|
206 */ |
|
207 void DoCaseChange( TInt aNewCase ); |
|
208 |
|
209 /** |
|
210 * Highlight the dropdown list cell |
|
211 * |
|
212 * @since S60 v3.2 |
|
213 * @param aIndex The cell index |
|
214 * @return None |
|
215 */ |
|
216 void HighlightCell(TInt aIndex); |
|
217 |
|
218 /** |
|
219 * DropdownListDraw |
|
220 * |
|
221 * @since S60 v3.2 |
|
222 * @return None |
|
223 */ |
|
224 void DropdownListDraw(); |
|
225 |
|
226 /** |
|
227 * Cancel wrting |
|
228 * |
|
229 * @since S60 v3.2 |
|
230 * @return None |
|
231 */ |
|
232 void CancelWriting(); |
|
233 |
|
234 /** |
|
235 * Cancel repeat |
|
236 * |
|
237 * @since S60 v3.2 |
|
238 * @param aFlag The dim flag |
|
239 * @return None |
|
240 */ |
|
241 void DimInputContextField(TBool aFlag); |
|
242 |
|
243 /** |
|
244 * Dim hwrbox |
|
245 * |
|
246 * @since S60 V4.0 |
|
247 * @param aFlag The dim status |
|
248 */ |
|
249 void SetDimmed(TBool aDimFlag); |
|
250 |
|
251 /** |
|
252 * hwrbox control |
|
253 * |
|
254 * @since S60 V4.0 |
|
255 */ |
|
256 CPeninputHwrBoxGroup* BoxGroup(); |
|
257 |
|
258 /** |
|
259 * ConstructFromResourceL load settings from resource. |
|
260 * Before calling this function, the resource id should be set |
|
261 * |
|
262 * @since S60 v3.2 |
|
263 * @return None |
|
264 */ |
|
265 void ConstructFromResourceL(); |
|
266 |
|
267 /** |
|
268 * Set if enable option button |
|
269 * |
|
270 * @since S60 v3.2 |
|
271 * @param aEnable The enable flag |
|
272 * @return None |
|
273 */ |
|
274 void SetEnableSettingBtnJp(TBool aEnable); |
|
275 |
|
276 protected: |
|
277 |
|
278 /** |
|
279 * Constructor |
|
280 * |
|
281 * @since S60 v3.2 |
|
282 * @param aUiLayout The plugin ui layout |
|
283 * @param aLayoutContext The hwr layout context |
|
284 * @return None |
|
285 */ |
|
286 CPeninputHwrBoxWindow( CFepUiLayout* aUiLayout, |
|
287 MPeninputLayoutContext* aLayoutContext ); |
|
288 |
|
289 private: |
|
290 |
|
291 /** |
|
292 * Add button to client area |
|
293 * |
|
294 * @since S60 v3.2 |
|
295 * @param aControlId The control id |
|
296 * @param aEventId The control's event id |
|
297 * @param aResId The control's resource id |
|
298 * @param aUnicode The control's unicode |
|
299 * @param aIsRepeat The TBool indicating whether the |
|
300 * control is repeated or not |
|
301 * @return The pointer to CAknFepCtrlEventButton object |
|
302 */ |
|
303 CAknFepCtrlEventButton* AddButtonL( const TInt aControlId, |
|
304 const TInt aEventId, |
|
305 const TInt aResId, |
|
306 const TInt aUnicode = 0, |
|
307 const TBool aIsRepeat = EFalse ); |
|
308 |
|
309 /** |
|
310 * Add hwr box to client area |
|
311 * |
|
312 * @since S60 v3.2 |
|
313 * @return None |
|
314 */ |
|
315 void AddBoxGroupL(); |
|
316 |
|
317 /** |
|
318 * Set frame color of hwr write box |
|
319 * |
|
320 * @since S60 v3.2 |
|
321 * @return None |
|
322 */ |
|
323 void SetHwBoxFrameBackColor(); |
|
324 |
|
325 /** |
|
326 * Add dropdown list to window |
|
327 * |
|
328 * @since S60 v3.2 |
|
329 * @return None |
|
330 */ |
|
331 void AddDropdownListL(); |
|
332 |
|
333 /** |
|
334 * SetWholeWindowRect |
|
335 * |
|
336 * @since Series 60 3.2 |
|
337 * @param aRect The rect of clientpane |
|
338 * @return None |
|
339 */ |
|
340 void SetWholeWindowRect(const TRect& aRect); |
|
341 |
|
342 /** |
|
343 * Add context field into the window |
|
344 * |
|
345 * @since S60 v3.2 |
|
346 * @return None |
|
347 */ |
|
348 void AddContextFieldJpL(); |
|
349 |
|
350 private: |
|
351 |
|
352 /** |
|
353 * The drop down list control |
|
354 * Not own |
|
355 */ |
|
356 CFepCtrlDropdownList* iDropdownList; |
|
357 |
|
358 /** |
|
359 * The handwriting box |
|
360 * Not own |
|
361 */ |
|
362 CPeninputHwrBoxGroup* iBoxGroup; |
|
363 |
|
364 /** |
|
365 * The character range switch button |
|
366 * Not own |
|
367 */ |
|
368 CAknFepCtrlEventButton* iCharacterRangeSwitchBtn; |
|
369 |
|
370 /** |
|
371 * The convert button |
|
372 * Not own |
|
373 */ |
|
374 CAknFepCtrlEventButton* iConvertBtn; |
|
375 |
|
376 TBool iDisableCaseChange; |
|
377 TInt iCachedCase; |
|
378 }; |
|
379 |
|
380 #endif // C_PENINPUTHWRBOXWINDOW_H |