imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagprocessor.h
branchRCL_3
changeset 5 82749d516180
parent 0 2014ca87e772
child 9 2eb74cf6572e
equal deleted inserted replaced
1:235a7fc86938 5:82749d516180
    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"
       
    34 #include "tmformatobserver.h"
    32 
    35 
    33 //FORWARD DECLARATIONS
    36 //FORWARD DECLARATIONS
    34 class CThumbAGFormatObserver;
       
    35 class MMPXCollectionUtility;
    37 class MMPXCollectionUtility;
    36 
    38 
    37 /**
    39 /**
    38  *  Processor object for handling thumb generation
    40  *  Processor object for handling thumb generation
    39  *
    41  *
    41  */
    43  */
    42 class CThumbAGProcessor: public CActive,
    44 class CThumbAGProcessor: public CActive,
    43                          public MThumbnailManagerObserver,
    45                          public MThumbnailManagerObserver,
    44                          public MMdEQueryObserver,
    46                          public MMdEQueryObserver,
    45                          public MHarvesterEventObserver,
    47                          public MHarvesterEventObserver,
    46                          public MMPXCollectionObserver
    48                          public MMPXCollectionObserver,
       
    49                          public MHWRMLightObserver,
       
    50                          public MTMActivityManagerObserver,
       
    51                          public MTMFormatObserver
    47     {
    52     {
    48 public:
    53 public:
    49 
    54 
    50     /**
    55     /**
    51      * Two-phased constructor.
    56      * Two-phased constructor.
    78     void HarvestingUpdated( 
    83     void HarvestingUpdated( 
    79              HarvesterEventObserverType aHEObserverType, 
    84              HarvesterEventObserverType aHEObserverType, 
    80              HarvesterEventState aHarvesterEventState,
    85              HarvesterEventState aHarvesterEventState,
    81              TInt aItemsLeft );
    86              TInt aItemsLeft );
    82     
    87     
    83 private: // From MMPXCollectionObserver
    88     //From MTMFormatObserver
       
    89     void FormatNotification(TBool aFormat);
       
    90     
       
    91 private: 
       
    92     // From MMPXCollectionObserver
    84     /// See @ref MMPXCollectionObserver::HandleCollectionMessageL
    93     /// See @ref MMPXCollectionObserver::HandleCollectionMessageL
    85     void HandleCollectionMessage( CMPXMessage* aMessage,  TInt aError );
    94     void HandleCollectionMessage( CMPXMessage* aMessage,  TInt aError );
    86 
    95 
    87     /// See @ref MMPXCollectionObserver::HandleOpenL
    96     /// See @ref MMPXCollectionObserver::HandleOpenL
    88     void HandleOpenL(const CMPXMedia& aEntries, TInt aIndex, TBool aComplete, TInt aError);
    97     void HandleOpenL(const CMPXMedia& aEntries, TInt aIndex, TBool aComplete, TInt aError);
    90     /// See @ref MMPXCollectionObserver::HandleOpenL
    99     /// See @ref MMPXCollectionObserver::HandleOpenL
    91     void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist, TInt aError);  
   100     void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist, TInt aError);  
    92     
   101     
    93     /// See @ref MMPXCollectionObserver::HandleCollectionMediaL
   102     /// See @ref MMPXCollectionObserver::HandleCollectionMediaL
    94     void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError );
   103     void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError );
    95 
   104     
       
   105 private: //From MHWRMLightObserver
       
   106     void LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus);
       
   107     
       
   108 private: //From MTMActivityManagerObserver
       
   109     void ActivityDetected();
       
   110     void InactivityDetected();
       
   111     
    96 public:     
   112 public:     
    97     
   113     
    98     /**
   114     /**
    99      * Sets MdE Session
   115      * Sets MdE Session
   100      *
   116      *
   129      */
   145      */
   130     void RemoveFromQueues( const RArray<TItemId>& aIDArray, const TBool aRemoveFromDelete = EFalse);
   146     void RemoveFromQueues( const RArray<TItemId>& aIDArray, const TBool aRemoveFromDelete = EFalse);
   131     
   147     
   132     void SetForceRun( const TBool aForceRun );
   148     void SetForceRun( const TBool aForceRun );
   133     
   149     
   134     void SetFormat(TBool aStatus);
   150     TBool IsInactive();
   135     
   151     
   136     void QueryForPlaceholdersL();
       
   137 
       
   138 protected:
   152 protected:
   139     
   153     
       
   154     void QueryAllItemsL();
       
   155     
   140     /**
   156     /**
   141      * QueryL
   157      * QueryL
   142      *
   158      *
   143      * @since S60 v5.0
   159      * @since S60 v5.0
   144      * @param aIDArray Item IDs to query
   160      * @param aIDArray Item IDs to query
   145      */
   161      */
   146     void QueryL( RArray<TItemId>& aIDArray );
   162     void QueryL( RArray<TItemId>& aIDArray );
   147     
   163     
       
   164     void QueryPlaceholdersL();
       
   165     
   148 protected:
   166 protected:
   149 
   167 
   150     /**
   168     /**
   151      * Handles an active object's request completion event.
   169      * Handles an active object's request completion event.
   152      *
   170      *
   217      * Cancel timeout timer
   235      * Cancel timeout timer
   218      *
   236      *
   219      * @since S60 v5.0
   237      * @since S60 v5.0
   220      */
   238      */
   221     void CancelTimeout();
   239     void CancelTimeout();
   222 
   240        
   223 private:
   241 private:
   224     
   242     
   225     // not own
   243     // not own
   226     CMdESession* iMdESession;
   244     CMdESession* iMdESession;
   227     CMdENamespaceDef* iDefNamespace;
   245     CMdENamespaceDef* iDefNamespace;
   228     
   246     
   229     // own
   247     // own
   230     CThumbnailManager* iTMSession;
   248     CThumbnailManager* iTMSession;
   231     CMdEObjectQuery* iQuery;
   249     CMdEObjectQuery* iQuery;
   232     CMdEObjectQuery* iQueryForPlaceholders;
   250     CMdEObjectQuery* iQueryAllItems;
       
   251     CMdEObjectQuery* iQueryPlaceholders;
   233     
   252     
   234     RArray<TItemId> iAddQueue;
   253     RArray<TItemId> iAddQueue;
   235     RArray<TItemId> iModifyQueue;
   254     RArray<TItemId> iModifyQueue;
   236     RArray<TItemId> iRemoveQueue;
   255     RArray<TItemId> iRemoveQueue;
   237     RArray<TItemId> iPresentQueue;
       
   238     RArray<TItemId> iQueryQueue;
   256     RArray<TItemId> iQueryQueue;
   239     
   257     RArray<TItemId> iPlaceholderQueue;
   240     RArray<TItemId> iTempModifyQueue;
   258     
   241     RArray<TItemId> iTempAddQueue;
       
   242     
       
   243     RArray<TItemId> iPlaceholderIDs;
       
   244     
   259     
   245     TBool iQueryActive;
   260     TBool iQueryActive;
   246     TBool iQueryReady;
   261     TBool iQueryReady;
   247     
       
   248     TBool iQueryForPlaceholdersActive;
       
   249     
   262     
   250     TBool iModify;
   263     TBool iModify;
   251     TInt iProcessingCount;
   264     TInt iProcessingCount;
   252 
   265 
   253     //Flag is MDS Harvester harevsting
   266     //Flag is MDS Harvester harevsting
   254     TBool iHarvesting;
   267     TBool iHarvesting;
   255     TBool iHarvestingTemp;
   268     TBool iHarvestingTemp;
   256     
   269     
       
   270 	//Flag is MDS placeholder harvesting active
       
   271     TBool iPHHarvesting;
       
   272     TBool iPHHarvestingTemp;
       
   273     
   257     CPeriodic* iPeriodicTimer;
   274     CPeriodic* iPeriodicTimer;
   258     TBool iTimerActive;
       
   259 
   275 
   260 	//MDS Harvester client
   276 	//MDS Harvester client
   261     RHarvesterClient iHarvesterClient;
   277     RHarvesterClient iHarvesterClient;
   262 
   278 
   263     //Set when running RunL() first time
   279     //Set when running RunL() first time
   278 	//request pending in TNM side
   294 	//request pending in TNM side
   279     TBool iActive;
   295     TBool iActive;
   280     //PS key to get info server's idle status
   296     //PS key to get info server's idle status
   281     RProperty iProperty;
   297     RProperty iProperty;
   282     
   298     
   283     CThumbAGFormatObserver* iFormatObserver;
   299     CTMFormatObserver* iFormatObserver;
   284    
   300    
   285     TBool iFormatting;
   301     TBool iFormatting;
   286     TBool iSessionDied;
   302     TBool iSessionDied;
   287    
   303    
   288     TInt iActiveCount;
   304     TInt iActiveCount;
   289     
   305     
   290     MMPXCollectionUtility* iCollectionUtility; // own
   306     MMPXCollectionUtility* iCollectionUtility; // own
   291     
   307     
   292 	//Flag is MPX harvesting or MTP synchronisation in progress
   308 	//Flag is MPX harvesting or MTP synchronisation in progress
   293     TBool iMPXHarvesting;
   309     TBool iMPXHarvesting;
       
   310     //inactivity polling timer
       
   311     CPeriodic* iInactivityTimer;
       
   312     //overall status of device
       
   313     TBool iIdle;
       
   314     
       
   315     //Backlight control 
       
   316     CHWRMLight* iLight;
       
   317 	#ifdef _DEBUG 
       
   318     TInt iLightMask;
       
   319 	#endif
       
   320     //backlight status
       
   321     TBool iLights;
       
   322     
       
   323     CTMActivityManager* iActivityManager;
   294 };
   324 };
   295 
   325 
   296 #endif // THUMBAGPROCESSOR_H
   326 #endif // THUMBAGPROCESSOR_H