mtpdataproviders/mtpimagedp/inc/cmtpimagedpobjectpropertymgr.h
branchRCL_3
changeset 15 f85613f12947
parent 6 ef55b168cedb
equal deleted inserted replaced
13:81da3301b632 15:f85613f12947
    23 #define CMTPIMAGEDPOBJECTPROPERTYMGR_H
    23 #define CMTPIMAGEDPOBJECTPROPERTYMGR_H
    24 
    24 
    25 #include <e32base.h>
    25 #include <e32base.h>
    26 #include <f32file.h>
    26 #include <f32file.h>
    27 #include <e32std.h>
    27 #include <e32std.h>
       
    28 #include <e32hashtab.h> 
    28 
    29 
    29 #include <mdesession.h>
    30 #include <mdesession.h>
    30 #include <mtp/mtpprotocolconstants.h>
    31 #include <mtp/mtpprotocolconstants.h>
    31 #include <mtp/mtpprotocolconstants.h>
    32 #include <mtp/mtpprotocolconstants.h>
    32 #include <mtp/tmtptypeuint32.h>
    33 #include <mtp/tmtptypeuint32.h>
    72     void GetPropertyL(TMTPObjectPropertyCode aProperty, TMTPTypeUint128& aValue);
    73     void GetPropertyL(TMTPObjectPropertyCode aProperty, TMTPTypeUint128& aValue);
    73     void GetPropertyL(TMTPObjectPropertyCode aProperty, CMTPTypeString& aValue);
    74     void GetPropertyL(TMTPObjectPropertyCode aProperty, CMTPTypeString& aValue);
    74     void GetPropertyL(TMTPObjectPropertyCode aProperty, CMTPTypeArray& aValue, TBool alwaysCreate = ETrue);
    75     void GetPropertyL(TMTPObjectPropertyCode aProperty, CMTPTypeArray& aValue, TBool alwaysCreate = ETrue);
    75     
    76     
    76     //clear the cache
    77     //clear the cache
    77     void ClearCacheL();
    78     void ClearAllCache();
       
    79     void ClearCache(TUint aHandle);
    78     void ConvertMTPTimeStr2TTimeL(const TDesC& aTimeString, TTime& aModifiedTime) const;
    80     void ConvertMTPTimeStr2TTimeL(const TDesC& aTimeString, TTime& aModifiedTime) const;
    79     
    81     
    80     void StoreThunmnail(TUint aHandle, HBufC8* aData);
    82     void StoreThunmnail(TUint aHandle, HBufC8* aData);
    81     HBufC8* Thumbnail(TUint aHandle);
    83     HBufC8* Thumbnail(TUint aHandle);
    82     
    84     
   105 
   107 
   106     void RemoveProperty(CMdEObject& aObject, CMdEPropertyDef& aPropDef);
   108     void RemoveProperty(CMdEObject& aObject, CMdEPropertyDef& aPropDef);
   107     
   109     
   108     void OpenMdeObjectL();
   110     void OpenMdeObjectL();
   109     void ClearThumnailCache();
   111     void ClearThumnailCache();
       
   112     
       
   113     TBool FindPropertiesCache(TUint aObjectHandle);
       
   114     void  DestroyPropertiesCahce(TUint aObjectHandle);
   110     
   115     
   111 private:
   116 private:
   112     
   117     
   113     //define property cache object
   118     //define property cache object
   114     class CMTPImagePropertiesCache : public CBase
   119     class CMTPImagePropertiesCache : public CBase
   121             {        
   126             {        
   122             EImagePixWidth        = 0,
   127             EImagePixWidth        = 0,
   123             EImagePixHeight       = 1,
   128             EImagePixHeight       = 1,
   124             EImageBitDepth        = 2,
   129             EImageBitDepth        = 2,
   125             EDateCreated          = 3,
   130             EDateCreated          = 3,
   126             
       
   127             /**
   131             /**
   128             The number of elements.        
   132             The number of elements.        
   129             */
   133             */
   130             ENumProperties,
   134             ENumProperties,
   131             };
   135             };
   136         
   140         
   137         void ResetL();
   141         void ResetL();
   138         
   142         
   139         const TDesC& DesC(TUint aId) const;
   143         const TDesC& DesC(TUint aId) const;
   140         TUint Uint(TUint aId) const;
   144         TUint Uint(TUint aId) const;
   141         TUint ObjectHandle() const;
       
   142         
   145         
   143         void SetDesCL(TUint aId, const TDesC& aValue);
   146         void SetDesCL(TUint aId, const TDesC& aValue);
   144         void SetUint(TUint aId, TUint aValue);  
   147         void SetUint(TUint aId, TUint aValue);
   145         void SetObjectHandle(TUint aObjectHandle);
       
   146         
   148         
   147     private:
   149     private:
   148         
   150         
   149         enum TType
   151         enum TType
   150             {
   152             {
   175         
   177         
   176         /**
   178         /**
   177         The Uint element data.
   179         The Uint element data.
   178         */
   180         */
   179         RArray<TUint>                   iElementsUint;
   181         RArray<TUint>                   iElementsUint;
   180         
       
   181         /**
       
   182         The object handle of owner
       
   183         */
       
   184         TUint                           iObjectHandle;
       
   185         
   182         
   186         static const TElementMetaData   KElements[];        
   183         static const TElementMetaData   KElements[];        
   187     };
   184     };
   188     
   185     
   189     /**
   186     /**
   209 
   206 
   210     RFs&                        iFs;
   207     RFs&                        iFs;
   211     MMTPObjectMgr&              iObjectMgr;
   208     MMTPObjectMgr&              iObjectMgr;
   212     CMTPObjectMetaData*         iObjectInfo;  //not owned
   209     CMTPObjectMetaData*         iObjectInfo;  //not owned
   213     TBool                       iCacheHit;//flag to indicate cache is available
   210     TBool                       iCacheHit;//flag to indicate cache is available
   214     TBool                       iNeedParse;//flag to indicate whether we need to parse image file by our self
       
   215 	
   211 	
   216     /*
   212     /*
   217      * Cache thumbnail, thumbnail size is inconsistent in winlogo test
   213      * Cache thumbnail, thumbnail size is inconsistent in winlogo test
   218      */
   214      */
   219     TThumbnailCache              iThumbnailCache;
   215     TThumbnailCache              iThumbnailCache;
   220     
   216     
   221     /**
   217     /**
   222      * Cache the latest image properties which PC send to device,
   218      * Cache the latest image properties which PC send to device,
   223      * it can optimize synce/reverse-sync performance due to reduction of object properties generation
   219      * it can optimize synce/reverse-sync performance due to reduction of object properties generation
   224      */
   220      */
   225     CMTPImagePropertiesCache*     iPropertiesCache; 
   221     CMTPImagePropertiesCache*                     iCurrentPropertiesCache;
       
   222     RHashMap<TUint, CMTPImagePropertiesCache*>    iPropretiesCacheMap;
   226     };
   223     };
   227    
   224    
   228 #endif // CMTPIMAGEDPOBJECTPROPERTYMGR_H
   225 #endif // CMTPIMAGEDPOBJECTPROPERTYMGR_H