|
1 /* |
|
2 * Copyright (c) 2002 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: Setting item list class for Video settings list view.* |
|
15 */ |
|
16 |
|
17 |
|
18 // Version : %version: 6 % |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef MPSETTINGSVIDEOSETTINGITEMLIST_H |
|
24 #define MPSETTINGSVIDEOSETTINGITEMLIST_H |
|
25 |
|
26 // INCLUDES |
|
27 #include <aknsettingitemlist.h> |
|
28 #include "videosettingsdrivemonitor.h" |
|
29 #include "mvideosettingsdrivemonitorobserver.h" |
|
30 |
|
31 // CONSTANTS |
|
32 // VideoCenter SIS package UID |
|
33 const TUid KSisUid = { 0x200159B2 }; |
|
34 |
|
35 // formatting string for version number |
|
36 _LIT( KVersionNumberFormat, "%d.%d(%d)" ); |
|
37 |
|
38 // Max length of the above version number string, whose format is |
|
39 // major.minor(build). Header e32cmn.h states that their ranges are: |
|
40 // 1. the major version number, ranging from 0 to 127, inclusive |
|
41 // 2. the minor version number, ranging from 0 to 99 inclusive |
|
42 // 3. the build number, ranging from 0 to 32767 inclusive. |
|
43 // Which makes the total max length 3+1+2+1+5+1 = 13 |
|
44 const TInt KMaxVersionNumberLength( 13 ); |
|
45 |
|
46 |
|
47 // When video contrast is not drawn, we know to shift the contents |
|
48 const TInt KVideoContrastNotSupported ( -99 ); |
|
49 |
|
50 // FORWARD DECLARATIONS |
|
51 class CMPSettingsModelForROP; |
|
52 class CVcxNsSettingsEngine; |
|
53 class TIptvDriveMonitorEvent; |
|
54 |
|
55 // CLASS DECLARATION |
|
56 |
|
57 /** |
|
58 * CMPSettingsVideoSettingItemList |
|
59 * Setting item list class for Video settings list view. |
|
60 * |
|
61 * @lib MediaSettings.app |
|
62 * @since 2.0 |
|
63 */ |
|
64 class CMPSettingsVideoSettingItemList : public CAknSettingItemList, |
|
65 public MIptvDriveMonitorObserver |
|
66 { |
|
67 public: // Constructors and destructor |
|
68 |
|
69 /** |
|
70 * Setting listbox's item idexes |
|
71 */ |
|
72 typedef enum |
|
73 { |
|
74 EVideoSettingContrast = 0, |
|
75 EVcSettingsViewParentControlIndex, |
|
76 EVcSettingsViewMemoryItemIndex, |
|
77 EVcSettingsViewThumbnailsIndex, |
|
78 EVideoPlayerVersion, |
|
79 EVcSettingsViewIadUpdateItemIndex // non-editable item |
|
80 } TVideoSettingItemIndex; |
|
81 |
|
82 /** |
|
83 * C++ default constructor. |
|
84 */ |
|
85 CMPSettingsVideoSettingItemList( CMPSettingsModelForROP* aModel, |
|
86 CVcxNsSettingsEngine& aVideoSettingsEngine ); |
|
87 |
|
88 /** |
|
89 * Destructor. |
|
90 */ |
|
91 virtual ~CMPSettingsVideoSettingItemList(); |
|
92 |
|
93 public: |
|
94 |
|
95 /** |
|
96 * Edits thumbnail setting item. |
|
97 * |
|
98 * @param itemIndex Setting list index. |
|
99 * @param aCalledFromMenu ETrue if started from menu. |
|
100 */ |
|
101 void EditThumbnailItemL( TInt itemIndex, TBool aCalledFromMenu ); |
|
102 |
|
103 /** |
|
104 * Edits parent control settting item. |
|
105 * |
|
106 * @param itemIndex Setting list index. |
|
107 * @param aCalledFromMenu ETrue if started from menu. |
|
108 */ |
|
109 void EditParentControlItemL( TInt itemIndex, TBool aCalledFromMenu ); |
|
110 |
|
111 /** |
|
112 * Edits preferred memory settting item. |
|
113 * |
|
114 * @param itemIndex Setting list index. |
|
115 * @param aCalledFromMenu ETrue if started from menu. |
|
116 */ |
|
117 void EditPreferredMemoryItemL( TInt itemIndex, TBool aCalledFromMenu ); |
|
118 |
|
119 /** |
|
120 * Check if specified item is currently selected. |
|
121 * |
|
122 * @param aIndex Item index |
|
123 */ |
|
124 TBool IsCurrentItem( TInt aIndex ); |
|
125 |
|
126 public: // Functions from base classes |
|
127 |
|
128 /** |
|
129 * From CAknSettingItemList |
|
130 */ |
|
131 void EditItemL(TInt aIndex, TBool aCalledFromMenu); |
|
132 |
|
133 /** |
|
134 * Opens current setting item for editing. |
|
135 * |
|
136 * @param aCalledFromMenu ETrue if started from menu. |
|
137 */ |
|
138 void EditCurrentItemL( TBool aCalledFromMenu ); |
|
139 |
|
140 /** |
|
141 * From CAknSettingItemList |
|
142 */ |
|
143 void LoadSettingsL(); |
|
144 |
|
145 /** |
|
146 * Finishes construction of listbox. Should be called after the |
|
147 * listbox is otherwise fully constructed. |
|
148 */ |
|
149 void FinishConstructionL(); |
|
150 |
|
151 public: // From MIptvDriveMonitorObserver |
|
152 |
|
153 void HandleDriveMonitorEvent( TIptvDriveMonitorEvent& aEvent ); |
|
154 |
|
155 protected: // Functions from base classes |
|
156 |
|
157 /** |
|
158 * From CAknSettingItemList |
|
159 */ |
|
160 CAknSettingItem* CreateSettingItemL(TInt aSettingId); |
|
161 |
|
162 private: //New |
|
163 |
|
164 /** |
|
165 * Loads a specific setting value. |
|
166 * @since 2.0 |
|
167 * @param aSettingId ID of the setting to be loaded. |
|
168 */ |
|
169 void LoadSettingL(TInt aSettingId); |
|
170 |
|
171 /** |
|
172 * Stores a specific setting value. |
|
173 * @since 2.0 |
|
174 * @param aSettingId ID of the setting to be stored. |
|
175 */ |
|
176 void StoreSettingL(TInt aSettingId); |
|
177 |
|
178 /** |
|
179 * Loads all setting values. |
|
180 * @since 2.0 |
|
181 */ |
|
182 void LoadAllL(); |
|
183 |
|
184 /** |
|
185 * Updates version number item to settings list. |
|
186 */ |
|
187 void UpdateVersionNumberTextL(); |
|
188 |
|
189 /** |
|
190 * Updates text of "parent control" setting item. |
|
191 */ |
|
192 void UpdateParentControlTextL(); |
|
193 |
|
194 /** |
|
195 * Fetch current parent control age and return corresponding index. |
|
196 * |
|
197 * @return Parent control age. |
|
198 */ |
|
199 TInt GetCurrentParentControl(); |
|
200 |
|
201 /** |
|
202 * Convert and save parent control index as age. |
|
203 * |
|
204 * @param aParentControlIndex Index of parent control selection. |
|
205 */ |
|
206 void SetCurrentParentControl( TInt aParentControlIndex ); |
|
207 |
|
208 /** |
|
209 * Updates text of "memory" setting item. |
|
210 */ |
|
211 void UpdateMemoryItemTextL(); |
|
212 |
|
213 /** |
|
214 * Adds phone memory descriptor to arrays. |
|
215 * |
|
216 * @param aIndex index in enumeration list. |
|
217 * @param aEnumeratedTextArray |
|
218 * @param aPoppedUpTextArray |
|
219 */ |
|
220 void AddPhoneMemoryDesToArraysL( TInt aIndex, |
|
221 CArrayPtrFlat<CAknEnumeratedText>& aEnumeratedTextArray, |
|
222 CArrayPtr<HBufC>& aPoppedUpTextArray ); |
|
223 |
|
224 /** |
|
225 * Adds memory card descriptor to arrays. |
|
226 * |
|
227 * @param aIndex index in enumeration list. |
|
228 * @param aEnumeratedTextArray |
|
229 * @param aPoppedUpTextArray |
|
230 */ |
|
231 void AddMemoryCardDesToArraysL( TInt aIndex, |
|
232 CArrayPtrFlat<CAknEnumeratedText>& aEnumeratedTextArray, |
|
233 CArrayPtr<HBufC>& aPoppedUpTextArray ); |
|
234 /** |
|
235 * Adds locked memory card descriptor to arrays. |
|
236 * |
|
237 * @param aIndex index in enumeration list. |
|
238 * @param aEnumeratedTextArray |
|
239 * @param aPoppedUpTextArray |
|
240 */ |
|
241 void AddLockedMemoryCardDesToArraysL( TInt aIndex, |
|
242 CArrayPtrFlat<CAknEnumeratedText>& aEnumeratedTextArray, |
|
243 CArrayPtr<HBufC>& aPoppedUpTextArray ); |
|
244 |
|
245 /** |
|
246 * Adds hard disk descriptor to arrays. |
|
247 * |
|
248 * @param aIndex index in enumeration list. |
|
249 * @param aEnumeratedTextArray |
|
250 * @param aPoppedUpTextArray |
|
251 */ |
|
252 void AddHardDiskDesToArraysL( TInt aIndex, |
|
253 CArrayPtrFlat<CAknEnumeratedText>& aEnumeratedTextArray, |
|
254 CArrayPtr<HBufC>& aPoppedUpTextArray ); |
|
255 |
|
256 /** |
|
257 * Adds descriptor to arrays. |
|
258 * |
|
259 * @param aIndex index in enumeration list. |
|
260 * @param aText Descriptor to add. Ownership moves. |
|
261 * @param aEnumeratedTextArray |
|
262 * @param aPoppedUpTextArray |
|
263 */ |
|
264 void AddDesToArraysL( TInt aIndex, |
|
265 HBufC* aText, |
|
266 CArrayPtrFlat<CAknEnumeratedText>& aEnumeratedTextArray, |
|
267 CArrayPtr<HBufC>& aPoppedUpTextArray ); |
|
268 |
|
269 /** |
|
270 * Check wheter or not the Contrast settings item shold be drawn |
|
271 */ |
|
272 TBool VideoContrastIsSupportedL(); |
|
273 |
|
274 /** |
|
275 * Event handling section, from MEikListBoxObserver. |
|
276 */ |
|
277 void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aListBoxEvent); |
|
278 |
|
279 private: |
|
280 CMPSettingsModelForROP* iModel; |
|
281 CVcxNsSettingsEngine& iVideoSettingsEngine; // Video settings engine |
|
282 |
|
283 CVideoSettingsDriveMonitor* iDriveMonitor; // Drive monitor |
|
284 |
|
285 TBuf< KMaxVersionNumberLength > iSettingVersionText; // version text |
|
286 CAknTextSettingItem* iSettingIadUpdateItem; // IAD update setting item |
|
287 |
|
288 CAknEnumeratedTextPopupSettingItem* iSettingThumbnailsItem; // Thumbnail setting item |
|
289 TInt iSettingThumbnails; // Selected thumbnail setting value |
|
290 |
|
291 CAknEnumeratedTextPopupSettingItem* iSettingParentControlItem; // Parent control setting item |
|
292 TInt iParentControlIndex; // Selected parent control setting value |
|
293 /** |
|
294 * Is the phone's lock code entered succesfully, |
|
295 * required for editing parent control settings. |
|
296 */ |
|
297 TBool iLockCodeAccepted; |
|
298 |
|
299 CAknEnumeratedTextPopupSettingItem* iSettingMemoryItem; // Memory setting item |
|
300 TInt iSettingMemory; // Selected memory setting value |
|
301 |
|
302 CAknEnumeratedTextPopupSettingItem* iSettingServiceItem; // Service selection item |
|
303 TInt iSettingTemp; // Dummy setting placeholder for settings sublist items |
|
304 |
|
305 TInt iVideoContrast; |
|
306 TBool iVideoRepeatMode; |
|
307 TBool iVideoDefaultViewMode; |
|
308 TBool iRockerKeysMode; |
|
309 TBool iRockerKeysSupported; |
|
310 TBool iLandscapeSupportedByDevice; |
|
311 }; |
|
312 |
|
313 #endif // MPSETTINGSVIDEOSETTINGITEMLIST_H |
|
314 |
|
315 // End of File |