|
1 /* |
|
2 * Copyright (c) 2005-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: Provides Psln Application Screensaver view. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CPSLNSCREENSAVERVIEW_H |
|
21 #define CPSLNSCREENSAVERVIEW_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "PslnPropertySubscriber.h" |
|
25 |
|
26 // Base classes |
|
27 #include "PslnBaseView.h" |
|
28 #include "mpslnscreensaverecomobserver.h" |
|
29 #include <mpslnfwmsklabelobserver.h> |
|
30 #include <cenrepnotifyhandler.h> |
|
31 |
|
32 #include <psmclient.h> |
|
33 #include <psmclientobserver.h> |
|
34 |
|
35 class CAknWaitDialog; |
|
36 |
|
37 /** |
|
38 * CPslnBaseView view class. |
|
39 * Provides Psln Application Screensaver view. |
|
40 * |
|
41 * @since S60 v3.1 |
|
42 */ |
|
43 class CPslnScreenSaverView : public CPslnBaseView, |
|
44 public MPslnScreenSaverECOMObserver, |
|
45 public MPslnFWMSKObserver, |
|
46 public MCenRepNotifyHandlerCallback, |
|
47 public MPsmClientObserver |
|
48 { |
|
49 public: |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. |
|
53 */ |
|
54 static CPslnScreenSaverView* NewLC(); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CPslnScreenSaverView(); |
|
60 |
|
61 /** |
|
62 * From CAknView. |
|
63 * Returns view id. |
|
64 * @return An unsigned integer (view id). |
|
65 */ |
|
66 TUid Id() const; |
|
67 |
|
68 /** |
|
69 * From MEikCommandObserver . |
|
70 * Handles commands. |
|
71 * @param aCommand Command to be handled. |
|
72 */ |
|
73 void HandleCommandL( TInt aCommand ); |
|
74 |
|
75 /** |
|
76 * From MPslnScreenSaverECOMObserver. |
|
77 * Called when there is a change in ECOM plugins. |
|
78 */ |
|
79 void HandlePluginListChangeL(); |
|
80 |
|
81 /** |
|
82 * From MPslnFWMSKObserver. |
|
83 * Checks if the MSK label needs to be adjusted. |
|
84 */ |
|
85 void CheckMiddleSoftkeyLabelL(); |
|
86 |
|
87 /** |
|
88 * From MPsmClientObserver. |
|
89 * Notify when the power save mode is changed. |
|
90 */ |
|
91 void PowerSaveModeChanged( const TPsmsrvMode aMode ); |
|
92 |
|
93 /** |
|
94 * From MPsmClientObserver. |
|
95 * Notify when some wrong with the power save mode change. |
|
96 */ |
|
97 void PowerSaveModeChangeError( const TInt aError ); |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * Callback for exiting Screensaver preview mode. |
|
103 * @param aPtr pointer to get reference to self. |
|
104 * @return error code. |
|
105 */ |
|
106 static TInt HandlePreviewModeChanged( TAny* aPtr ); |
|
107 |
|
108 /** |
|
109 * Callback for changes in Screensaver preview state. |
|
110 * @param aPtr pointer to get reference to self. |
|
111 * @return error code. |
|
112 */ |
|
113 static TInt HandlePreviewStateChanged( TAny* aPtr ); |
|
114 |
|
115 /** |
|
116 * From CAknView. |
|
117 * Called when view is about to activate. |
|
118 */ |
|
119 void DoActivateL( |
|
120 const TVwsViewId& aPrevViewId, |
|
121 TUid aCustomMessageId, |
|
122 const TDesC8& aCustomMessage ); |
|
123 |
|
124 /** |
|
125 * From CAknView. |
|
126 * Called when view is deactivated. |
|
127 */ |
|
128 void DoDeactivate(); |
|
129 |
|
130 /** |
|
131 * From MEikMenuObserver. |
|
132 * Changes MenuPane dynamically. |
|
133 */ |
|
134 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
135 |
|
136 /** |
|
137 * From MProgressDialogCallback. |
|
138 * Called when wait note is removed. |
|
139 */ |
|
140 void DialogDismissedL( TInt aButtonId ); |
|
141 |
|
142 /** |
|
143 * From CPslnBaseView. |
|
144 * Handles listbox selection. |
|
145 */ |
|
146 void HandleListBoxSelectionL(); |
|
147 |
|
148 /** |
|
149 * From CPslnBaseView. |
|
150 */ |
|
151 void HandleListBoxItemHighlightL(); |
|
152 |
|
153 /** |
|
154 * From CPslnBaseView. |
|
155 * Creates new container. |
|
156 */ |
|
157 void NewContainerL(); |
|
158 |
|
159 /** |
|
160 * From CPslnBaseView. |
|
161 */ |
|
162 void SetTitlePaneL( TInt& aResourceId ); |
|
163 |
|
164 /* From MCenRepNotifyHandlerCallback. */ |
|
165 void HandleNotifyInt( TUint32 aId, TInt /*aNewValue*/ ); |
|
166 |
|
167 /* From MCenRepNotifyHandlerCallback. */ |
|
168 void HandleNotifyGeneric( TUint32 aId ); |
|
169 |
|
170 /* From MCenRepNotifyHandlerCallback. */ |
|
171 void HandleNotifyError( |
|
172 TUint32 aId, |
|
173 TInt aError, |
|
174 CCenRepNotifyHandler* aHandler ); |
|
175 |
|
176 /** |
|
177 * Handles screensaver activation command. |
|
178 */ |
|
179 void HandleScreenSaverActivationL( TInt aCurrentItem ); |
|
180 |
|
181 /** |
|
182 * Handles screensaver preview command. |
|
183 */ |
|
184 void HandleScreenSaverPreviewL( TInt aCurrentItem ); |
|
185 |
|
186 /** |
|
187 * Handles screensaver settings command. |
|
188 */ |
|
189 void HandleScreenSaverSettingsL( TInt aCurrentItem ); |
|
190 |
|
191 /** |
|
192 * Launches opening note. |
|
193 */ |
|
194 void LaunchNote(); |
|
195 |
|
196 /** |
|
197 * Same as above, but might leave. |
|
198 */ |
|
199 void LaunchNoteL(); |
|
200 |
|
201 /** |
|
202 * Removes opening note and stops listening for screensaver preview |
|
203 * state changes. |
|
204 */ |
|
205 void RemoveNote(); |
|
206 |
|
207 /** |
|
208 * Same as above, but might leave. |
|
209 */ |
|
210 void RemoveNoteL(); |
|
211 |
|
212 /** |
|
213 * Checks if screensaver function can be called, and if so makes |
|
214 * the call through PslnEngine. |
|
215 */ |
|
216 void DoInvokeScreenSaverFunctionL( |
|
217 const TInt aCurrentItem, |
|
218 const TScPluginCaps aType ); |
|
219 |
|
220 /** |
|
221 * Creates preview mode subscriber. |
|
222 */ |
|
223 void CreatePreviewModeSubscriberL(); |
|
224 |
|
225 /** |
|
226 * Creates preview state subscriber. |
|
227 */ |
|
228 void CreatePreviewStateSubscriberL(); |
|
229 |
|
230 /** |
|
231 * Remove command and label from MSK. |
|
232 */ |
|
233 void RemoveCommandFromMSK(); |
|
234 |
|
235 /** |
|
236 * Is 'Change' command visible. |
|
237 */ |
|
238 TBool IsChangeCommandVisibleL() const; |
|
239 |
|
240 /** |
|
241 * Is 'Apply' command visible. |
|
242 */ |
|
243 TBool IsApplyCommandVisibleL() const; |
|
244 |
|
245 /** |
|
246 * C++ default constructor. |
|
247 */ |
|
248 CPslnScreenSaverView(); |
|
249 |
|
250 /** |
|
251 * By default Symbian 2nd phase constructor is private. |
|
252 */ |
|
253 void ConstructL(); |
|
254 |
|
255 private: |
|
256 |
|
257 /** |
|
258 * Publish & Subscribe item for setting Preview mode. |
|
259 */ |
|
260 RProperty iPreviewModeProperty; |
|
261 |
|
262 /** |
|
263 * Publish & Subscribe item for setting Preview state. |
|
264 */ |
|
265 RProperty iPreviewStateProperty; |
|
266 |
|
267 /** |
|
268 * Publish & Subscribe listener for Preview mode. |
|
269 * Own. |
|
270 */ |
|
271 CPslnPropertySubscriber* iPreviewModeSubscriber; |
|
272 |
|
273 /** |
|
274 * Publish & Subscribe listener for Preview state. |
|
275 * Own. |
|
276 */ |
|
277 CPslnPropertySubscriber* iPreviewStateSubscriber; |
|
278 |
|
279 /** |
|
280 * Wait note wrapper. |
|
281 * Own. |
|
282 */ |
|
283 CAknWaitDialog* iWaitDlg; |
|
284 |
|
285 /** |
|
286 * Index of plugin screensaver that is previewed. |
|
287 */ |
|
288 TInt iScreenSaverPreviewIndex; |
|
289 |
|
290 /** |
|
291 * Repository for active screensaver. |
|
292 * Own. |
|
293 */ |
|
294 CRepository* iScreenSaverRepository; |
|
295 |
|
296 /** |
|
297 * Notifier for changes in the screensaver repository. |
|
298 * Own. |
|
299 */ |
|
300 CCenRepNotifyHandler* iScreenSaverNotifier; |
|
301 CPsmClient *iPsmClient; |
|
302 |
|
303 }; |
|
304 |
|
305 #endif // CPSLNSCREENSAVERVIEW_H |
|
306 |
|
307 // End of File |