mtpdataproviders/mtpimagedp/src/cmtpimagedp.cpp
branchRCL_3
changeset 3 8b094906a049
parent 2 4843bb5893b6
child 5 3673b591050c
equal deleted inserted replaced
2:4843bb5893b6 3:8b094906a049
    95 void CMTPImageDataProvider::ConstructL()
    95 void CMTPImageDataProvider::ConstructL()
    96     {
    96     {
    97     __FLOG_OPEN(KMTPSubsystem, KComponent);
    97     __FLOG_OPEN(KMTPSubsystem, KComponent);
    98     __FLOG(_L8(">> CMTPImageDataProvider::ConstructL"));
    98     __FLOG(_L8(">> CMTPImageDataProvider::ConstructL"));
    99     
    99     
   100     iPropertyMgr = CMTPImageDpObjectPropertyMgr::NewL(Framework(), *this);
       
   101     iThumbnailManager = CMTPImageDpThumbnailCreator::NewL(*this);
   100     iThumbnailManager = CMTPImageDpThumbnailCreator::NewL(*this);
   102     iMdeObserver = CMTPImageDpMdeObserver::NewL(Framework(), *this);
       
   103     iMdeObserver->SubscribeForChangeNotificationL();
       
   104     iNewPicNotifier = CMTPImageDpNewPicturesNotifier::NewL();
   101     iNewPicNotifier = CMTPImageDpNewPicturesNotifier::NewL();
   105     
   102     
   106     //Setup central repository connection
   103     //Setup central repository connection
   107     const TUint32 KUidMTPImageRepositoryValue(0x2001FCA2);
   104     const TUint32 KUidMTPImageRepositoryValue(0x2001FCA2);
   108     const TUid KUidMTPImageRepository = {KUidMTPImageRepositoryValue};
   105     const TUid KUidMTPImageRepository = {KUidMTPImageRepositoryValue};
   271 */
   268 */
   272 void CMTPImageDataProvider::StartObjectEnumerationL(TUint32 aStorageId, TBool /*aPersistentFullEnumeration*/)
   269 void CMTPImageDataProvider::StartObjectEnumerationL(TUint32 aStorageId, TBool /*aPersistentFullEnumeration*/)
   273     {
   270     {
   274     __FLOG(_L8(">> StartObjectEnumerationL"));
   271     __FLOG(_L8(">> StartObjectEnumerationL"));
   275     
   272     
       
   273     TBool isComplete = ETrue;
   276     if (aStorageId == KMTPStorageAll)
   274     if (aStorageId == KMTPStorageAll)
   277         {
   275         {
   278         /*
   276         /*
   279          * framework notify data provider to enumerate
   277          * framework notify data provider to enumerate
   280          * 
   278          * 
   281          */
   279          */
       
   280         if (iPropertyMgr == NULL)
       
   281             {
       
   282             iPropertyMgr = CMTPImageDpObjectPropertyMgr::NewL(Framework(), *this);
       
   283             isComplete = EFalse;
       
   284             }
       
   285   
   282         iEnumerated = ETrue;
   286         iEnumerated = ETrue;
   283         }
   287         }
   284 
   288 
   285     NotifyEnumerationCompleteL(aStorageId, KErrNone);
   289     if (isComplete)
       
   290         {
       
   291         NotifyEnumerationCompleteL(aStorageId, KErrNone);
       
   292         }
   286     
   293     
   287     __FLOG(_L8("<< StartObjectEnumerationL"));
   294     __FLOG(_L8("<< StartObjectEnumerationL"));
   288     }
   295     }
   289 
   296 
   290 
   297 
   396         aStrings.AppendL(KFormatExtensionJpeg);
   403         aStrings.AppendL(KFormatExtensionJpeg);
   397         
   404         
   398         /*
   405         /*
   399          * bmp files
   406          * bmp files
   400          */
   407          */
   401 //        _LIT(KFormatExtensionBmp, "0x3804:bmp::3");
   408         _LIT(KFormatExtensionBmp, "0x3804:bmp::3");
   402 //        aStrings.AppendL(KFormatExtensionBmp);
   409         aStrings.AppendL(KFormatExtensionBmp);
   403         
   410         
   404         /*
   411         /*
   405          * gif files
   412          * gif files
   406          */
   413          */
   407 //        _LIT(KFormatExtensionGif, "0x3807:gif::3");
   414         _LIT(KFormatExtensionGif, "0x3807:gif::3");
   408 //        aStrings.AppendL(KFormatExtensionGif);
   415         aStrings.AppendL(KFormatExtensionGif);
   409         
   416         
   410         /*
   417         /*
   411          * png files
   418          * png files
   412          */
   419          */
   413 //        _LIT(KFormatExtensionPng, "0x380B:png::3");
   420         _LIT(KFormatExtensionPng, "0x380B:png::3");
   414 //        aStrings.AppendL(KFormatExtensionPng);
   421         aStrings.AppendL(KFormatExtensionPng);
   415         
   422         
   416         /*
   423         /*
   417          * tif, tiff files
   424          * tif, tiff files
   418          */
   425          */
   419         /*
   426         /*
   766 
   773 
   767     iNewPicNotifier->DecreaseCount(aCount);
   774     iNewPicNotifier->DecreaseCount(aCount);
   768     
   775     
   769     __FLOG(_L8("<< DecreaseNewPictures "));    
   776     __FLOG(_L8("<< DecreaseNewPictures "));    
   770     }
   777     }
       
   778 
       
   779 void CMTPImageDataProvider::HandleMdeSessionCompleteL(TInt aError)
       
   780     {
       
   781     __FLOG(_L8(">> HandleMdeSessionComplete"));    
       
   782 
       
   783     NotifyEnumerationCompleteL(KMTPStorageAll, KErrNone);
       
   784     if (aError == KErrNone)
       
   785         {
       
   786         iMdeObserver = CMTPImageDpMdeObserver::NewL(Framework(), *this);
       
   787         iMdeObserver->SubscribeForChangeNotificationL();
       
   788         }
       
   789     
       
   790     __FLOG(_L8("<< HandleMdeSessionComplete "));    
       
   791     }
       
   792