diff -r 235a7fc86938 -r 2edacbf5d3f9 imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagprocessor.h --- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagprocessor.h Tue Feb 02 00:23:15 2010 +0200 +++ b/imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagprocessor.h Fri Mar 19 09:35:30 2010 +0200 @@ -29,9 +29,11 @@ #include #include #include +#include "tmactivitymanager.h" +#include "tmformatobserver.h" +#include "tmrpropertyobserver.h" //FORWARD DECLARATIONS -class CThumbAGFormatObserver; class MMPXCollectionUtility; /** @@ -43,7 +45,10 @@ public MThumbnailManagerObserver, public MMdEQueryObserver, public MHarvesterEventObserver, - public MMPXCollectionObserver + public MMPXCollectionObserver, + public MTMActivityManagerObserver, + public MTMFormatObserver, + public MTMRPropertyObserver { public: @@ -80,7 +85,11 @@ HarvesterEventState aHarvesterEventState, TInt aItemsLeft ); -private: // From MMPXCollectionObserver + //From MTMFormatObserver + void FormatNotification(TBool aFormat); + +private: + // From MMPXCollectionObserver /// See @ref MMPXCollectionObserver::HandleCollectionMessageL void HandleCollectionMessage( CMPXMessage* aMessage, TInt aError ); @@ -92,7 +101,13 @@ /// See @ref MMPXCollectionObserver::HandleCollectionMediaL void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError ); - + +private: //From MTMActivityManagerObserver + void ActivityChanged(const TBool aActive); + +private: //From MTMRPropertyObserver + void RPropertyNotification(const TInt aError, const TUid aKeyCategory, const TUint aPropertyKey, const TInt aValue); + public: /** @@ -111,7 +126,7 @@ * @param aIDArray IDs for thumbnail creation * @param aForce pass ETrue if processor is forced to run without waiting harvesting complete */ - void AddToQueueL( TObserverNotificationType aType, const RArray& aIDArray, TBool aPresent ); + void AddToQueueL( TObserverNotificationType aType, const RArray& aIDArray, const RPointerArray& aObjectUriArray, TBool aPresent ); /** * Calls Thumbnail Manager to create thumbnails @@ -131,11 +146,9 @@ void SetForceRun( const TBool aForceRun ); - void SetFormat(TBool aStatus); +protected: - void QueryForPlaceholdersL(); - -protected: + void QueryAllItemsL(); /** * QueryL @@ -145,6 +158,8 @@ */ void QueryL( RArray& aIDArray ); + void QueryPlaceholdersL(); + protected: /** @@ -219,7 +234,15 @@ * @since S60 v5.0 */ void CancelTimeout(); - + + /** + * Update KItemsLeft PS value + * + * @since S60 v5.0 + * @param aDefine (re)define PS key before setting value + */ + void UpdatePSValues(const TBool aDefine = EFalse); + private: // not own @@ -229,24 +252,24 @@ // own CThumbnailManager* iTMSession; CMdEObjectQuery* iQuery; - CMdEObjectQuery* iQueryForPlaceholders; + CMdEObjectQuery* iQueryAllItems; + CMdEObjectQuery* iQueryPlaceholders; RArray iAddQueue; RArray iModifyQueue; - RArray iRemoveQueue; - RArray iPresentQueue; + RPointerArray iRemoveQueue; RArray iQueryQueue; + RArray iPlaceholderQueue; + //not processing queue, used to keep KItemsLeft PS correct + RArray i2ndRoundGenerateQueue; + //reference to current processing queue + RArray* iLastQueue; - RArray iTempModifyQueue; - RArray iTempAddQueue; - - RArray iPlaceholderIDs; + TBool i2ndRound; TBool iQueryActive; TBool iQueryReady; - TBool iQueryForPlaceholdersActive; - TBool iModify; TInt iProcessingCount; @@ -254,8 +277,11 @@ TBool iHarvesting; TBool iHarvestingTemp; + //Flag is MDS placeholder harvesting active + TBool iPHHarvesting; + TBool iPHHarvestingTemp; + CPeriodic* iPeriodicTimer; - TBool iTimerActive; //MDS Harvester client RHarvesterClient iHarvesterClient; @@ -263,24 +289,22 @@ //Set when running RunL() first time TBool iInit; + //2nd phase init after MDE session is open + TBool iInit2; + // auto create TBool iAutoImage; TBool iAutoVideo; TBool iAutoAudio; -#ifdef _DEBUG - TUint32 iAddCounter; - TUint32 iModCounter; - TUint32 iDelCounter; -#endif - + // in case of modified files force TN update TBool iForceRun; + // controlled by Photos application to run TN generation on foreground + TBool iForegroundRun; //request pending in TNM side TBool iActive; - //PS key to get info server's idle status - RProperty iProperty; - - CThumbAGFormatObserver* iFormatObserver; + + CTMFormatObserver* iFormatObserver; TBool iFormatting; TBool iSessionDied; @@ -291,6 +315,19 @@ //Flag is MPX harvesting or MTP synchronisation in progress TBool iMPXHarvesting; + //inactivity polling timer + CPeriodic* iInactivityTimer; + //overall status of device + TBool iIdle; + + CTMActivityManager* iActivityManager; + + //Observer foreground generation + CTMRPropertyObserver* iForegroundGenerationObserver; + + //Previously notified amount of items in processing queues (add/modify) + TInt iPreviousItemsLeft; + TBool iPreviousDaemonProcessing; }; #endif // THUMBAGPROCESSOR_H