equal
deleted
inserted
replaced
27 #include <mdeobjectquery.h> |
27 #include <mdeobjectquery.h> |
28 #include "thumbnaillog.h" |
28 #include "thumbnaillog.h" |
29 #include <harvesterclient.h> |
29 #include <harvesterclient.h> |
30 #include <e32property.h> |
30 #include <e32property.h> |
31 #include <mpxcollectionobserver.h> |
31 #include <mpxcollectionobserver.h> |
32 #include <hwrmlight.h> |
|
33 #include "tmactivitymanager.h" |
32 #include "tmactivitymanager.h" |
34 #include "tmformatobserver.h" |
33 #include "tmformatobserver.h" |
|
34 #include "tmrpropertyobserver.h" |
35 |
35 |
36 //FORWARD DECLARATIONS |
36 //FORWARD DECLARATIONS |
37 class MMPXCollectionUtility; |
37 class MMPXCollectionUtility; |
38 |
38 |
39 /** |
39 /** |
44 class CThumbAGProcessor: public CActive, |
44 class CThumbAGProcessor: public CActive, |
45 public MThumbnailManagerObserver, |
45 public MThumbnailManagerObserver, |
46 public MMdEQueryObserver, |
46 public MMdEQueryObserver, |
47 public MHarvesterEventObserver, |
47 public MHarvesterEventObserver, |
48 public MMPXCollectionObserver, |
48 public MMPXCollectionObserver, |
49 public MHWRMLightObserver, |
|
50 public MTMActivityManagerObserver, |
49 public MTMActivityManagerObserver, |
51 public MTMFormatObserver |
50 public MTMFormatObserver, |
|
51 public MTMRPropertyObserver |
52 { |
52 { |
53 public: |
53 public: |
54 |
54 |
55 /** |
55 /** |
56 * Two-phased constructor. |
56 * Two-phased constructor. |
100 void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist, TInt aError); |
100 void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist, TInt aError); |
101 |
101 |
102 /// See @ref MMPXCollectionObserver::HandleCollectionMediaL |
102 /// See @ref MMPXCollectionObserver::HandleCollectionMediaL |
103 void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError ); |
103 void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError ); |
104 |
104 |
105 private: //From MHWRMLightObserver |
|
106 void LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus); |
|
107 |
|
108 private: //From MTMActivityManagerObserver |
105 private: //From MTMActivityManagerObserver |
109 void ActivityDetected(); |
106 void ActivityChanged(const TBool aActive); |
110 void InactivityDetected(); |
107 |
|
108 private: //From MTMRPropertyObserver |
|
109 void RPropertyNotification(const TInt aError, const TUid aKeyCategory, const TUint aPropertyKey, const TInt aValue); |
111 |
110 |
112 public: |
111 public: |
113 |
112 |
114 /** |
113 /** |
115 * Sets MdE Session |
114 * Sets MdE Session |
125 * @since S60 v5.0 |
124 * @since S60 v5.0 |
126 * @param aType TObserverNotificationType |
125 * @param aType TObserverNotificationType |
127 * @param aIDArray IDs for thumbnail creation |
126 * @param aIDArray IDs for thumbnail creation |
128 * @param aForce pass ETrue if processor is forced to run without waiting harvesting complete |
127 * @param aForce pass ETrue if processor is forced to run without waiting harvesting complete |
129 */ |
128 */ |
130 void AddToQueueL( TObserverNotificationType aType, const RArray<TItemId>& aIDArray, TBool aPresent ); |
129 void AddToQueueL( TObserverNotificationType aType, const RArray<TItemId>& aIDArray, const RPointerArray<HBufC>& aObjectUriArray, TBool aPresent ); |
131 |
130 |
132 /** |
131 /** |
133 * Calls Thumbnail Manager to create thumbnails |
132 * Calls Thumbnail Manager to create thumbnails |
134 * |
133 * |
135 * @since S60 v5.0 |
134 * @since S60 v5.0 |
145 */ |
144 */ |
146 void RemoveFromQueues( const RArray<TItemId>& aIDArray, const TBool aRemoveFromDelete = EFalse); |
145 void RemoveFromQueues( const RArray<TItemId>& aIDArray, const TBool aRemoveFromDelete = EFalse); |
147 |
146 |
148 void SetForceRun( const TBool aForceRun ); |
147 void SetForceRun( const TBool aForceRun ); |
149 |
148 |
150 TBool IsInactive(); |
|
151 |
|
152 protected: |
149 protected: |
153 |
150 |
154 void QueryAllItemsL(); |
151 void QueryAllItemsL(); |
155 |
152 |
156 /** |
153 /** |
235 * Cancel timeout timer |
232 * Cancel timeout timer |
236 * |
233 * |
237 * @since S60 v5.0 |
234 * @since S60 v5.0 |
238 */ |
235 */ |
239 void CancelTimeout(); |
236 void CancelTimeout(); |
|
237 |
|
238 /** |
|
239 * Update KItemsLeft PS value |
|
240 * |
|
241 * @since S60 v5.0 |
|
242 * @param aDefine (re)define PS key before setting value |
|
243 */ |
|
244 void UpdatePSValues(const TBool aDefine = EFalse); |
240 |
245 |
241 private: |
246 private: |
242 |
247 |
243 // not own |
248 // not own |
244 CMdESession* iMdESession; |
249 CMdESession* iMdESession; |
250 CMdEObjectQuery* iQueryAllItems; |
255 CMdEObjectQuery* iQueryAllItems; |
251 CMdEObjectQuery* iQueryPlaceholders; |
256 CMdEObjectQuery* iQueryPlaceholders; |
252 |
257 |
253 RArray<TItemId> iAddQueue; |
258 RArray<TItemId> iAddQueue; |
254 RArray<TItemId> iModifyQueue; |
259 RArray<TItemId> iModifyQueue; |
255 RArray<TItemId> iRemoveQueue; |
260 RPointerArray<HBufC> iRemoveQueue; |
256 RArray<TItemId> iQueryQueue; |
261 RArray<TItemId> iQueryQueue; |
257 RArray<TItemId> iPlaceholderQueue; |
262 RArray<TItemId> iPlaceholderQueue; |
258 |
263 //not processing queue, used to keep KItemsLeft PS correct |
|
264 RArray<TItemId> i2ndRoundGenerateQueue; |
|
265 //reference to current processing queue |
|
266 RArray<TItemId>* iLastQueue; |
|
267 |
|
268 TBool i2ndRound; |
259 |
269 |
260 TBool iQueryActive; |
270 TBool iQueryActive; |
261 TBool iQueryReady; |
271 TBool iQueryReady; |
262 |
272 |
263 TBool iModify; |
273 TBool iModify; |
276 //MDS Harvester client |
286 //MDS Harvester client |
277 RHarvesterClient iHarvesterClient; |
287 RHarvesterClient iHarvesterClient; |
278 |
288 |
279 //Set when running RunL() first time |
289 //Set when running RunL() first time |
280 TBool iInit; |
290 TBool iInit; |
|
291 |
|
292 //2nd phase init after MDE session is open |
|
293 TBool iInit2; |
281 |
294 |
282 // auto create |
295 // auto create |
283 TBool iAutoImage; |
296 TBool iAutoImage; |
284 TBool iAutoVideo; |
297 TBool iAutoVideo; |
285 TBool iAutoAudio; |
298 TBool iAutoAudio; |
286 |
299 |
287 #ifdef _DEBUG |
300 // in case of modified files force TN update |
288 TUint32 iAddCounter; |
|
289 TUint32 iModCounter; |
|
290 TUint32 iDelCounter; |
|
291 #endif |
|
292 |
|
293 TBool iForceRun; |
301 TBool iForceRun; |
|
302 // controlled by Photos application to run TN generation on foreground |
|
303 TBool iForegroundRun; |
294 //request pending in TNM side |
304 //request pending in TNM side |
295 TBool iActive; |
305 TBool iActive; |
296 //PS key to get info server's idle status |
306 |
297 RProperty iProperty; |
|
298 |
|
299 CTMFormatObserver* iFormatObserver; |
307 CTMFormatObserver* iFormatObserver; |
300 |
308 |
301 TBool iFormatting; |
309 TBool iFormatting; |
302 TBool iSessionDied; |
310 TBool iSessionDied; |
303 |
311 |
310 //inactivity polling timer |
318 //inactivity polling timer |
311 CPeriodic* iInactivityTimer; |
319 CPeriodic* iInactivityTimer; |
312 //overall status of device |
320 //overall status of device |
313 TBool iIdle; |
321 TBool iIdle; |
314 |
322 |
315 //Backlight control |
|
316 CHWRMLight* iLight; |
|
317 #ifdef _DEBUG |
|
318 TInt iLightMask; |
|
319 #endif |
|
320 //backlight status |
|
321 TBool iLights; |
|
322 |
|
323 CTMActivityManager* iActivityManager; |
323 CTMActivityManager* iActivityManager; |
|
324 |
|
325 //Observer foreground generation |
|
326 CTMRPropertyObserver* iForegroundGenerationObserver; |
|
327 |
|
328 //Previously notified amount of items in processing queues (add/modify) |
|
329 TInt iPreviousItemsLeft; |
|
330 TBool iPreviousDaemonProcessing; |
324 }; |
331 }; |
325 |
332 |
326 #endif // THUMBAGPROCESSOR_H |
333 #endif // THUMBAGPROCESSOR_H |