mtpdataproviders/mtpimagedp/inc/cmtpimagedpobjectpropertymgr.h
branchRCL_3
changeset 32 f85613f12947
parent 19 ef55b168cedb
child 47 63cf70d3ecd8
--- a/mtpdataproviders/mtpimagedp/inc/cmtpimagedpobjectpropertymgr.h	Wed Jun 09 10:36:33 2010 +0300
+++ b/mtpdataproviders/mtpimagedp/inc/cmtpimagedpobjectpropertymgr.h	Mon Jun 21 16:36:59 2010 +0300
@@ -25,6 +25,7 @@
 #include <e32base.h>
 #include <f32file.h>
 #include <e32std.h>
+#include <e32hashtab.h> 
 
 #include <mdesession.h>
 #include <mtp/mtpprotocolconstants.h>
@@ -74,7 +75,8 @@
     void GetPropertyL(TMTPObjectPropertyCode aProperty, CMTPTypeArray& aValue, TBool alwaysCreate = ETrue);
     
     //clear the cache
-    void ClearCacheL();
+    void ClearAllCache();
+    void ClearCache(TUint aHandle);
     void ConvertMTPTimeStr2TTimeL(const TDesC& aTimeString, TTime& aModifiedTime) const;
     
     void StoreThunmnail(TUint aHandle, HBufC8* aData);
@@ -108,6 +110,9 @@
     void OpenMdeObjectL();
     void ClearThumnailCache();
     
+    TBool FindPropertiesCache(TUint aObjectHandle);
+    void  DestroyPropertiesCahce(TUint aObjectHandle);
+    
 private:
     
     //define property cache object
@@ -123,7 +128,6 @@
             EImagePixHeight       = 1,
             EImageBitDepth        = 2,
             EDateCreated          = 3,
-            
             /**
             The number of elements.        
             */
@@ -138,11 +142,9 @@
         
         const TDesC& DesC(TUint aId) const;
         TUint Uint(TUint aId) const;
-        TUint ObjectHandle() const;
         
         void SetDesCL(TUint aId, const TDesC& aValue);
-        void SetUint(TUint aId, TUint aValue);  
-        void SetObjectHandle(TUint aObjectHandle);
+        void SetUint(TUint aId, TUint aValue);
         
     private:
         
@@ -178,11 +180,6 @@
         */
         RArray<TUint>                   iElementsUint;
         
-        /**
-        The object handle of owner
-        */
-        TUint                           iObjectHandle;
-        
         static const TElementMetaData   KElements[];        
     };
     
@@ -211,7 +208,6 @@
     MMTPObjectMgr&              iObjectMgr;
     CMTPObjectMetaData*         iObjectInfo;  //not owned
     TBool                       iCacheHit;//flag to indicate cache is available
-    TBool                       iNeedParse;//flag to indicate whether we need to parse image file by our self
 	
     /*
      * Cache thumbnail, thumbnail size is inconsistent in winlogo test
@@ -222,7 +218,8 @@
      * Cache the latest image properties which PC send to device,
      * it can optimize synce/reverse-sync performance due to reduction of object properties generation
      */
-    CMTPImagePropertiesCache*     iPropertiesCache; 
+    CMTPImagePropertiesCache*                     iCurrentPropertiesCache;
+    RHashMap<TUint, CMTPImagePropertiesCache*>    iPropretiesCacheMap;
     };
    
 #endif // CMTPIMAGEDPOBJECTPROPERTYMGR_H