31 #include <ScreensaverInternalPSKeys.h> |
31 #include <ScreensaverInternalPSKeys.h> |
32 |
32 |
33 #include <MCLFOperationObserver.h> |
33 #include <MCLFOperationObserver.h> |
34 #include <MCLFContentListingEngine.h> |
34 #include <MCLFContentListingEngine.h> |
35 #include <MCLFItemListModel.h> |
35 #include <MCLFItemListModel.h> |
|
36 #include <mdesession.h> |
|
37 #include <mdequery.h> |
36 |
38 |
37 #include "SlideshowModel.h" |
39 #include "SlideshowModel.h" |
38 #include "SlideshowSlide.h" |
40 #include "SlideshowSlide.h" |
39 #include "SlideshowPluginUtils.h" |
41 #include "SlideshowPluginUtils.h" |
40 |
42 |
41 class CEikonEnv; |
43 class CEikonEnv; |
42 class CDRMHelper; |
44 class CDRMHelper; |
43 class CRepositoryWatcher; |
45 class CRepositoryWatcher; |
44 class CRepository; |
46 class CRepository; |
45 |
|
46 |
47 |
47 /** |
48 /** |
48 * Encapsulates the Settings that are written into the central repository |
49 * Encapsulates the Settings that are written into the central repository |
49 * @lib ScreenSaverAnimPlugin.lib |
50 * @lib ScreenSaverAnimPlugin.lib |
50 * @since 3.1 |
51 * @since 3.1 |
75 * to the format specific plugins like SVG, Flash, M3G etc. |
76 * to the format specific plugins like SVG, Flash, M3G etc. |
76 * @lib ScreenSaverAnimPlugin.lib |
77 * @lib ScreenSaverAnimPlugin.lib |
77 * @since 3.1 |
78 * @since 3.1 |
78 */ |
79 */ |
79 class CSlideshowPlugin: public CScreensaverPluginInterfaceDefinition, |
80 class CSlideshowPlugin: public CScreensaverPluginInterfaceDefinition, |
80 public MCLFOperationObserver |
81 public MMdESessionObserver, |
|
82 public MMdEQueryObserver |
81 { |
83 { |
82 enum TPluginState |
84 enum TPluginState |
83 { |
85 { |
84 EPluginStateLoading = 0, |
86 EPluginStateLoading = 0, |
85 EPluginStateInitializing, |
87 EPluginStateInitializing, |
161 */ |
163 */ |
162 virtual TInt HandleScreensaverEventL( |
164 virtual TInt HandleScreensaverEventL( |
163 TScreensaverEvent aEvent, |
165 TScreensaverEvent aEvent, |
164 TAny* aData ); |
166 TAny* aData ); |
165 |
167 |
166 |
168 public: // from MMdESessionObserver |
167 public: // From MCLFOperationObserver |
169 /** |
168 |
170 * Called to notify the observer that opening the session has been |
169 /** |
171 * completed and, if the opening succeeded, the session is ready for use. |
170 * From MCLFOperationObserver. Called by CLF when e.g. a content listing |
172 * |
171 * operation is finished. |
173 * @param aSession session |
172 * @since S60 3.1 |
174 * @param aError <code>KErrNone</code>, if opening the session succeeded; |
173 * @param aOperationEvent Operation event code of the event |
175 * or one of the system-wide error codes, if opening the |
174 * @param aError System wide error code if the operation did not |
176 * session failed |
175 * succeed. |
177 */ |
176 */ |
178 void HandleSessionOpened(CMdESession& aSession, TInt aError); |
177 virtual void HandleOperationEventL(TCLFOperationEvent aOperationEvent, |
179 |
178 TInt aError); |
180 /** |
179 |
181 * Called to notify the observer about errors, which are not a direct |
180 |
182 * consequence of the operations initiated by the client but caused by |
|
183 * some external source (e.g., other clients). The error cannot be |
|
184 * recovered and all on-going operations initiated by the client have been |
|
185 * aborted. Any attempts to continue using the session will cause a panic. |
|
186 * The client should close the session immediately and try to open a new |
|
187 * session, if it needs to continue using the metadata engine. |
|
188 * |
|
189 * @param aSession session |
|
190 * @param aError one of the system-wide error codes |
|
191 */ |
|
192 void HandleSessionError(CMdESession& aSession, TInt aError); |
|
193 |
|
194 public: // from MMdEQueryObserver |
|
195 /** |
|
196 * Called to notify the observer that new results have been received |
|
197 * in the query. |
|
198 * |
|
199 * @param aQuery Query instance that received new results. |
|
200 * @param aFirstNewItemIndex Index of the first new item that was added |
|
201 * to the result item array. |
|
202 * @param aNewItemCount Number of items added to the result item |
|
203 * array. |
|
204 */ |
|
205 void HandleQueryNewResults(CMdEQuery& aQuery, |
|
206 TInt aFirstNewItemIndex, |
|
207 TInt aNewItemCount); |
|
208 |
|
209 /** |
|
210 * Called to notify the observer that the query has been completed, |
|
211 * or that an error has occured. |
|
212 * |
|
213 * @param aQuery Query instance. |
|
214 * @param aError <code>KErrNone</code>, if the query was completed |
|
215 * successfully. Otherwise one of the system-wide error |
|
216 * codes. |
|
217 */ |
|
218 void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError); |
|
219 |
181 public: // New Functions |
220 public: // New Functions |
182 |
221 |
183 /** |
222 /** |
184 * Reads the settings from the central repository |
223 * Reads the settings from the central repository |
185 * @since 3.1 |
224 * @since 3.1 |
257 void UpdateDisplayInfo(); |
296 void UpdateDisplayInfo(); |
258 void FlushDrawBuffer(); |
297 void FlushDrawBuffer(); |
259 |
298 |
260 TInt SettingsChanged(); |
299 TInt SettingsChanged(); |
261 |
300 |
262 void ConnectToCLFL(); |
301 void ConnectToMDSSessionL(); |
263 void WaitForCLF(); |
302 void WaitForMDS(); |
264 void EndWaitForCLF(); |
303 void EndWaitForMDS(); |
|
304 void LoadImagesToModel(const CMdEQuery& aQuery, |
|
305 TInt aFirstNewItemIndex = 0, |
|
306 TInt aNewItemCount = 0); |
|
307 void AppendSlideToModelL(TDesC& aFileName, TBool aIsOnMC); |
|
308 void OpenQueryL(); |
265 |
309 |
266 private: |
310 private: |
267 // Pointer to the screensaver host |
311 // Pointer to the screensaver host |
268 MScreensaverPluginHost* iHost; |
312 MScreensaverPluginHost* iHost; |
269 |
313 |
295 CPSSubscriber* iSettingsChangedSubscriber; |
339 CPSSubscriber* iSettingsChangedSubscriber; |
296 |
340 |
297 // Localised name |
341 // Localised name |
298 HBufC* iScreensaverName; |
342 HBufC* iScreensaverName; |
299 |
343 |
300 // Gallery content listing engine |
|
301 MCLFContentListingEngine* iCLFEngine; |
|
302 |
|
303 // Gallery content listing model |
|
304 MCLFItemListModel* iCLFModel; |
|
305 |
|
306 // CLF status |
|
307 TInt iCLFError; |
|
308 |
|
309 // CLF model state |
|
310 TBool iCLFModelUpToDate; |
|
311 |
|
312 |
|
313 // Waiter |
344 // Waiter |
314 CActiveSchedulerWait iWaiter; |
345 CActiveSchedulerWait iWaiter; |
315 TBool iWaitActive; |
346 TBool iWaitActive; |
316 |
347 |
317 // Draw count |
348 // Draw count |
318 TInt iDrawCount; |
349 TInt iDrawCount; |
319 TBool iTimerUpdated; |
350 TBool iTimerUpdated; |
320 |
351 |
321 //loading state |
352 //loading state |
322 TBool iIsLoadFinished; |
353 TBool iIsLoadFinished; |
|
354 |
|
355 // MDS session |
|
356 CMdESession* iMdESession; |
323 }; |
357 }; |
324 |
358 |
325 |
359 |
326 #endif // C_SLIDESHOWPLUGIN_H |
360 #endif // C_SLIDESHOWPLUGIN_H |
327 // End Of file |
361 // End Of file |