|
1 /* |
|
2 * Copyright (c) 2006 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: Settings container |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CVCSETTINGSCONTAINER_H |
|
20 #define CVCSETTINGSCONTAINER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <coecntrl.h> |
|
24 #include <coedef.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CEikTextListBox; |
|
28 class CVCSettingsView; |
|
29 class CVCSettingsList; |
|
30 CEikButtonGroupContainer; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Container for the settings view |
|
36 * @since 2.8 |
|
37 */ |
|
38 class CVCSettingsContainer : public CCoeControl, |
|
39 public MCoeControlObserver, |
|
40 public MEikListBoxObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * C++ constructor. |
|
46 */ |
|
47 CVCSettingsContainer( CEikButtonGroupContainer& aCbaGroup ); |
|
48 |
|
49 /** |
|
50 * Symbian OS default constructor. |
|
51 * @param aRect Frame rectangle for container. |
|
52 */ |
|
53 void ConstructL(const TRect& aRect); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 virtual ~CVCSettingsContainer(); |
|
59 |
|
60 public: // Functions from base classes |
|
61 |
|
62 /** |
|
63 * From CCoeControl |
|
64 * Gives the help context to be displayed |
|
65 * @param aContext help context related to current view |
|
66 */ |
|
67 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
68 |
|
69 /** |
|
70 * From MEikListBoxObserver |
|
71 * @see MEikListBoxObserver for more information |
|
72 */ |
|
73 void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); |
|
74 |
|
75 public: // New functions |
|
76 |
|
77 /** |
|
78 * Open setting page for currently selected setting item. |
|
79 * @param aCalledFromMenu True if editing command was chosen from the |
|
80 options menu |
|
81 * @return void |
|
82 */ |
|
83 void EditCurrentL( TBool aCalledFromMenu ); |
|
84 |
|
85 /** |
|
86 * Shows reset confimation dialog |
|
87 * @return void |
|
88 */ |
|
89 void ResetL(); |
|
90 |
|
91 /** |
|
92 * Save all settings. |
|
93 * @return void |
|
94 */ |
|
95 void SaveSettingsL(); |
|
96 |
|
97 /** |
|
98 * Returns current listbox index |
|
99 * @return void |
|
100 */ |
|
101 TInt CurrentItemIndex() const; |
|
102 |
|
103 /** |
|
104 * Returns the size of the list box. |
|
105 * |
|
106 */ |
|
107 TInt ItemListSize() const; |
|
108 |
|
109 /** |
|
110 * Returns the setting item identifier for the current setting item. |
|
111 * @return TInt The setting item identifier |
|
112 */ |
|
113 TInt CurrentItemIdentifier() const; |
|
114 |
|
115 /** |
|
116 * Sets the middle softkey label. NOTE: this should be handled in the |
|
117 * view class in a normal case where container would call this function |
|
118 * after focused item has changed. But since there are two view classes |
|
119 * (normal and plugin) that both use this container class, we can |
|
120 * only have a pointer to the views' super class. |
|
121 */ |
|
122 void SetMiddleSoftkeyLabelL() const; |
|
123 |
|
124 |
|
125 protected: // Functions from base classes |
|
126 |
|
127 /** |
|
128 * From CCoeControl return the number of controls owned |
|
129 * @return TInt number of controls |
|
130 */ |
|
131 TInt CountComponentControls() const; |
|
132 |
|
133 /** |
|
134 * From CCoeControl returns a control |
|
135 * @param aIndex index of a control |
|
136 * @return CCoeControl* pointer on a control |
|
137 */ |
|
138 CCoeControl* ComponentControl(TInt aIndex) const; |
|
139 |
|
140 /** |
|
141 * From CCoeControl event handling section |
|
142 * @param aKeyEvent the key event |
|
143 * @param aType the type of the event |
|
144 * @return TKeyResponse key event was used by this control or not |
|
145 */ |
|
146 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
147 TEventCode aType ); |
|
148 |
|
149 /** |
|
150 * From CCoeControl |
|
151 * @see CCoeControl for more information |
|
152 */ |
|
153 void FocusChanged(TDrawNow aDrawNow); |
|
154 |
|
155 /** |
|
156 * From CCoeControl |
|
157 * @see CCoeControl for more information |
|
158 */ |
|
159 void SizeChanged(); |
|
160 |
|
161 /** |
|
162 * From CCoeControl |
|
163 * @see CCoeControl for more information |
|
164 */ |
|
165 void HandleResourceChange(TInt aType); |
|
166 |
|
167 /** |
|
168 * From MCoeControlObserver |
|
169 * @see MCoeControlObserver for more information |
|
170 */ |
|
171 void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); |
|
172 |
|
173 private: |
|
174 |
|
175 /** |
|
176 * returns title resource id |
|
177 * @return TInt |
|
178 */ |
|
179 TInt TitleResourceId() const; |
|
180 |
|
181 /** |
|
182 * Sets the middle softkey label. |
|
183 * @param aResourceId Label text from resource file |
|
184 * @param aCommandId Menu c |
|
185 */ |
|
186 void DoSetMiddleSoftKeyLabelL( const TInt aResourceId, |
|
187 const TInt aCommandId ) const; |
|
188 |
|
189 /** |
|
190 * Remove MSK command mappings. |
|
191 */ |
|
192 void RemoveCommandFromMSK() const; |
|
193 |
|
194 private: //data |
|
195 |
|
196 CVCSettingsList* iSettingsList; |
|
197 CEikButtonGroupContainer& iCbaGroup; |
|
198 |
|
199 }; |
|
200 |
|
201 #endif // CVCSETTINGSCONTAINER_H |
|
202 |
|
203 // End of File |