|
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: gspeninputimple dialog header file. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_GSSETTINGDIALOG_H |
|
20 #define C_GSSETTINGDIALOG_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <aknsettingitemlist.h> |
|
24 #include <AknDialog.h> |
|
25 |
|
26 #include "gscenrepnotifyhandlercallback.h" |
|
27 |
|
28 // FORWARD CLASS DECLARATION |
|
29 class CGSPenInputImple; |
|
30 class CGSSettingItemList; |
|
31 class CAknNullService; |
|
32 |
|
33 // CONSTANTS |
|
34 const TInt KItemTextSize = 50; |
|
35 |
|
36 /** |
|
37 * CGSColorSettingItem item class |
|
38 * |
|
39 * This class is trail colour item class. It offers trail colour item in setting |
|
40 * list.Form this class, user can define item behavior and interface by themselves. |
|
41 * |
|
42 * @lib gspeninputplugin.dll |
|
43 * @since S60 v3.2 |
|
44 */ |
|
45 class CGSColorSettingItem : public CAknSettingItem |
|
46 { |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Symbian constructor |
|
52 * |
|
53 * @since S60 v3.2 |
|
54 * @param aIdentifier Resource id |
|
55 * @param aImpl CGSPenInputImple instance |
|
56 * @return None |
|
57 */ |
|
58 CGSColorSettingItem(const TInt aIdentifier, CGSPenInputImple* aImpl); |
|
59 |
|
60 /** |
|
61 * Destructor |
|
62 * |
|
63 * @since S60 v3.2 |
|
64 * @return None |
|
65 */ |
|
66 virtual ~CGSColorSettingItem(); |
|
67 |
|
68 /** |
|
69 * Create a mask for item mask |
|
70 * |
|
71 * @since S60 v3.2 |
|
72 * @return None |
|
73 */ |
|
74 void CreateMaskL(); |
|
75 |
|
76 // From CAknSettingItem |
|
77 |
|
78 /** |
|
79 * From CAknSettingItem |
|
80 * This launches the setting page |
|
81 * |
|
82 * @since S60 v3.2 |
|
83 * @param aCalledFromMenu Ignored in this class |
|
84 * @return None |
|
85 */ |
|
86 void EditItemL(TBool aCalledFromMenu); |
|
87 |
|
88 /** |
|
89 * From CAknSettingItem |
|
90 * This method obtains the current value's setting text |
|
91 * |
|
92 * @since S60 v3.2 |
|
93 * @return Reference to descriptor with the text |
|
94 */ |
|
95 virtual const TDesC& SettingTextL(); |
|
96 |
|
97 protected: |
|
98 |
|
99 // From CAknSettingItem |
|
100 |
|
101 /** |
|
102 * From CAknSettingItem |
|
103 * Method to obtain a new bitmap for the setting content |
|
104 * |
|
105 * @since S60 v3.2 |
|
106 * @return Pointer to create CFbsBitmap object |
|
107 */ |
|
108 CFbsBitmap* CreateBitmapL(); |
|
109 |
|
110 private: |
|
111 |
|
112 /** |
|
113 * The pen input implementation (Not own) |
|
114 */ |
|
115 CGSPenInputImple* iImple; |
|
116 |
|
117 }; |
|
118 |
|
119 /** |
|
120 * CGSTextSettingItem item class |
|
121 * |
|
122 * This class is for text item class. It offers input lauguage, writing speed, |
|
123 * trail width items in setting list.Form this class, user can |
|
124 * define item behavior and interface by themselves. |
|
125 * |
|
126 * @lib gspeninputplugin.dll |
|
127 * @since S60 v3.2 |
|
128 */ |
|
129 class CGSTextSettingItem : public CAknTextSettingItem |
|
130 { |
|
131 |
|
132 public: |
|
133 |
|
134 /** |
|
135 * Symbian constructor |
|
136 * |
|
137 * @since S60 v3.2 |
|
138 * @param aItemResourceId Resource id |
|
139 * @param aText Text display in item |
|
140 * @param aImple CGSPenInputImple instance |
|
141 * @return None |
|
142 */ |
|
143 CGSTextSettingItem(TInt aItemResourceId, |
|
144 TDes &aText, |
|
145 CGSPenInputImple* aImple, |
|
146 CGSSettingItemList* aParent); |
|
147 |
|
148 /** |
|
149 * Destructor |
|
150 * |
|
151 * @since S60 v3.2 |
|
152 * @return None |
|
153 */ |
|
154 virtual ~CGSTextSettingItem(); |
|
155 |
|
156 // From CAknTextSettingItem |
|
157 |
|
158 /** |
|
159 * From CAknTextSettingItem |
|
160 * This method obtains the current value's setting text |
|
161 * |
|
162 * @since S60 v3.2 |
|
163 * @return Reference to descriptor with the text |
|
164 */ |
|
165 const TDesC& SettingTextL(); |
|
166 |
|
167 /** |
|
168 * From CAknTextSettingItem |
|
169 * This launches the setting page |
|
170 * |
|
171 * @since S60 v3.2 |
|
172 * @param aCalledFromMenu Ignored in this class |
|
173 * @return None |
|
174 */ |
|
175 void EditItemL(TBool aCalledFromMenu); |
|
176 |
|
177 private: |
|
178 |
|
179 /** |
|
180 * The pen input implementation (Not own) |
|
181 */ |
|
182 CGSPenInputImple* iImple; |
|
183 |
|
184 /** |
|
185 * Item resource id |
|
186 */ |
|
187 TInt iItemId; |
|
188 |
|
189 /** |
|
190 * Input language item text |
|
191 */ |
|
192 TBuf<KItemTextSize> iInputLanguage; |
|
193 |
|
194 /** |
|
195 * Writing speed item text |
|
196 */ |
|
197 TBuf<KItemTextSize> iWritingSpeed; |
|
198 |
|
199 /** |
|
200 * Guide Line item text |
|
201 */ |
|
202 TBuf<KItemTextSize> iGuideLine; |
|
203 /** |
|
204 * Guide Line item text |
|
205 */ |
|
206 TBuf<KItemTextSize> iRecognitionWithDictionary; |
|
207 |
|
208 |
|
209 /** |
|
210 * Trail Width item text |
|
211 */ |
|
212 TBuf<KItemTextSize> iTrailWidth; |
|
213 |
|
214 /** |
|
215 * Input method for find item text |
|
216 */ |
|
217 TBuf<KItemTextSize> iInputMethodForFind; |
|
218 |
|
219 /** |
|
220 * Chinese Input Find Method for find item text |
|
221 */ |
|
222 RBuf iInputChineseFindMethod; |
|
223 //TBuf<KItemTextSize> iInputChineseFindMethod; |
|
224 |
|
225 /** |
|
226 * Input Mode item text |
|
227 */ |
|
228 TBuf<KItemTextSize> iInputMode; |
|
229 |
|
230 /** |
|
231 * Input Mode item text (Not own) |
|
232 */ |
|
233 CGSSettingItemList* iSettingList; |
|
234 |
|
235 }; |
|
236 |
|
237 /** |
|
238 * CGSSettingItemList list class |
|
239 * |
|
240 * This class is for list box class. It offers list box, which contains input language, |
|
241 * writing speed, trail width, and trail colour items in setting list.Form |
|
242 * CreateSettingItemL function user can create custom item which from above |
|
243 * CGSTextSettingItem and CGSColorSettingItem. |
|
244 * |
|
245 * @lib gspeninputplugin.dll |
|
246 * @since S60 v3.2 |
|
247 */ |
|
248 class CGSSettingItemList : public CAknSettingItemList |
|
249 { |
|
250 |
|
251 public: |
|
252 |
|
253 /** |
|
254 * Symbian constructor |
|
255 * |
|
256 * @since S60 v3.2 |
|
257 * @param aImple CGSPenInputImple instance |
|
258 * @return None |
|
259 */ |
|
260 CGSSettingItemList(CGSPenInputImple* aImple); |
|
261 |
|
262 /** |
|
263 * Destructor |
|
264 * |
|
265 * @since S60 v3.2 |
|
266 * @return None |
|
267 */ |
|
268 virtual ~CGSSettingItemList(); |
|
269 |
|
270 /** |
|
271 * Reset Setting List |
|
272 * |
|
273 * @since S60 v3.2 |
|
274 * @return None |
|
275 */ |
|
276 void ResetSettingListL(); |
|
277 |
|
278 /** |
|
279 * From MEikListBoxObserver. |
|
280 * Handles the commands coming from the listbox |
|
281 * @param aListBox List box that initiated the event |
|
282 * @param aEventType Type of the event |
|
283 */ |
|
284 void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); |
|
285 |
|
286 protected: |
|
287 |
|
288 // From CAknSettingItemList |
|
289 |
|
290 /** |
|
291 * From CAknTextSettingItem |
|
292 * Framework method to create a setting item based upon the user id aSettingId |
|
293 * |
|
294 * @since S60 v3.2 |
|
295 * @param identifier ID to use to determine the type of the setting item |
|
296 * @return A constructed (not 2nd-stage constructed) setting item |
|
297 */ |
|
298 CAknSettingItem* CreateSettingItemL(TInt identifier); |
|
299 |
|
300 private: |
|
301 |
|
302 /** |
|
303 * The pen input implementation (Not own) |
|
304 */ |
|
305 CGSPenInputImple* iImple; |
|
306 |
|
307 /** |
|
308 * Input language item text |
|
309 */ |
|
310 TBuf<KItemTextSize> iInputLanguage; |
|
311 |
|
312 /** |
|
313 * Writing speed item text |
|
314 */ |
|
315 TBuf<KItemTextSize> iWritingSpeed; |
|
316 |
|
317 /** |
|
318 * Guide Line item text |
|
319 */ |
|
320 TBuf<KItemTextSize> iGuideLine; |
|
321 /** |
|
322 * Guide Line item text |
|
323 */ |
|
324 TBuf<KItemTextSize> iRecognitionWithDictionary; |
|
325 |
|
326 /** |
|
327 * Trail Width item text |
|
328 */ |
|
329 TBuf<KItemTextSize> iTrailWidth; |
|
330 |
|
331 /** |
|
332 * Input method for find item text |
|
333 */ |
|
334 TBuf<KItemTextSize> iInputMethodForFind; |
|
335 |
|
336 /** |
|
337 * Chinese Input Find Method for find item text |
|
338 */ |
|
339 RBuf iInputChineseFindMethod; |
|
340 //TBuf<KItemTextSize> iInputChineseFindMethod; |
|
341 |
|
342 /** |
|
343 * Input Mode item text |
|
344 */ |
|
345 TBuf<KItemTextSize> iInputMode; |
|
346 |
|
347 /** |
|
348 * Current language is chinese |
|
349 */ |
|
350 TBool iChinese; |
|
351 |
|
352 /** |
|
353 * Current language is Japanese |
|
354 */ |
|
355 TBool iJapanese; |
|
356 |
|
357 }; |
|
358 |
|
359 /** |
|
360 * CGSSettingDialog dialog class |
|
361 * |
|
362 * This class is for dialog class containing above list box. It offers dialog, |
|
363 * which contains a list box with input language, writing speed, trail width, |
|
364 * and trail colour items in setting list. |
|
365 * |
|
366 * @lib gspeninputplugin.dll |
|
367 * @since S60 v3.2 |
|
368 */ |
|
369 class CGSSettingDialog : public CAknDialog, |
|
370 public MGsCenRepNotifyHandlerCallback |
|
371 { |
|
372 |
|
373 public: |
|
374 |
|
375 /** |
|
376 * Symbian constructor |
|
377 * |
|
378 * @since S60 v3.2 |
|
379 * @param aImple CGSPenInputImple instance |
|
380 * @return None |
|
381 */ |
|
382 CGSSettingDialog(CGSPenInputImple* aImple); |
|
383 |
|
384 /** |
|
385 * Destructor |
|
386 * |
|
387 * @since S60 v3.2 |
|
388 * @return None |
|
389 */ |
|
390 virtual ~CGSSettingDialog(); |
|
391 |
|
392 // From MEikDialogPageObserver via CEikDialog |
|
393 |
|
394 /** |
|
395 * From MEikDialogPageObserver |
|
396 * Framework method to create a control based upon control type |
|
397 * |
|
398 * @since S60 v3.2 |
|
399 * @param aControlType Control resource id |
|
400 * @return Custom control info |
|
401 */ |
|
402 virtual SEikControlInfo CreateCustomControlL(TInt aControlType); |
|
403 |
|
404 // From MGsCenRepNotifyHandlerCallback |
|
405 |
|
406 /** |
|
407 * From MGsCenRepNotifyHandlerCallback |
|
408 * This callback method is used to notify the client about |
|
409 * key changing |
|
410 * |
|
411 * @since S60 v3.2 |
|
412 * @param aId Key id |
|
413 * @param aNewValue New value |
|
414 * @return None |
|
415 */ |
|
416 void HandleNotifyInt(TUint32 aId, TInt aNewValue); |
|
417 |
|
418 /** |
|
419 * This callback method is used to notify the client about |
|
420 * key changing |
|
421 * |
|
422 * @param aId Key id |
|
423 * @param aNewValue New value |
|
424 * @param aRepositoryUid The repository uid for each key |
|
425 * @return None |
|
426 */ |
|
427 void HandleNotifyInt(TUid aRepositoryUid, TUint32 aId, TInt aNewValue); |
|
428 |
|
429 // From MEikMenuObserver |
|
430 |
|
431 /** |
|
432 * From MEikMenuObserver |
|
433 * |
|
434 * @since S60 v3.2 |
|
435 * @param aResourceId resource id |
|
436 * @param aMenuPane |
|
437 * @return None |
|
438 */ |
|
439 virtual void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane); |
|
440 |
|
441 protected: |
|
442 |
|
443 // From CAknDialog |
|
444 |
|
445 /** |
|
446 * From CAknDialog |
|
447 * Handles a dialog button press for the specified button. |
|
448 * |
|
449 * This function is invoked when the user presses a button in the |
|
450 * button panel. It is not called if the Cancel button is activated |
|
451 * unless the @c EEikDialogFlagNotifyEsc flag has been set. |
|
452 * |
|
453 * If there is an Options key then pops up menu, otherwise exits. |
|
454 * |
|
455 * @param aButtonId The ID of the button that was activated. |
|
456 * @return @c ETrue to validate and exit the dialog, |
|
457 * @c EFalse to keep the dialog active. If @c ETrue, the |
|
458 * dialog will be destroyed automatically by @c ExecuteLD(). |
|
459 * The default implementation returns @c ETrue no matter which |
|
460 * button is pressed. |
|
461 */ |
|
462 virtual TBool OkToExitL( TInt aButtonId ); |
|
463 |
|
464 private: |
|
465 |
|
466 /** |
|
467 * Show setting page when user select item in listbox |
|
468 * |
|
469 * @since S60 v3.2 |
|
470 * @return None |
|
471 */ |
|
472 void ShowSettingPageL(); |
|
473 |
|
474 /** |
|
475 * From MEikCommandObserver |
|
476 * Process menu selection event |
|
477 * |
|
478 * @since S60 v3.2 |
|
479 * @param aCommandId command. |
|
480 * @return None |
|
481 */ |
|
482 void ProcessCommandL(TInt aCommandId); |
|
483 |
|
484 /** |
|
485 * Handle notifier from KCRUidPersonalizationSettings in CRepository |
|
486 * |
|
487 * @param aId Key id |
|
488 * @param aNewValue New value |
|
489 */ |
|
490 void HandleNotifyIntFromPersonalizationL( TUint32 aId, TInt aNewValue ); |
|
491 |
|
492 /** |
|
493 * Handle notifier from KCRUidAknFep in CRepository |
|
494 * |
|
495 * @param aId Key id |
|
496 * @param aNewValue New value |
|
497 */ |
|
498 void HandleNotifyIntFromAknFepL( TUint32 aId, TInt aNewValue ); |
|
499 |
|
500 /** |
|
501 * Handle notifier from KCRUidAvkon in CRepository |
|
502 * |
|
503 * @param aId Key id |
|
504 * @param aNewValue New value |
|
505 */ |
|
506 void HandleNotifyIntFromAvkonL( TUint32 aId, TInt aNewValue ); |
|
507 |
|
508 /** |
|
509 * Launch other application |
|
510 * |
|
511 * @aAppUid: The application's uid |
|
512 */ |
|
513 void LaunchAppL( TUid aAppUid ); |
|
514 |
|
515 private: |
|
516 |
|
517 /** |
|
518 * The pen input implementation (Not own) |
|
519 */ |
|
520 CGSPenInputImple* iImple; |
|
521 |
|
522 /** |
|
523 * The setting list (Not own) |
|
524 */ |
|
525 CGSSettingItemList* iSettingList; |
|
526 |
|
527 /** |
|
528 * Launch application; |
|
529 */ |
|
530 CAknNullService* iNullService; |
|
531 }; |
|
532 |
|
533 #endif // C_GSSETTINGDIALOG_H |
|
534 |
|
535 // End Of File |