mtpdataproviders/mtpimagedp/src/cmtpimagedp.cpp
branchRCL_3
changeset 6 ef55b168cedb
parent 5 3673b591050c
child 15 f85613f12947
equal deleted inserted replaced
5:3673b591050c 6:ef55b168cedb
   396         }
   396         }
   397         break;
   397         break;
   398         
   398         
   399     case EFormatExtensionSets:
   399     case EFormatExtensionSets:
   400         {
   400         {
   401         _LIT(KFormatExtensionJpg, "0x3801:jpg::3");//3 means file dp will enumerate all image files instead of image dp.
   401         _LIT(KFormatExtensionJpg, "0x3801:jpg:::3");//3 means file dp will enumerate all image files instead of image dp.
   402         aStrings.AppendL(KFormatExtensionJpg);
   402         aStrings.AppendL(KFormatExtensionJpg);
   403         _LIT(KFormatExtensionJpe, "0x3801:jpe::3");
   403         _LIT(KFormatExtensionJpe, "0x3801:jpe:::3");
   404         aStrings.AppendL(KFormatExtensionJpe);
   404         aStrings.AppendL(KFormatExtensionJpe);
   405         _LIT(KFormatExtensionJpeg, "0x3801:jpeg::3");
   405         _LIT(KFormatExtensionJpeg, "0x3801:jpeg:::3");
   406         aStrings.AppendL(KFormatExtensionJpeg);
   406         aStrings.AppendL(KFormatExtensionJpeg);
   407         
   407         
   408         /*
   408         /*
   409          * bmp files
   409          * bmp files
   410          */
   410          */
   411         _LIT(KFormatExtensionBmp, "0x3804:bmp::3");
   411         _LIT(KFormatExtensionBmp, "0x3804:bmp:::3");
   412         aStrings.AppendL(KFormatExtensionBmp);
   412         aStrings.AppendL(KFormatExtensionBmp);
   413         
   413         
   414         /*
   414         /*
   415          * gif files
   415          * gif files
   416          */
   416          */
   417         _LIT(KFormatExtensionGif, "0x3807:gif::3");
   417         _LIT(KFormatExtensionGif, "0x3807:gif:::3");
   418         aStrings.AppendL(KFormatExtensionGif);
   418         aStrings.AppendL(KFormatExtensionGif);
   419         
   419         
   420         /*
   420         /*
   421          * png files
   421          * png files
   422          */
   422          */
   423         _LIT(KFormatExtensionPng, "0x380B:png::3");
   423         _LIT(KFormatExtensionPng, "0x380B:png:::3");
   424         aStrings.AppendL(KFormatExtensionPng);
   424         aStrings.AppendL(KFormatExtensionPng);
   425         
   425         
   426         /*
   426         /*
   427          * tif, tiff files
   427          * tif, tiff files
   428          */
   428          */
   661 const TDesC& CMTPImageDataProvider::FindMimeType(const TDesC& aExtension)
   661 const TDesC& CMTPImageDataProvider::FindMimeType(const TDesC& aExtension)
   662     {
   662     {
   663     /**
   663     /**
   664      * copy file extension by insensitive case
   664      * copy file extension by insensitive case
   665      */
   665      */
       
   666     if (aExtension.Length() > KMaxExtNameLength)
       
   667         {
       
   668         return KNullDesC;
       
   669         }
       
   670     
   666     TBuf<KMaxExtNameLength> extension;
   671     TBuf<KMaxExtNameLength> extension;
   667     extension.CopyLC(aExtension);
   672     extension.CopyLC(aExtension);
   668     
   673     
   669     const TDesC* ret = iMimeMappings.Find(extension);
   674     const TDesC* ret = iMimeMappings.Find(extension);
   670     if (ret == NULL)
   675     if (ret == NULL)
   716     CleanupStack::PopAndDestroy(&context);
   721     CleanupStack::PopAndDestroy(&context);
   717     
   722     
   718     return newPictures;
   723     return newPictures;
   719     }
   724     }
   720 
   725 
   721 TBool CMTPImageDataProvider::GetCacheParentHandle(const TDesC& aParentPath, TUint32& aParentHandle)
       
   722     {
       
   723     TBool ret = EFalse;
       
   724     
       
   725     if (iParentCache.iPath.Compare(aParentPath) == 0)
       
   726         {
       
   727         aParentHandle = iParentCache.iHandle;
       
   728         ret = ETrue;
       
   729         }
       
   730     else
       
   731         {
       
   732         aParentHandle = KMTPHandleNone;
       
   733         }
       
   734     
       
   735     return ret;
       
   736     }
       
   737 
       
   738 void CMTPImageDataProvider::SetCacheParentHandle(const TDesC& aParentPath, TUint32 aParentHandle)
       
   739     {
       
   740     iParentCache.iPath.Copy(aParentPath);
       
   741     iParentCache.iHandle = aParentHandle;
       
   742     }
       
   743 
       
   744 void CMTPImageDataProvider::AppendDeleteObjectsArrayL(const TDesC& aSuid)
   726 void CMTPImageDataProvider::AppendDeleteObjectsArrayL(const TDesC& aSuid)
   745     {
   727     {
   746     iDeleteObjectsArray.AppendL(aSuid.AllocLC());
   728     iDeleteObjectsArray.AppendL(aSuid.AllocLC());
   747     CleanupStack::Pop();
   729     CleanupStack::Pop();
   748     }
   730     }