mtpdataproviders/mtpimagedp/inc/cmtpimagedpobjectpropertymgr.h
changeset 17 aabe5387f5ce
parent 0 d0791faffa3f
child 12 8b094906a049
equal deleted inserted replaced
0:d0791faffa3f 17:aabe5387f5ce
    39 class CMTPTypeString;
    39 class CMTPTypeString;
    40 class MMTPDataProviderFramework;
    40 class MMTPDataProviderFramework;
    41 class CFileStore;
    41 class CFileStore;
    42 class CMTPTypeString;
    42 class CMTPTypeString;
    43 class CMTPObjectMetaData;
    43 class CMTPObjectMetaData;
       
    44 class CMTPImageDataProvider;
       
    45 class CMTPTypeOpaqueData;
       
    46 class CMTPTypeArray;
    44 
    47 
    45 /** 
    48 /** 
    46 Manage picture object properties
    49 Manage picture object properties
    47 
    50 
    48 @internalTechnology
    51 @internalTechnology
    50 */
    53 */
    51 class CMTPImageDpObjectPropertyMgr : public CBase, public MMdESessionObserver
    54 class CMTPImageDpObjectPropertyMgr : public CBase, public MMdESessionObserver
    52    {    
    55    {    
    53    
    56    
    54 public:
    57 public:
    55     static CMTPImageDpObjectPropertyMgr* NewL(MMTPDataProviderFramework& aFramework);
    58     static CMTPImageDpObjectPropertyMgr* NewL(MMTPDataProviderFramework& aFramework, CMTPImageDataProvider& aDataProvider);
    56     ~CMTPImageDpObjectPropertyMgr();
    59     ~CMTPImageDpObjectPropertyMgr();
    57     void SetCurrentObjectL(CMTPObjectMetaData& aObjectInfo, TBool aRequireForModify, TBool aSaveToCache = EFalse);
    60     void SetCurrentObjectL(CMTPObjectMetaData& aObjectInfo, TBool aRequireForModify, TBool aSaveToCache = EFalse);
    58     
    61     
    59     void SetPropertyL(TMTPObjectPropertyCode aProperty, const TUint8 aValue);
    62     void SetPropertyL(TMTPObjectPropertyCode aProperty, const TUint8 aValue);
    60     void SetPropertyL(TMTPObjectPropertyCode aProperty, const TUint16 aValue);
    63     void SetPropertyL(TMTPObjectPropertyCode aProperty, const TUint16 aValue);
    65     void GetPropertyL(TMTPObjectPropertyCode aProperty, TUint8& aValue);
    68     void GetPropertyL(TMTPObjectPropertyCode aProperty, TUint8& aValue);
    66     void GetPropertyL(TMTPObjectPropertyCode aProperty, TUint16& aValue);
    69     void GetPropertyL(TMTPObjectPropertyCode aProperty, TUint16& aValue);
    67     void GetPropertyL(TMTPObjectPropertyCode aProperty, TUint32& aValue);
    70     void GetPropertyL(TMTPObjectPropertyCode aProperty, TUint32& aValue);
    68     void GetPropertyL(TMTPObjectPropertyCode aProperty, TUint64& aValue);
    71     void GetPropertyL(TMTPObjectPropertyCode aProperty, TUint64& aValue);
    69     void GetPropertyL(TMTPObjectPropertyCode aProperty, TMTPTypeUint128& aValue);
    72     void GetPropertyL(TMTPObjectPropertyCode aProperty, TMTPTypeUint128& aValue);
    70     void GetPropertyL(TMTPObjectPropertyCode aProperty, CMTPTypeString& aValue);    
    73     void GetPropertyL(TMTPObjectPropertyCode aProperty, CMTPTypeString& aValue);
       
    74     void GetPropertyL(TMTPObjectPropertyCode aProperty, CMTPTypeArray& aValue);
    71     
    75     
    72     //clear the cache
    76     //clear the cache
    73     void ClearCacheL();
    77     void ClearCacheL();
    74     void ConvertMTPTimeStr2TTimeL(const TDesC& aTimeString, TTime& aModifiedTime) const;
    78     void ConvertMTPTimeStr2TTimeL(const TDesC& aTimeString, TTime& aModifiedTime) const;
       
    79     
       
    80     void StoreThunmnail(TUint aHandle, HBufC8* aData);
       
    81     HBufC8* Thumbnail(TUint aHandle);
    75     
    82     
    76 public:
    83 public:
    77     void SetMdeSessionError(TInt aError);
    84     void SetMdeSessionError(TInt aError);
    78     CMdESession& MdeSession();
    85     CMdESession& MdeSession();
    79     
    86     
    80     // from MMdESessionObserver
    87     // from MMdESessionObserver
    81     void HandleSessionOpened(CMdESession& aSession, TInt aError);
    88     void HandleSessionOpened(CMdESession& aSession, TInt aError);
    82     void HandleSessionError(CMdESession& aSession, TInt aError);
    89     void HandleSessionError(CMdESession& aSession, TInt aError);
    83    
    90    
    84 private:
    91 private:
    85     CMTPImageDpObjectPropertyMgr(MMTPDataProviderFramework& aFramework);
    92     CMTPImageDpObjectPropertyMgr(MMTPDataProviderFramework& aFramework, CMTPImageDataProvider& aDataProvider);
    86     void ConstructL(MMTPDataProviderFramework& aFramework);
    93     void ConstructL(MMTPDataProviderFramework& aFramework);
    87     
    94     
    88     TBool GetYear(const TDesC& aDateString, TInt& aYear) const;
    95     TBool GetYear(const TDesC& aDateString, TInt& aYear) const;
    89     TBool GetMonth(const TDesC& aDateString, TMonth& aMonth) const;
    96     TBool GetMonth(const TDesC& aDateString, TMonth& aMonth) const;
    90     TBool GetDay(const TDesC& aDateString, TInt& aDay) const;
    97     TBool GetDay(const TDesC& aDateString, TInt& aDay) const;
    94     TBool GetTenthSecond(const TDesC& aDateString, TInt& aTenthSecond) const;     
   101     TBool GetTenthSecond(const TDesC& aDateString, TInt& aTenthSecond) const;     
    95     
   102     
    96     void SetProperty2CacheL(TMTPObjectPropertyCode aProperty, TAny* aValue);
   103     void SetProperty2CacheL(TMTPObjectPropertyCode aProperty, TAny* aValue);
    97     void GetPropertyFromMdsL(TMTPObjectPropertyCode aProperty, TAny* aValue);
   104     void GetPropertyFromMdsL(TMTPObjectPropertyCode aProperty, TAny* aValue);
    98 
   105 
    99     TUint32 ParseImageFileL(const TDesC& aUri, TMTPObjectPropertyCode aPropCode);
       
   100     void RemoveProperty(CMdEObject& aObject, CMdEPropertyDef& aPropDef);
   106     void RemoveProperty(CMdEObject& aObject, CMdEPropertyDef& aPropDef);
       
   107     
       
   108     void OpenMdeObjectL();
       
   109     void ClearThumnailCache();
   101     
   110     
   102 private:
   111 private:
   103     
   112     
   104     //define property cache object
   113     //define property cache object
   105     class CMTPImagePropertiesCache : public CBase
   114     class CMTPImagePropertiesCache : public CBase
   175         TUint                           iObjectHandle;
   184         TUint                           iObjectHandle;
   176         
   185         
   177         static const TElementMetaData   KElements[];        
   186         static const TElementMetaData   KElements[];        
   178     };
   187     };
   179     
   188     
       
   189     /**
       
   190      * Thumbnail cache used for winlogo test
       
   191      */
       
   192     struct TThumbnailCache
       
   193         {
       
   194         TUint    iObjectHandle;
       
   195         HBufC8*  iThumbnailData;
       
   196         };   
       
   197     
   180 private:
   198 private:
   181     /**
   199     /**
   182     FLOGGER debug trace member variable.
   200     FLOGGER debug trace member variable.
   183     */    
   201     */    
   184     __FLOG_DECLARATION_MEMBER_MUTABLE;
   202     __FLOG_DECLARATION_MEMBER_MUTABLE;
   185     
   203     
       
   204     MMTPDataProviderFramework&  iFramework;
       
   205     CMTPImageDataProvider&      iDataProvider;
   186     CActiveSchedulerWait*       iActiveSchedulerWait;
   206     CActiveSchedulerWait*       iActiveSchedulerWait;
   187     CMdESession*                iMetaDataSession;
   207     CMdESession*                iMetaDataSession;
   188     TInt                        iMdeSessionError;
   208     TInt                        iMdeSessionError;
   189     CMdEObject*                 iObject;
   209     CMdEObject*                 iObject;//used for read properties from MdS
   190 
   210 
   191     RFs&                        iFs;
   211     RFs&                        iFs;
   192     MMTPObjectMgr&              iObjectMgr;
   212     MMTPObjectMgr&              iObjectMgr;
   193     CMTPObjectMetaData*         iObjectInfo;  //not owned
   213     CMTPObjectMetaData*         iObjectInfo;  //not owned
   194     TBool                       iCacheHit;//flag to indicate cache is available
   214     TBool                       iCacheHit;//flag to indicate cache is available
       
   215     TBool                       iNeedParse;//flag to indicate whether we need to parse image file by our self
       
   216 	
       
   217     /*
       
   218      * Cache thumbnail, thumbnail size is inconsistent in winlogo test
       
   219      */
       
   220     TThumbnailCache              iThumbnailCache;
   195     
   221     
   196     /**
   222     /**
   197      * Cache the latest image properties which PC send to device,
   223      * Cache the latest image properties which PC send to device,
   198      * it can optimize synce/reverse-sync performance due to reduction of object properties generation
   224      * it can optimize synce/reverse-sync performance due to reduction of object properties generation
   199      */
   225      */