engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcemds.h
changeset 71 27f2d7aec52a
parent 43 72396548277c
equal deleted inserted replaced
69:45459746d5e8 71:27f2d7aec52a
    38 
    38 
    39 #include <mdesession.h>
    39 #include <mdesession.h>
    40 
    40 
    41 #include <harvesterclient.h>
    41 #include <harvesterclient.h>
    42 #include <harvestereventenum.h>
    42 #include <harvestereventenum.h>
    43 
       
    44 #include <mglxtnstorage.h>
       
    45 #include <mpxcollectionmessagedefs.h>
    43 #include <mpxcollectionmessagedefs.h>
    46 
       
    47 #ifdef USE_S60_TNM
       
    48 #include <thumbnailmanager.h>
    44 #include <thumbnailmanager.h>
    49 #include <thumbnailmanagerobserver.h>
    45 #include <thumbnailmanagerobserver.h>
    50 #include <thumbnaildata.h>
    46 #include <thumbnaildata.h>
    51 #include <thumbnailobjectsource.h>
    47 #include <thumbnailobjectsource.h>
    52 
    48 
    53 #include "mthumbnailfetchrequestobserver.h"
    49 #include "mthumbnailfetchrequestobserver.h"
    54 #endif
       
    55 #include "glxdatasource.h"
    50 #include "glxdatasource.h"
    56 
    51 
    57 // FORWARD DECLARATIONS
    52 // FORWARD DECLARATIONS
    58 class CGlxRequest;
    53 class CGlxRequest;
    59 #ifndef USE_S60_TNM
       
    60 class CGlxtnThumbnailCreator;
       
    61 class CGlxtnThumbnailDatabase;
       
    62 #endif
       
    63 class CGlxDataSourceMde ;
    54 class CGlxDataSourceMde ;
    64 
    55 
    65 const TUid KHarvesterPSShutdown = { 0x200009F5 } ;
    56 const TUid KHarvesterPSShutdown = { 0x200009F5 } ;
    66 const TInt KMdSShutdown     = 0x00000002; // values 1 = shutdown, 0 = restart, normal state
    57 const TInt KMdSShutdown     = 0x00000002; // values 1 = shutdown, 0 = restart, normal state
    67 
    58 
   167                           public MGlxMDSShutdownObserver,
   158                           public MGlxMDSShutdownObserver,
   168                           public MMdEObjectObserver,
   159                           public MMdEObjectObserver,
   169                           public MMdEObjectPresentObserver,
   160                           public MMdEObjectPresentObserver,
   170                           public MMdERelationObserver,
   161                           public MMdERelationObserver,
   171                           public MMdERelationPresentObserver,
   162                           public MMdERelationPresentObserver,
   172                           public MHarvesterEventObserver
   163                           public MHarvesterEventObserver,
   173 #ifdef USE_S60_TNM
   164 						  public MThumbnailManagerObserver
   174 						, public MThumbnailManagerObserver
       
   175 #else
       
   176                         , public MGlxtnThumbnailStorageObserver
       
   177 #endif
       
   178     {
   165     {
   179 public:
   166 public:
   180     static CGlxDataSourceMde* NewL();
   167     static CGlxDataSourceMde* NewL();
   181 
   168 
   182 private:
   169 private:
   195     void HarvestingUpdated( 
   182     void HarvestingUpdated( 
   196                 HarvesterEventObserverType aHEObserverType, 
   183                 HarvesterEventObserverType aHEObserverType, 
   197                 HarvesterEventState aHarvesterEventState,
   184                 HarvesterEventState aHarvesterEventState,
   198                 TInt aItemsLeft );
   185                 TInt aItemsLeft );
   199 
   186 
   200 #ifdef USE_S60_TNM
       
   201 public:
   187 public:
   202 	void FetchThumbnailL(CGlxRequest* aRequest, 
   188 	void FetchThumbnailL(CGlxRequest* aRequest, 
   203 	        MThumbnailFetchRequestObserver& aObserver);
   189 	        MThumbnailFetchRequestObserver& aObserver);
   204 	TInt CancelFetchThumbnail();
   190 	TInt CancelFetchThumbnail();
   205 #else
       
   206 private: 
       
   207     // from MGlxtnThumbnailStorageObserver
       
   208     /**
       
   209     * Notify that a given thumbnail is available in storage.
       
   210     * @param aId Media item ID.
       
   211     * @param aSize Requested thumbnail size.
       
   212     */
       
   213     void ThumbnailAvailable(const TGlxMediaId& aId, const TSize& aSize);
       
   214     /**
       
   215     * Notify that a given thumbnail is available in storage.
       
   216     * @param aId Media item ID.
       
   217     * @param aSize Thumbnail size.
       
   218     */
       
   219     void BackgroundThumbnailError(const TGlxMediaId& aId, TInt aError);
       
   220 #endif
       
   221 
   191 
   222 private: 
   192 private: 
   223     /**
   193     /**
   224     *  from MMdESessionObserver
   194     *  from MMdESessionObserver
   225     */
   195     */
   255 	 * See @ref MMdERelationPresentObserver::HandleRelationPresentNotification
   225 	 * See @ref MMdERelationPresentObserver::HandleRelationPresentNotification
   256 	 */
   226 	 */
   257 	void HandleRelationPresentNotification(CMdESession& aSession,
   227 	void HandleRelationPresentNotification(CMdESession& aSession,
   258 			TBool aPresent, const RArray<TItemId>& aRelationIdArray);
   228 			TBool aPresent, const RArray<TItemId>& aRelationIdArray);
   259 
   229 
   260 #ifdef USE_S60_TNM
       
   261     // from MThumbnailManagerObserver
   230     // from MThumbnailManagerObserver
   262     void ThumbnailPreviewReady( MThumbnailData& aThumbnail,
   231     void ThumbnailPreviewReady( MThumbnailData& aThumbnail,
   263         TThumbnailRequestId aId );
   232         TThumbnailRequestId aId );
   264     
   233     
   265     void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail,
   234     void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail,
   266         TThumbnailRequestId aId );
   235         TThumbnailRequestId aId );
   267 #endif
       
   268 		
   236 		
   269 private:
   237 private:
   270     void BackgroundThumbnailMessageL(const TGlxMediaId& aId, const TSize& aSize, 
   238     void BackgroundThumbnailMessageL(const TGlxMediaId& aId, const TSize& aSize, 
   271             TInt aError);
   239             TInt aError);
   272 
   240 
   287     void PrepareMonthsL();
   255     void PrepareMonthsL();
   288     void TaskCompletedL();
   256     void TaskCompletedL();
   289 
   257 
   290     void TaskStartedL();
   258     void TaskStartedL();
   291     
   259     
   292 #ifdef USE_S60_TNM
       
   293     /*
   260     /*
   294      * This function doesnt add up any value, added to reduce compiler warnings
   261      * This function doesnt add up any value, added to reduce compiler warnings
   295      */
   262      */
   296     void ThumbnailReadyL( TInt aError, MThumbnailData& aThumbnail,
   263     void ThumbnailReadyL( TInt aError, MThumbnailData& aThumbnail,
   297         TThumbnailRequestId aId, TBool aQuality );
   264         TThumbnailRequestId aId, TBool aQuality );
   298 #endif
       
   299     
   265     
   300 public:
   266 public:
   301 
   267 
   302     void CreateSession();
   268     void CreateSession();
   303     
   269     
   304     inline CMdESession& Session() const;
   270     inline CMdESession& Session() const;
   305     
   271     
   306 #ifndef USE_S60_TNM
       
   307     inline CGlxtnThumbnailCreator& ThumbnailCreator() const;
       
   308 
       
   309     inline CGlxtnThumbnailDatabase& ThumbnailDatabase() const;
       
   310 #endif
       
   311 
       
   312     inline RFs& FileServerSession();
   272     inline RFs& FileServerSession();
   313 
   273 
   314     inline const TGlxMediaId& CameraAlbumId() const;
   274     inline const TGlxMediaId& CameraAlbumId() const;
   315 
   275 
   316     inline const TGlxMediaId& FavoritesId() const;
   276     inline const TGlxMediaId& FavoritesId() const;
   358 	
   318 	
   359 	// from MGlxMDSShutdownObserver
   319 	// from MGlxMDSShutdownObserver
   360     void ShutdownNotification(TInt aShutdownState);
   320     void ShutdownNotification(TInt aShutdownState);
   361 
   321 
   362 private:
   322 private:
   363 #ifdef USE_S60_TNM
       
   364 	MThumbnailFetchRequestObserver* iTnFetchObserver; 
   323 	MThumbnailFetchRequestObserver* iTnFetchObserver; 
   365     CThumbnailManager* iTnEngine;
   324     CThumbnailManager* iTnEngine;
   366     CFbsBitmap* iTnThumbnail;
   325     CFbsBitmap* iTnThumbnail;
   367     CFbsBitmap* iThumbnail;
   326     CFbsBitmap* iThumbnail;
   368     TThumbnailRequestId iTnThumbnailCbId;
   327     TThumbnailRequestId iTnThumbnailCbId;
   369     TBool iTnRequestInProgress;
   328     TBool iTnRequestInProgress;
   370     TInt iTnHandle;
   329     TInt iTnHandle;
   371     TGlxMediaId iMediaId;
   330     TGlxMediaId iMediaId;
   372     
   331     
   373 #else
       
   374     CGlxtnThumbnailCreator*   iThumbnailCreator;
       
   375     CGlxtnThumbnailDatabase*  iThumbnailDatabase;
       
   376 #endif
       
   377 
       
   378     CMdESession*              iSession;
   332     CMdESession*              iSession;
   379     RFs iFs;
   333     RFs iFs;
   380     TBool                     iSessionOpen;
   334     TBool                     iSessionOpen;
   381     TGlxMediaId               iCameraAlbumId;
   335     TGlxMediaId               iCameraAlbumId;
   382     TGlxMediaId               iFavoritesId;
   336     TGlxMediaId               iFavoritesId;