1 /* |
|
2 * Copyright (c) 2006-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 "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: Base slideset settings dialog. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PSLNSLIDESETDIALOG_H |
|
20 #define C_PSLNSLIDESETDIALOG_H |
|
21 |
|
22 #include <pslnslidesetdialoginterface.h> |
|
23 #include <aknsettingpage.h> |
|
24 #include <ConeResLoader.h> |
|
25 #include <eikclb.h> |
|
26 |
|
27 class CPslnSlideSetDialogContainer; |
|
28 class CEikTextListBox; |
|
29 class CPslnSlideSetModel; |
|
30 |
|
31 /** |
|
32 * Provides the base dialog functionality for defining Slide Set Settings |
|
33 * for wallpapers and screensavers. |
|
34 * |
|
35 * To use this from code, instantiate the ECOM plugin, then call ExecuteLD. |
|
36 * See details from pslnslidesetwallpaperdialog.h and |
|
37 * pslnslidesetscreensaverdialog.h. |
|
38 * |
|
39 * @lib pslnslidesetdialog.dll |
|
40 * @since S60 3.2 |
|
41 */ |
|
42 class CPslnSlidesetDialog: |
|
43 public CPslnSlidesetDialogInterface, |
|
44 public MEikListBoxObserver, |
|
45 public MAknSettingPageObserver |
|
46 { |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Constructs all common parts of the dialog. |
|
51 * @param aType type of slide set (wallpaper or screen saver). |
|
52 * |
|
53 * See CPslnSlidesetDialogInterface::TPslnSlideSetDialogType for valid values. |
|
54 */ |
|
55 void BaseConstructL( const TInt aType ); |
|
56 |
|
57 /** |
|
58 * Symbian two-phase constructor. |
|
59 */ |
|
60 virtual void ConstructL() = 0; |
|
61 |
|
62 /** |
|
63 * Creates listbox items. |
|
64 */ |
|
65 virtual void CreateListBoxItemsL() = 0; |
|
66 |
|
67 /** |
|
68 * Destructor |
|
69 */ |
|
70 virtual ~CPslnSlidesetDialog(); |
|
71 |
|
72 /** |
|
73 * Returns listbox's current item index. |
|
74 * @return current item index. |
|
75 */ |
|
76 TInt CurrentItemIndex() const; |
|
77 |
|
78 /** |
|
79 * Sets current item index for listbox and re-draws screen. |
|
80 * @param aNewIndex new index. |
|
81 */ |
|
82 void SetCurrentItemIndexAndDraw( TInt aNewIndex ); |
|
83 |
|
84 /** |
|
85 * Checks if feature is supported. |
|
86 * @param aFeatureID feature ID. |
|
87 * @return ETrue if feature is supported, EFalse otherwise. |
|
88 */ |
|
89 TBool IsFeatureSupported( TInt aFeatureID ); |
|
90 |
|
91 protected: |
|
92 |
|
93 /** |
|
94 * C++ default constructor. |
|
95 */ |
|
96 CPslnSlidesetDialog(); |
|
97 |
|
98 /** |
|
99 * Sets title pane text. |
|
100 * @param aResourceId resource ID of title text to use. |
|
101 */ |
|
102 void SetTitlePaneL( const TInt aResourceId ); |
|
103 |
|
104 /** |
|
105 * Makes one specific folder name item. |
|
106 * @param aIndex item index to create. |
|
107 */ |
|
108 void MakeItemL( const TInt aIndex ); |
|
109 |
|
110 /** |
|
111 * Sets middle softkey label. |
|
112 * @param aResourceId resource ID of label text to use. |
|
113 * @param aCommandId command to place to middle softkey. |
|
114 */ |
|
115 void SetMiddleSoftKeyLabelL( |
|
116 const TInt aResourceId, |
|
117 const TInt aCommandId ); |
|
118 |
|
119 /** |
|
120 * From CEikDialog. Prelayouts the dialog. |
|
121 */ |
|
122 void PreLayoutDynInitL(); |
|
123 |
|
124 /** |
|
125 * From CAknDialog. |
|
126 * Called by framework to process commands invoked by the user. |
|
127 */ |
|
128 void ProcessCommandL( TInt aCommandId ); |
|
129 |
|
130 /** |
|
131 * From CEikDialog. Checks if it is okay to exit the dialog. |
|
132 */ |
|
133 TBool OkToExitL( TInt aButtonId ); |
|
134 |
|
135 private: |
|
136 |
|
137 /** |
|
138 * From CAknDialog. |
|
139 * Called by framework to dynamically manipulate the menu |
|
140 * for the dialog. |
|
141 */ |
|
142 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
143 |
|
144 /** |
|
145 * From CAknDialog. |
|
146 * Called by framework to notify resize of dialog. |
|
147 */ |
|
148 void SizeChanged(); |
|
149 |
|
150 /** |
|
151 * From CCoeControl. |
|
152 * Key Handling Method for control. |
|
153 */ |
|
154 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
155 TEventCode aType ); |
|
156 |
|
157 /** |
|
158 * From MAknSettingPageObserver. |
|
159 */ |
|
160 void HandleSettingPageEventL( |
|
161 CAknSettingPage* aSettingPage, |
|
162 TAknSettingPageEvent aEventType ); |
|
163 |
|
164 /** |
|
165 * From CCoeControl. |
|
166 * Handles resource changes. |
|
167 */ |
|
168 void HandleResourceChange( TInt aType ); |
|
169 |
|
170 /** |
|
171 * From CCoeControl |
|
172 * Handles list focus changes. |
|
173 */ |
|
174 void FocusChanged( TDrawNow aDrawNow ); |
|
175 |
|
176 /** |
|
177 * From CCoeControl. |
|
178 */ |
|
179 TInt CountComponentControls() const; |
|
180 |
|
181 /** |
|
182 * From CCoeControl. |
|
183 */ |
|
184 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
185 |
|
186 /* |
|
187 * From MEikListBoxObserver. Handle listbox events. |
|
188 */ |
|
189 void HandleListBoxEventL( |
|
190 CEikListBox* aListBox, |
|
191 TListBoxEvent aEventType ); |
|
192 |
|
193 /* |
|
194 * Creates listbox items. |
|
195 */ |
|
196 void CreateSettingsListL(); |
|
197 |
|
198 /* |
|
199 * Handles list box selection based on active index |
|
200 */ |
|
201 void HandleListBoxSelectionL(); |
|
202 |
|
203 /** |
|
204 * Show slide set type setting page. |
|
205 */ |
|
206 virtual void ShowSlideSetTypeSelectionL(); |
|
207 |
|
208 /** |
|
209 * Show backlight period setting page. Empty implementation. |
|
210 */ |
|
211 virtual void ShowBacklightSliderL(); |
|
212 |
|
213 /** |
|
214 * Show slide set duration setting page. Empty implementation. |
|
215 */ |
|
216 virtual void ShowDurationSliderL(); |
|
217 |
|
218 /** |
|
219 * Show slide set image interval peridod setting page. Empty implementation. |
|
220 */ |
|
221 virtual void ShowIntervalListL(); |
|
222 |
|
223 /** |
|
224 * Show slide set image list. |
|
225 */ |
|
226 TBool ShowSlideSetImageListL(); |
|
227 |
|
228 /** |
|
229 * Removes caller's navi pane and replaces it with default navi pane. |
|
230 * When dialog is closed, previous navi pane is reapplied. |
|
231 */ |
|
232 void ToggleDefaultNaviPaneL( const TBool aNaviPaneVisible ); |
|
233 |
|
234 /** |
|
235 * Updates dialog with new value. |
|
236 */ |
|
237 void UpdateDialogL( const TInt aSettingId ); |
|
238 |
|
239 /** |
|
240 * Sets current value of setting page to listbox. |
|
241 */ |
|
242 void SetSettingPageValueToListL( |
|
243 const CDesCArrayFlat& aArray, |
|
244 const TInt aCurrentIndex, |
|
245 const TInt aCurrentValue, |
|
246 const TBool aNumericConversionNeeded ); |
|
247 |
|
248 /** |
|
249 * Sets current value of slider page to listbox. |
|
250 */ |
|
251 void SetSliderValueToListL( |
|
252 const TInt aCurrentIndex, |
|
253 const TInt aCurrentValue, |
|
254 const TInt aResourceID ); |
|
255 |
|
256 /** |
|
257 * Selects correct resource string to use with setting item. |
|
258 */ |
|
259 TInt SelectResourceStringForImages( TInt aCurrentValue ); |
|
260 |
|
261 /** |
|
262 * Starts MGFetch. |
|
263 */ |
|
264 void HandleLaunchMGFetchL(); |
|
265 |
|
266 protected: // data |
|
267 |
|
268 /** |
|
269 * List of setting items. |
|
270 * Own. |
|
271 */ |
|
272 CDesCArrayFlat* iItems; |
|
273 |
|
274 /** |
|
275 * Listbox. |
|
276 * Own. |
|
277 */ |
|
278 CEikTextListBox* iListBox; |
|
279 |
|
280 /** |
|
281 * Setting items for slide set interval setting page. |
|
282 * Own. |
|
283 */ |
|
284 CDesCArrayFlat* iIntervalItems; |
|
285 |
|
286 /** |
|
287 * Slide set model. |
|
288 * Own. |
|
289 */ |
|
290 CPslnSlideSetModel* iModel; |
|
291 |
|
292 /** |
|
293 * Is the dialog launched for activation and configuration, |
|
294 * or configuration only? |
|
295 */ |
|
296 TInt iLaunchMode; |
|
297 |
|
298 /** |
|
299 * Setting items for slide set type setting page. |
|
300 * Own. |
|
301 */ |
|
302 CDesCArrayFlat* iSlideSetTypeItems; |
|
303 |
|
304 |
|
305 private: |
|
306 |
|
307 /** |
|
308 * List of items in listbox. |
|
309 * Not own (owned by listbox). |
|
310 */ |
|
311 CDesCArray* iItemArray; |
|
312 |
|
313 /** |
|
314 * Type of dialog. |
|
315 * Values according to TPslnSlideSetDialogType. |
|
316 */ |
|
317 TInt iType; |
|
318 |
|
319 /** |
|
320 * Offset of resource file. |
|
321 */ |
|
322 TInt iResourceOffset; |
|
323 |
|
324 /** |
|
325 * Defines which features are supported. |
|
326 */ |
|
327 TBitFlags iFeaturesSupport; |
|
328 |
|
329 /** |
|
330 * |
|
331 * Own. |
|
332 */ |
|
333 const HBufC* iPreviousTitleTxt; |
|
334 |
|
335 /** |
|
336 * ETrue, when MGFetch has been started. |
|
337 */ |
|
338 TBool iMGFetchRunning; |
|
339 }; |
|
340 |
|
341 |
|
342 #endif // C_PSLNSLIDESETDIALOG_H |
|