|
1 /* |
|
2 * Copyright (c) 2007 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 the License "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: Container class for Setting view.* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef VCSETTINGSVIEWSETTINGSVIEWCONTAINER_H |
|
21 #define VCSETTINGSVIEWSETTINGSVIEWCONTAINER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <coecntrl.h> |
|
25 #include <eikfrlb.h> |
|
26 #include <AknIconArray.h> |
|
27 |
|
28 #include "CIptvService.h" |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CVcxNsSettingsView; |
|
34 class CVcxNsSettingsViewSettingsListbox; |
|
35 class CAknSingleGraphicStyleListBox; |
|
36 class CVcxNsSettingsViewAddServiceListbox; |
|
37 class CAknSingleNumberStyleListBox; |
|
38 class CVcxNsSettingsEngine; |
|
39 class CVcxNsSettingsViewSettingItem; |
|
40 class CVcxNsSettingsViewServiceType; |
|
41 class CVcxNsSettingsViewServiceSelection; |
|
42 class CVcxNsSettingsViewAddOrEditService; |
|
43 class CVcSettingsViewChangePriority; |
|
44 class CVcxNsServiceSettings; |
|
45 |
|
46 class CAknViewAppUi; |
|
47 |
|
48 enum TSettingsViewActiveList |
|
49 { |
|
50 /* |
|
51 ESettingItem = 1, |
|
52 EConnectionSettings, |
|
53 EServiceType, |
|
54 */ |
|
55 EServiceSelection = 1, |
|
56 EAddService |
|
57 }; |
|
58 |
|
59 // CLASS DECLARATION |
|
60 |
|
61 /** |
|
62 * Container class for Setting view. |
|
63 * |
|
64 * @lib vcsettingsview.lib |
|
65 * @since S60 3.2 |
|
66 */ |
|
67 NONSHARABLE_CLASS( CVcxNsSettingsViewContainer ) : public CCoeControl, public MEikListBoxObserver |
|
68 { |
|
69 public: // Enumerations. |
|
70 |
|
71 enum TMenuItemType |
|
72 { |
|
73 EGeneral = 1, |
|
74 EConst, |
|
75 EConstAndInfo, |
|
76 EEditable |
|
77 }; |
|
78 |
|
79 public: // Construction and destruction. |
|
80 |
|
81 /** |
|
82 * @param aAppUi Reference to application's App Ui. |
|
83 * @param aAppSettings Reference to UI Engine's AppSettings. |
|
84 * @param aParentView Pointer to parent view. |
|
85 * @param aFs Reference to RFs session. |
|
86 */ |
|
87 CVcxNsSettingsViewContainer( CAknViewAppUi& aAppUi, |
|
88 CVcxNsSettingsEngine& aAppSettings, |
|
89 CVcxNsServiceSettings& aServiceSettings, |
|
90 CVcxNsSettingsView* aParentView, |
|
91 RFs& aFs); |
|
92 |
|
93 /** |
|
94 * @param aRect Frame rectangle for container. |
|
95 */ |
|
96 void ConstructL(const TRect& aRect); |
|
97 |
|
98 ~CVcxNsSettingsViewContainer(); |
|
99 |
|
100 /** |
|
101 * From CCoeControl |
|
102 * Called by framework when help is launched. Returns currently |
|
103 * active view's help content. |
|
104 * @param aContext On return, help context. |
|
105 */ |
|
106 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
107 |
|
108 public: |
|
109 |
|
110 /** |
|
111 * Returns pointer to App Ui. |
|
112 * |
|
113 * @return Pointer to App Ui. |
|
114 */ |
|
115 CAknViewAppUi* AppUi(); |
|
116 |
|
117 /** |
|
118 * Returns pointer to Settings view. |
|
119 * |
|
120 * @return Pointer to Settings view. |
|
121 */ |
|
122 CVcxNsSettingsView* SettingsView(); |
|
123 |
|
124 /** |
|
125 * Returns pointer to Service Selection. |
|
126 * |
|
127 * @return Pointer to Service Selection. |
|
128 */ |
|
129 CVcxNsSettingsViewServiceSelection* ServiceSelection(); |
|
130 |
|
131 /** |
|
132 * Switches "service selection list" visible. |
|
133 */ |
|
134 void SwitchToServiceSelectionListL(); |
|
135 |
|
136 /** |
|
137 * Switches "service selection list" of type Vod visible. |
|
138 * |
|
139 * @param aServiceType Type of service |
|
140 */ |
|
141 void SwitchToServiceSelectionListL( CIptvService::TServiceType aServiceType ); |
|
142 |
|
143 /** |
|
144 * Closes "service selection list". |
|
145 */ |
|
146 void FinishServiceSelectionList(); |
|
147 |
|
148 /** |
|
149 * Sets title for this view. |
|
150 * |
|
151 * @param aResourceId Title resource id. |
|
152 */ |
|
153 void SetTitleL( TInt aResourceId ); |
|
154 |
|
155 /** |
|
156 * Switches "add/edit service list" visible. |
|
157 */ |
|
158 void SwitchToAddOrEditServiceListL(); |
|
159 |
|
160 /** |
|
161 * Returns type of currently active list. |
|
162 * |
|
163 * @return One of TSettingsViewActiveList enumerations. |
|
164 */ |
|
165 TSettingsViewActiveList GetActiveList() |
|
166 {return(iActiveList);} |
|
167 |
|
168 /** |
|
169 * Deletes currently active video service. |
|
170 * Functional only in "service selection list". |
|
171 */ |
|
172 void DeleteVideoServiceL(); |
|
173 |
|
174 /** |
|
175 * Returns current service type of "service selection list". |
|
176 * |
|
177 * @return Service type as CIptvService::TServiceType enumeration. |
|
178 */ |
|
179 CIptvService::TServiceType GetServiceSelectionServiceType(); |
|
180 |
|
181 /** |
|
182 * Loads/updates data to "add/edit service list". |
|
183 * |
|
184 * @param aAdding ETrue if list will be used for adding, |
|
185 * EFalse if it will be used for editing. |
|
186 */ |
|
187 void LoadAddServiceInformationL(TBool aAdding); |
|
188 |
|
189 /** |
|
190 * Saves data from "add/edit service list". |
|
191 */ |
|
192 void SaveAddServiceInformationL(); |
|
193 |
|
194 /** |
|
195 * Saves data (=selections) from "service selection list". |
|
196 */ |
|
197 void SaveServiceSelectionInformationL(); |
|
198 |
|
199 /** |
|
200 * Opens current setting item for editing. |
|
201 * |
|
202 * @param aCalledFromMenu ETrue if edit request comes from menu. |
|
203 */ |
|
204 void EditCurrentSettingItemListItemL(TBool aCalledFromMenu); |
|
205 |
|
206 /** |
|
207 * Opens dialog with video service details. |
|
208 * Functional only in "service selection list". |
|
209 */ |
|
210 void ShowVideoServiceDetailsL(); |
|
211 |
|
212 /** |
|
213 * Handles mark commands received from menu. |
|
214 * Functional only in "service selection list". |
|
215 * |
|
216 * @param aCommand Mark command. |
|
217 */ |
|
218 void HandleMarkCommandL(TInt aCommand); |
|
219 |
|
220 /** |
|
221 * Key event handler. |
|
222 * Note: Changed to public for key routing. |
|
223 */ |
|
224 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
225 |
|
226 /** |
|
227 * Returns true if "mark" menu item can be shown for current list item. |
|
228 * Functional only in "service selection list". |
|
229 * |
|
230 * @return ETrue if "mark" menu item can be shown. |
|
231 */ |
|
232 TBool ShowMarkForCurrentListItemL(); |
|
233 |
|
234 /** |
|
235 * Returns true if "unmark" menu item can be shown for current list item. |
|
236 * Functional only in "service selection list". |
|
237 * |
|
238 * @return ETrue if "unmark" menu item can be shown. |
|
239 */ |
|
240 TBool ShowUnmarkForCurrentListItemL(); |
|
241 |
|
242 /** |
|
243 * Returns true if menu item of given type can be shown for current list item. |
|
244 * Functional only in "service selection list". |
|
245 * |
|
246 * @param aMenuItemType Menu item type as TMenuItemType enumeration. |
|
247 * @return ETrue if given menu item can be shown. |
|
248 */ |
|
249 TBool ShowMenuItemForCurrentListItemL(TMenuItemType aMenuItemType); |
|
250 |
|
251 /** |
|
252 * Load Vodcast data to "Add feed" view. Used when add feed called directly |
|
253 * from Vodcast view. |
|
254 */ |
|
255 void LoadAddVodCastFeedL(); |
|
256 |
|
257 /** |
|
258 * From MEikListBoxObserver |
|
259 * Event message handler to be used for the service type, |
|
260 * selection and add/edit Listboxes. |
|
261 * |
|
262 * @param *aListBox not used in this context |
|
263 * @param aEventType A code for the event. |
|
264 */ |
|
265 void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType); |
|
266 |
|
267 private: |
|
268 |
|
269 /** |
|
270 * Returns true if current list item is marked. |
|
271 * Functional only in "service selection list". |
|
272 */ |
|
273 TBool IsCurrentListItemMarked(); |
|
274 |
|
275 /** |
|
276 * From CoeControl. Called when container size changes. |
|
277 */ |
|
278 void SizeChanged(); |
|
279 |
|
280 /** |
|
281 * From CoeControl. Returns count of controls in container. |
|
282 */ |
|
283 TInt CountComponentControls() const; |
|
284 |
|
285 /** |
|
286 * From CCoeControl. Returns a specific control in container. |
|
287 */ |
|
288 CCoeControl* ComponentControl(TInt aIndex) const; |
|
289 |
|
290 /** |
|
291 * From CCoeControl. Handle global resource change. |
|
292 */ |
|
293 void HandleResourceChange(TInt aType); |
|
294 |
|
295 /** |
|
296 * From CCoeControl. Draws container. |
|
297 */ |
|
298 void Draw(const TRect& aRect) const; |
|
299 |
|
300 /** |
|
301 * |
|
302 */ |
|
303 TInt TitleResourceId(); |
|
304 |
|
305 public: |
|
306 /** |
|
307 * Zeroes interal msk tracker. DOES NOT ACTUALLY CLEAR MSK! |
|
308 */ |
|
309 void ClearMsk(); |
|
310 |
|
311 /** |
|
312 * Check if the msk need update and updates if needed |
|
313 */ |
|
314 void CheckMsk(); |
|
315 |
|
316 private: // Data |
|
317 |
|
318 /** |
|
319 * App UI |
|
320 */ |
|
321 CAknViewAppUi& iAppUi; |
|
322 |
|
323 /** |
|
324 * reference to Settings engine |
|
325 */ |
|
326 CVcxNsSettingsEngine& iAppSettings; |
|
327 |
|
328 /** |
|
329 * UI engine's service settings provider |
|
330 */ |
|
331 CVcxNsServiceSettings& iServiceSettings; |
|
332 |
|
333 /** |
|
334 * Parent View |
|
335 */ |
|
336 CVcxNsSettingsView* iParentView; |
|
337 |
|
338 /** |
|
339 * iFs |
|
340 */ |
|
341 RFs& iFs; |
|
342 |
|
343 /** |
|
344 * Currently active setting item list |
|
345 */ |
|
346 TSettingsViewActiveList iActiveList; |
|
347 |
|
348 /** |
|
349 * Current MSK resource id |
|
350 */ |
|
351 TInt iCurrentMskResource; |
|
352 |
|
353 /** |
|
354 * Service selection setting item |
|
355 */ |
|
356 CVcxNsSettingsViewServiceSelection* iServiceSelection; |
|
357 |
|
358 /** |
|
359 * Add or edit service setting item |
|
360 */ |
|
361 CVcxNsSettingsViewAddOrEditService* iAddOrEditService; |
|
362 |
|
363 }; |
|
364 |
|
365 #endif // VCSETTINGSVIEWSETTINGSVIEWCONTAINER_H |
|
366 |