mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadataaccesswrapper.h
branchRCL_3
changeset 17 780c925249c1
parent 9 bee149131e4b
child 19 51035f0751c2
equal deleted inserted replaced
15:d240f0a77280 17:780c925249c1
    17 
    17 
    18 
    18 
    19 #ifndef CMMMTPDPMETADATAACCESSWRAPPER_H
    19 #ifndef CMMMTPDPMETADATAACCESSWRAPPER_H
    20 #define CMMMTPDPMETADATAACCESSWRAPPER_H
    20 #define CMMMTPDPMETADATAACCESSWRAPPER_H
    21 
    21 
    22 #include <mtp/cmtpobjectmetadata.h>
       
    23 #include <mtp/mtpprotocolconstants.h>
       
    24 #include <mpxmediageneraldefs.h>
    22 #include <mpxmediageneraldefs.h>
    25 #include <mtp/mmtpdataproviderframework.h>
    23 #include <badesca.h>
    26 
    24 
    27 // forward declacration
    25 // forward declacration
    28 class CMmMtpDpMetadataMpxAccess;
    26 class CMmMtpDpMetadataMpxAccess;
    29 class CMmMtpDpMetadataVideoAccess;
    27 class CMmMtpDpMetadataVideoAccess;
    30 
    28 
    31 class RFs;
    29 class RFs;
    32 class MMTPType;
    30 class MMTPType;
    33 class CMTPTypeObjectPropList;
       
    34 class CMPXMediaArray;
    31 class CMPXMediaArray;
    35 class CMPXMedia;
    32 class CMPXMedia;
    36 class MMTPDataProviderFramework;
    33 class MMTPDataProviderFramework;
       
    34 class CMTPObjectMetaData;
    37 
    35 
    38 class CMmMtpDpMetadataAccessWrapper : public CBase
    36 class CMmMtpDpMetadataAccessWrapper : public CBase
    39     {
    37     {
    40 public:
    38 public:
    41     static CMmMtpDpMetadataAccessWrapper* NewL( RFs& aRfs,
    39     static CMmMtpDpMetadataAccessWrapper* NewL( MMTPDataProviderFramework& aFramework );
    42         MMTPDataProviderFramework& aFramework );
       
    43 
    40 
    44     /**
    41     /**
    45     * Destructor
    42     * Destructor
    46     */
    43     */
    47     ~CMmMtpDpMetadataAccessWrapper();
    44     ~CMmMtpDpMetadataAccessWrapper();
    76     /**
    73     /**
    77     * Add object (music, video, playlist and abstract album) info to DB
    74     * Add object (music, video, playlist and abstract album) info to DB
    78     * @param aFullFileName, full file name of file
    75     * @param aFullFileName, full file name of file
    79     * @return void
    76     * @return void
    80     */
    77     */
    81     void AddObjectL( const TDesC& aFullFileName, TUint aFormatCode, TUint aSubFormatCode );
    78     void AddObjectL( const CMTPObjectMetaData& aObject );
    82 
    79 
    83     /**
    80     /**
    84     * Set abstract media to DB
    81     * Set abstract media to DB
    85     * @param aAbstractMediaFileName, full file name of abstract media file
    82     * @param aObject,
    86     * @param aRefFileArray, a array to store the full file name of media files
    83     * @param aRefFileArray, a array to store the full file name of media files
    87     * @param aCategory, the category of abstract media
    84     * @return void
    88     * @return void
    85     */
    89     */
    86     IMPORT_C void SetReferenceL( const CMTPObjectMetaData& aObject,
    90     IMPORT_C void SetAbstractMediaL( const TDesC& aAbstractMediaFileName,
    87         CDesCArray& aRefFileArray );
    91         CDesCArray& aRefFileArray,
       
    92         TMPXGeneralCategory aCategory );
       
    93 
    88 
    94     /**
    89     /**
    95     * Gets a piece of metadata from the collection
    90     * Gets a piece of metadata from the collection
    96     * @param aPropCode, specify property code of aMediaProp
    91     * @param aPropCode, specify property code of aMediaProp
    97     * @param aNewData, object property value which will be get from
    92     * @param aNewData, object property value which will be get from
   117         const MMTPType& aNewData,
   112         const MMTPType& aNewData,
   118         const CMTPObjectMetaData& aObjectMetaData );
   113         const CMTPObjectMetaData& aObjectMetaData );
   119 
   114 
   120     /**
   115     /**
   121     * Renames the file part of a record in the collection database
   116     * Renames the file part of a record in the collection database
   122     * @param aFile, old full file name of Media file
   117     * @param aOldObject, object need to be renamed
   123     * @param aNewFileName, new file name need update
   118     * @param aNewFileName, new file name need update
   124     * @return void
   119     * @return void
   125     */
   120     */
   126     IMPORT_C void RenameObjectL( const TDesC& aOldFileName, const TDesC& aNewFileName );
   121     IMPORT_C void RenameObjectL( const CMTPObjectMetaData& aOldObject, const TDesC& aNewFileName );
   127 
   122 
   128     /**
   123     /**
   129     * Deletes metadata information associated with the object
   124     * Deletes metadata information associated with the object
   130     * @param aFullFileName, full file name of Media file
   125     * @param aObject, the object need to be deleted
   131     * @param aFormatCode, format code
   126     */
   132     */
   127     void DeleteObjectL( const CMTPObjectMetaData& aObject );
   133     void DeleteObjectL( const TDesC& aFullFileName, const TUint aFormatCode );
       
   134 
   128 
   135     /**
   129     /**
   136     * Set current  drive info
   130     * Set current  drive info
   137     * @param aStorageRoot, current drive info
   131     * @param aStorageRoot, current drive info
   138     */
   132     */
   142     * set image specific properties specific to videos
   136     * set image specific properties specific to videos
   143     * @param aFullFileName, the fullFileName of object
   137     * @param aFullFileName, the fullFileName of object
   144     * @param aWidth,  the width of an object in pixels to set
   138     * @param aWidth,  the width of an object in pixels to set
   145     * @parem aHeight,  the height of an object in pixels to set
   139     * @parem aHeight,  the height of an object in pixels to set
   146     */
   140     */
   147     void SetImageObjPropL( const TDesC& aFullFileName,
   141     void SetImageObjPropL( const CMTPObjectMetaData& aObject,
   148         const TUint32 aWidth,
   142         const TUint32 aWidth,
   149         const TUint32 aHeight );
   143         const TUint32 aHeight );
   150 
   144 
   151     /*
   145     /*
   152     * get image specific properties specific to videos
   146     * get image specific properties specific to videos
   153     * @param aFullFileName, the fullFileName of object
   147     * @param aFullFileName, the fullFileName of object
   154     * @param aWidth,  the width of an object in pixels to get
   148     * @param aWidth,  the width of an object in pixels to get
   155     * @parem aHeight,  the height of an object in pixels to get
   149     * @parem aHeight,  the height of an object in pixels to get
   156     */
   150     */
   157     void GetImageObjPropL( const TDesC& aFullFileName,
   151     void GetImageObjPropL( const CMTPObjectMetaData& aObject,
   158         TUint32& aWidth,
   152         TUint32& aWidth,
   159         TUint32& aHeight );
   153         TUint32& aHeight );
   160 
   154 
   161     /**
   155     /**
   162     * Get Modified object from DB
   156     * Get Modified object from DB
   211     * Create a Dummy File from the virtual playlist URI
   205     * Create a Dummy File from the virtual playlist URI
   212     * @param aPlaylistName, specify the filename of the dummy file
   206     * @param aPlaylistName, specify the filename of the dummy file
   213     */
   207     */
   214     IMPORT_C void CreateDummyFile( const TDesC& aPlaylistName );
   208     IMPORT_C void CreateDummyFile( const TDesC& aPlaylistName );
   215 
   209 
       
   210     TMPXGeneralCategory Category( const CMTPObjectMetaData& aObject );
       
   211 
   216 private:
   212 private:
   217 
   213 
   218     CMmMtpDpMetadataAccessWrapper( RFs& aRfs, MMTPDataProviderFramework& aFramework );
   214     CMmMtpDpMetadataAccessWrapper( MMTPDataProviderFramework& aFramework );
   219 
   215 
   220     void ConstructL();
   216     void ConstructL();
   221 
   217 
   222     TMPXGeneralCategory Category( const TUint aFormatCode );
   218     TMPXGeneralCategory ContainerCategory( const TDesC& aFullFileName );
   223 
   219 
   224     /**
   220     /**
   225     * Remove all dummy file of which format is "pla", and leave the "m3u"
   221     * Remove all dummy file of which format is "pla", and leave the "m3u"
   226     */
   222     */
   227     void RemoveDummyFiles();
   223     void RemoveDummyFiles();
   228 
   224 
   229 private:
   225 private:
   230     // Data
       
   231     RFs& iRfs;
       
   232     CMmMtpDpMetadataMpxAccess* iMmMtpDpMetadataMpxAccess;
   226     CMmMtpDpMetadataMpxAccess* iMmMtpDpMetadataMpxAccess;
   233     CMmMtpDpMetadataVideoAccess* iMmMtpDpMetadataVideoAccess;
   227     CMmMtpDpMetadataVideoAccess* iMmMtpDpMetadataVideoAccess;
   234     TBool iOpenSession;
   228     TBool iOpenSession;
   235 
   229 
   236     MMTPDataProviderFramework& iFramework;
   230     MMTPDataProviderFramework& iFramework;
       
   231     RFs& iFs;	// should not remove this member data!!!
   237 
   232 
   238     CDesCArray* iAbstractMediaArray;
   233     CDesCArray* iAbstractMediaArray;
   239 
   234 
   240     };
   235     };
   241 
   236