|
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: |
|
15 * |
|
16 */ |
|
17 /* |
|
18 * ============================================================================ |
|
19 * Name : CGSPredictiveSettingList from SettingExampleSettingList.h |
|
20 * ============================================================================ |
|
21 */ |
|
22 |
|
23 #ifndef __DUALLANGUAGE_LIST_H |
|
24 #define __DUALLANGUAGE_LIST_H |
|
25 |
|
26 |
|
27 #include <coecntrl.h> |
|
28 #include <aknsettingitemlist.h> |
|
29 #include <akncheckboxsettingpage.h> |
|
30 #include "GSLangModel.h" |
|
31 #include "DualLanguageData.h" |
|
32 |
|
33 class CGSDualLanguageDialog; |
|
34 |
|
35 class CGSLanguageSettingItem : public CAknEnumeratedTextPopupSettingItem |
|
36 { |
|
37 public: |
|
38 CGSLanguageSettingItem( TInt aResourceId, TBool aPrimary, CGSDualLanguageData* aData ); |
|
39 virtual ~CGSLanguageSettingItem(); |
|
40 protected: |
|
41 virtual void CompleteConstructionL(); |
|
42 private: |
|
43 CGSDualLanguageData* iData; |
|
44 TBool iPrimary; |
|
45 }; |
|
46 |
|
47 /** |
|
48 * Class: CGSDualLanguageList |
|
49 * |
|
50 * Discussion: A specialised subclass of CAknSettingItemList. This class is |
|
51 * the control used to both display the current values of the |
|
52 * settings and to launch the relevant editor for those items. |
|
53 * |
|
54 */ |
|
55 class CGSDualLanguageList : public CAknSettingItemList |
|
56 { |
|
57 public: |
|
58 /** |
|
59 * Function: NewL |
|
60 * |
|
61 * Discussion: Factory function used to create a new instance of |
|
62 * CGSPredictiveSettingList |
|
63 * |
|
64 * Params: aData - reference to the data to be displayed and edited. |
|
65 * |
|
66 * Returns: A newly created instance of CGSPredictiveSettingList |
|
67 */ |
|
68 static CGSDualLanguageList* NewL(CGSDualLanguageData* aData, CGSDualLanguageDialog* aDialog); |
|
69 |
|
70 /** |
|
71 * Function: NewLC |
|
72 * |
|
73 * Discussion: Factory function used to create a new instance of |
|
74 * CGSPredictiveSettingList and leave a pointer to it on the |
|
75 * cleanup stack. |
|
76 * |
|
77 * Params: aData - reference to the data to be displayed and edited. |
|
78 * |
|
79 * Returns: A newly created instance of CGSPredictiveSettingList |
|
80 */ |
|
81 static CGSDualLanguageList* NewLC(CGSDualLanguageData* aData, CGSDualLanguageDialog* aDialog); |
|
82 |
|
83 /** |
|
84 * Function: ~CGSPredictiveSettingList |
|
85 * |
|
86 * Discussion: Virtual destructor for CGSPredictiveSettingList. Ensures that |
|
87 * all allocated memory is returned to the heap before |
|
88 * deletion of object. |
|
89 * |
|
90 */ |
|
91 virtual ~CGSDualLanguageList(); |
|
92 |
|
93 |
|
94 /** |
|
95 * Function: SizeChanged |
|
96 * |
|
97 * Discussion: Inherited from CCoeControl. Calculates size based on |
|
98 * contained control required sizes. |
|
99 * |
|
100 */ |
|
101 void SizeChanged(); |
|
102 |
|
103 /** |
|
104 * Function: EditCurrentItemL |
|
105 * Params: aCalledFromMenu - ETrue if called from menu, EFalse otherwise. |
|
106 * |
|
107 * |
|
108 * Discussion: Starts the setting page for the currently selected item |
|
109 * in the list. |
|
110 */ |
|
111 void EditCurrentItemL(TBool aCalledFromMenu); |
|
112 |
|
113 // Toggle whether secondary input item is visible |
|
114 void HideSecondaryInputL(TBool aHidden); |
|
115 |
|
116 private: |
|
117 /** |
|
118 * Function: CGSPredictiveSettingList |
|
119 * |
|
120 * Discussion: Hidden, first-stage non-leaving constructor. |
|
121 * |
|
122 * Params: aData - reference to the data to be displayed and edited. |
|
123 * |
|
124 */ |
|
125 CGSDualLanguageList(CGSDualLanguageData* aData, CGSDualLanguageDialog* aDialog); |
|
126 |
|
127 /** |
|
128 * Function: CreateSettingItemL |
|
129 * |
|
130 * Discussion: Factory function for creating CAknSettingItem derived |
|
131 * SettingItem classes used t display current values |
|
132 * |
|
133 * Params: aSettingId - the id of the control which should be created |
|
134 * |
|
135 */ |
|
136 CAknSettingItem* CreateSettingItemL (TInt aSettingId); |
|
137 |
|
138 void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType); |
|
139 |
|
140 private: |
|
141 CGSDualLanguageData* iData; |
|
142 CGSDualLanguageDialog* iDialog; |
|
143 TInt iPrimaryValue; |
|
144 TInt iSecondaryValue; |
|
145 }; |
|
146 |
|
147 #endif // __DUALLANGUAGE_LIST_H |
|
148 |