diff -r a05c44bc3c61 -r d881023c13eb mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadataaccesswrapper.h --- a/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadataaccesswrapper.h Fri Apr 16 15:28:14 2010 +0300 +++ b/mmappcomponents/mmmtpdataprovider/inc/cmmmtpdpmetadataaccesswrapper.h Mon May 03 12:58:40 2010 +0300 @@ -19,10 +19,8 @@ #ifndef CMMMTPDPMETADATAACCESSWRAPPER_H #define CMMMTPDPMETADATAACCESSWRAPPER_H -#include -#include #include -#include +#include // forward declacration class CMmMtpDpMetadataMpxAccess; @@ -30,16 +28,15 @@ class RFs; class MMTPType; -class CMTPTypeObjectPropList; class CMPXMediaArray; class CMPXMedia; class MMTPDataProviderFramework; +class CMTPObjectMetaData; class CMmMtpDpMetadataAccessWrapper : public CBase { public: - static CMmMtpDpMetadataAccessWrapper* NewL( RFs& aRfs, - MMTPDataProviderFramework& aFramework ); + static CMmMtpDpMetadataAccessWrapper* NewL( MMTPDataProviderFramework& aFramework ); /** * Destructor @@ -48,42 +45,45 @@ public: /** - * Get all playlists from MPX database in the assigned store - * @param aStoreRoot, specify in which drive playlists are stored - * @param aPlaylists, return result array + * Get all abstract medias from MPX database in the assigned store + * @param aStoreRoot, specify in which drive abstract medias are stored + * @param aAbstractMedias, return result array + * @param aCategory, indicate the category of abstract medias */ - IMPORT_C void GetAllPlaylistL( const TDesC& aStoreRoot, - CMPXMediaArray** aPlaylists ); + IMPORT_C void GetAllAbstractMediaL( const TDesC& aStoreRoot, + CMPXMediaArray** aAbstractMedias, + TMPXGeneralCategory aCategory ); /** - * Get all references of specified playlist - * @param aPlaylist, specify of which reference should be get + * Get all references of specified abstract medias + * @param aAbstractMedia, specify of which reference should be get * @param aReferences, return result array which stored handles of all references */ - IMPORT_C void GetAllReferenceL( CMPXMedia* aPlaylist, + IMPORT_C void GetAllReferenceL( CMPXMedia* aAbstractMedia, CDesCArray& aReferences ); /** - * Get an playlist name from CMPXMedia object - * @param aPlaylist, specify the source - * @param aPlaylistName, return result + * Get an abstract media name from CMPXMedia object + * @param aAbstractMedia, specify the source + * @param aCategory, specify the category + * @return, name of the source, ownership transferred */ - IMPORT_C void GetPlaylistNameL( CMPXMedia* aPlaylist, TDes& aPlaylistName ); - + IMPORT_C HBufC* GetAbstractMediaNameL( CMPXMedia* aAbstractMedia, + TMPXGeneralCategory aCategory ); /** - * Add object (music, video and playlist) info to DB + * Add object (music, video, playlist and abstract album) info to DB * @param aFullFileName, full file name of file * @return void */ - void AddObjectL( const TDesC& aFullFileName, TBool aIsVideo = EFalse ); + void AddObjectL( const CMTPObjectMetaData& aObject ); /** - * Set playlist to DB - * @param aPlaylistFileName, full file name of playlist file + * Set abstract media to DB + * @param aObject, * @param aRefFileArray, a array to store the full file name of media files * @return void */ - IMPORT_C void SetPlaylistL( const TDesC& aPlaylistFileName, + IMPORT_C void SetReferenceL( const CMTPObjectMetaData& aObject, CDesCArray& aRefFileArray ); /** @@ -114,18 +114,17 @@ /** * Renames the file part of a record in the collection database - * @param aFile, old full file name of Media file + * @param aOldObject, object need to be renamed * @param aNewFileName, new file name need update * @return void */ - IMPORT_C void RenameObjectL( const TDesC& aOldFileName, const TDesC& aNewFileName ); + IMPORT_C void RenameObjectL( const CMTPObjectMetaData& aOldObject, const TDesC& aNewFileName ); /** * Deletes metadata information associated with the object - * @param aFullFileName, full file name of Media file - * @param aFormatCode, format code + * @param aObject, the object need to be deleted */ - void DeleteObjectL( const TDesC& aFullFileName, const TUint aFormatCode ); + void DeleteObjectL( const CMTPObjectMetaData& aObject ); /** * Set current drive info @@ -139,9 +138,9 @@ * @param aWidth, the width of an object in pixels to set * @parem aHeight, the height of an object in pixels to set */ - void SetImageObjPropL( const TDesC& aFullFileName, - const TUint32 aWidth, - const TUint32 aHeight ); + void SetImageObjPropL( const CMTPObjectMetaData& aObject, + const TUint32 aWidth, + const TUint32 aHeight ); /* * get image specific properties specific to videos @@ -149,10 +148,10 @@ * @param aWidth, the width of an object in pixels to get * @parem aHeight, the height of an object in pixels to get */ - void GetImageObjPropL( const TDesC& aFullFileName, - TUint32& aWidth, - TUint32& aHeight ); - + void GetImageObjPropL( const CMTPObjectMetaData& aObject, + TUint32& aWidth, + TUint32& aHeight ); + /** * Get Modified object from DB * @param aStorageRoot, the root path of storage @@ -160,16 +159,16 @@ * @param aRefFileArray, a array to store the full file name of media files * @return void */ - IMPORT_C void GetModifiedContentL( const TDesC& aStorageRoot, + IMPORT_C void GetModifiedContentL( const TDesC& aStorageRoot, TInt& arrayCount, CDesCArray& aRefFileArray ); - + /** * Updated Music DB * @return void */ - IMPORT_C void UpdateMusicCollectionL(); - + IMPORT_C void UpdateMusicCollectionL(); + /* * Called when the MTP session is initialised */ @@ -179,59 +178,60 @@ * clean up db resource especially for video dp */ void CloseSessionL(); - + /** * Cleanup database */ IMPORT_C void CleanupDatabaseL(); - + /** * if the playlsit exist in the MPX DB * @param aSuid, the suid of playlsit */ TBool IsExistL( const TDesC& aSuid ); - + // related to dummy files /** * Add one dummy file to dummy files array */ IMPORT_C void AddDummyFileL( const TDesC& aDummyFileName ); - + /** * Delete one dummy file from dummy files array - */ + */ IMPORT_C void DeleteDummyFile( const TDesC& aDummyFileName ); - + /** * Create a Dummy File from the virtual playlist URI * @param aPlaylistName, specify the filename of the dummy file */ IMPORT_C void CreateDummyFile( const TDesC& aPlaylistName ); - + + TMPXGeneralCategory Category( const CMTPObjectMetaData& aObject ); + private: - CMmMtpDpMetadataAccessWrapper( RFs& aRfs, MMTPDataProviderFramework& aFramework ); + CMmMtpDpMetadataAccessWrapper( MMTPDataProviderFramework& aFramework ); void ConstructL(); - TMPXGeneralCategory Category( const TUint aFormatCode ); - + TMPXGeneralCategory ContainerCategory( const TDesC& aFullFileName ); + /** * Remove all dummy file of which format is "pla", and leave the "m3u" */ void RemoveDummyFiles(); private: - // Data - RFs& iRfs; CMmMtpDpMetadataMpxAccess* iMmMtpDpMetadataMpxAccess; CMmMtpDpMetadataVideoAccess* iMmMtpDpMetadataVideoAccess; TBool iOpenSession; - - MMTPDataProviderFramework& iFramework; - - CDesCArray* iPlaylistArray; - + + MMTPDataProviderFramework& iFramework; + RFs& iFs; // should not remove this member data!!! + + CDesCArray* iAbstractMediaArray; + }; #endif // CMMMTPDPMETADATAACCESSWRAPPER_H