mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbhandler.h
branchRCL_3
changeset 21 a1247965635c
parent 18 c54d95799c80
child 26 70a8526f03f2
equal deleted inserted replaced
18:c54d95799c80 21:a1247965635c
   122         * Add songs to the specified playlist
   122         * Add songs to the specified playlist
   123         * @param aMedia playlist media object with playlist Id.
   123         * @param aMedia playlist media object with playlist Id.
   124         * @return playlist Id of the playlist
   124         * @return playlist Id of the playlist
   125         */
   125         */
   126         TUint32 AddSongToPlaylistL(const CMPXMedia& aMedia);
   126         TUint32 AddSongToPlaylistL(const CMPXMedia& aMedia);
   127 #ifdef ABSTRACTAUDIOALBUM_INCLUDED        
   127 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
   128         /**
   128         /**
   129         * Add an abstractalbum to the collection
   129         * Add an abstractalbum to the collection
   130         * @param aMedia abstractalbum media object with URI of the abstractalbum.
   130         * @param aMedia abstractalbum media object with URI of the abstractalbum.
       
   131         * @param aMessageArray change event message to notify client of the changes
   131         * @return abstractalbum Id of the abstractalbum created
   132         * @return abstractalbum Id of the abstractalbum created
   132         */  
   133         */
   133         TUint32 AddAbstractAlbumL(const CMPXMedia& aMedia, CMPXMessageArray* aMessageArray=NULL);
   134         TUint32 AddAbstractAlbumL(const CMPXMedia& aMedia, CMPXMessageArray* aMessageArray=NULL);
   134 #endif // ABSTRACTAUDIOALBUM_INCLUDED
   135 #endif // ABSTRACTAUDIOALBUM_INCLUDED
   135         /**
   136         /**
   136         * Update song info for a song in the music collection database
   137         * Update song info for a song in the music collection database
   137         * @param aMedia songDetails object  which contains file path,
   138         * @param aMedia songDetails object  which contains file path,
   140         *           song update
   141         *           song update
   141         * @return ETrue if UI visible change else EFalse
   142         * @return ETrue if UI visible change else EFalse
   142         */
   143         */
   143         CMPXDbActiveTask::TChangeVisibility UpdateSongL(const CMPXMedia& aMedia,
   144         CMPXDbActiveTask::TChangeVisibility UpdateSongL(const CMPXMedia& aMedia,
   144             CMPXMessageArray& aItemChangedMessages);
   145             CMPXMessageArray& aItemChangedMessages);
   145 #ifdef ABSTRACTAUDIOALBUM_INCLUDED        
   146 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
   146         /**
   147         /**
   147         * Update songs info for songs associated with abstractalbum
   148         * Update abstractalbum info to AbstractAlbum table and Songs associated with abstractalbum
   148         *           in the music collection database
   149         *           in the music collection database
   149         * @param aMedia songDetails object  which contains file path,
   150         * @param aMedia media object         
       
   151         * @param aItemChangedMessages a list of change events as a result of the
       
   152         *           song update
       
   153         * @return ETrue if UI visible change else EFalse
       
   154         */
       
   155         CMPXDbActiveTask::TChangeVisibility UpdateAbstractAlbumL(const CMPXMedia& aMedia,
       
   156             CMPXMessageArray& aItemChangedMessages);
       
   157 
       
   158         /**
       
   159         * Update all songs which associate with AbstractAlbum to new AbstractAlbum info 
       
   160         * in the collection
       
   161         * @param aMedia media object  which contains file path,
   150         *           artist, composer, name(title), track, etc...
   162         *           artist, composer, name(title), track, etc...
   151         * @param aItemChangedMessages a list of change events as a result of the
   163         * @param aItemChangedMessages a list of change events as a result of the
   152         *           song update
   164         *           song update
   153         * @return ETrue if UI visible change else EFalse
   165         * @return ETrue if UI visible change else EFalse
   154         */       
   166         */
   155         CMPXDbActiveTask::TChangeVisibility UpdateAbstractAlbumSongsL(const CMPXMedia& aMedia,
   167         CMPXDbActiveTask::TChangeVisibility UpdateSongsAbstractAlbumInfoL(const CMPXMedia& aMedia,
   156             CMPXMessageArray& aItemChangedMessages);
   168             CMPXMessageArray& aItemChangedMessages);
   157 #endif // ABSTRACTAUDIOALBUM_INCLUDED      
   169 #endif // ABSTRACTAUDIOALBUM_INCLUDED
   158         /**
   170         /**
   159         * Update playlist info in the music collection database
   171         * Update playlist info in the music collection database
   160         * @param aMedia playlist details object which contains file path,
   172         * @param aMedia playlist details object which contains file path,
   161         *           timestamps etc.
   173         *           timestamps etc.
   162         * @param aMessageArray change event messages for the playlist update
   174         * @param aMessageArray change event messages for the playlist update
   239         */
   251         */
   240         void RemovePlaylistL(TUint32 aPlaylistId, CDesCArray& aUriArray,
   252         void RemovePlaylistL(TUint32 aPlaylistId, CDesCArray& aUriArray,
   241             CMPXMessageArray& aItemChangedMessages);
   253             CMPXMessageArray& aItemChangedMessages);
   242 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
   254 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
   243         /**
   255         /**
   244         * Remove a abstractalbum This will remove all the songs from the abstractalbum
   256         * Remove a abstractalbum, remove entry from AbstractAlbum table, 
       
   257         * Thumbnail table, corresponding alb from file system
   245         * @param aAbstractAlbumId ID of the abstractalbum to remove
   258         * @param aAbstractAlbumId ID of the abstractalbum to remove
   246         * @param aUriArray a descriptor array to contain the URI of the deleted file
       
   247         * @param aItemChangedMessages a list of change events as a result of the
   259         * @param aItemChangedMessages a list of change events as a result of the
   248         *        abstractalbum removal
   260         *        abstractalbum removal
   249         */
   261         * @param aFileDeleted indicate if alb file already deleted from file system
   250         void RemoveAbstractAlbumL(TUint32 aAbstractAlbumId, CDesCArray& aUriArray,
   262         */
   251             CMPXMessageArray& aItemChangedMessages);
   263         void RemoveAbstractAlbumL(TUint32 aAbstractAlbumId,
   252 #endif // ABSTRACTAUDIOALBUM_INCLUDED         
   264             CMPXMessageArray& aItemChangedMessages, TBool aFileDeleted); 
       
   265 #endif // ABSTRACTAUDIOALBUM_INCLUDED
   253 
   266 
   254         /**
   267         /**
   255         * Remove a song from the specified playlist.
   268         * Remove a song from the specified playlist.
   256         * @param aPlaylistId ID of the playlist to remove the song from
   269         * @param aPlaylistId ID of the playlist to remove the song from
   257         * @param aSongId Id of the song in the playlist to be removed
   270         * @param aSongId Id of the song in the playlist to be removed
   876         * @param aItemChangedMessages on return contains changed messages for all
   889         * @param aItemChangedMessages on return contains changed messages for all
   877         *        affected items
   890         *        affected items
   878         */
   891         */
   879         void DoRemovePlaylistL(TUint32 aPlaylistId, CDesCArray& aUriArray,
   892         void DoRemovePlaylistL(TUint32 aPlaylistId, CDesCArray& aUriArray,
   880             CMPXMessageArray& aItemChangedMessages);
   893             CMPXMessageArray& aItemChangedMessages);
   881 #ifdef ABSTRACTAUDIOALBUM_INCLUDED        
   894 
   882         /**
   895 
   883         * Deletes a specified abstractalbum.
       
   884         * @param aAbstractAlbumId the abstractalbum to be deleted.
       
   885         * @param aUriArray on return contains the URIs of the items deleted.
       
   886         * @param aItemChangedMessages on return contains changed messages for all
       
   887         *        affected items
       
   888         */
       
   889         void DoRemoveAbstractAlbumL(TUint32 aAbstractalbumId, CDesCArray& aUriArray,
       
   890             CMPXMessageArray& aItemChangedMessages);
       
   891 #endif // ABSTRACTAUDIOALBUM_INCLUDED
       
   892         /**
   896         /**
   893         * Deletes a song from a playlist.
   897         * Deletes a song from a playlist.
   894         * @param aPlaylistId identifies the playlist.
   898         * @param aPlaylistId identifies the playlist.
   895         * @param aSongId song to be deleted.
   899         * @param aSongId song to be deleted.
   896         * @param aOrdinal song ordinal in case there are multiple instances of the same
   900         * @param aOrdinal song ordinal in case there are multiple instances of the same
   899         *        affected items
   903         *        affected items
   900         */
   904         */
   901         void DoRemoveSongFromPlaylistL(TUint32 aPlaylistId, const TMPXItemId& aSongId,
   905         void DoRemoveSongFromPlaylistL(TUint32 aPlaylistId, const TMPXItemId& aSongId,
   902             TInt aOrdinal, CMPXMessageArray& aItemChangedMessages);
   906             TInt aOrdinal, CMPXMessageArray& aItemChangedMessages);
   903 
   907 
       
   908 #ifdef ABSTRACTAUDIOALBUM_INCLUDED  
       
   909         /**
       
   910         * Remove all abstractalbum items with no songs associated,
       
   911         * TN and .alb files also removed.
       
   912         *
       
   913         */
       
   914         void RemoveAbstractAlbumsWithNoSongL();
       
   915         
       
   916           /**
       
   917         /* When refresh library, Remove .alb entry from AbstractAlnum table, TN table if .alb files deleted 
       
   918         /* from file manager 
       
   919         */
       
   920         void AbstractAlbumCleanUpL();
       
   921        
       
   922 #endif // ABSTRACTAUDIOALBUM_INCLUDED
       
   923 
   904         /**
   924         /**
   905         * Deletes all song records marked as deleted.
   925         * Deletes all song records marked as deleted.
   906         */
   926         */
   907         void DoCleanupDeletedRecordsL();
   927         void DoCleanupDeletedRecordsL();
   908 
   928 
  1006 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  1026 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  1007         /**
  1027         /**
  1008         * @see MMPXDbMusicObserver
  1028         * @see MMPXDbMusicObserver
  1009         */
  1029         */
  1010         virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory,
  1030         virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory,
  1011             const TDesC& aName, TInt aDriveId,
  1031             const TDesC& aName,
       
  1032             TInt aDriveId,
  1012             CMPXMessageArray* aItemChangedMessages, TBool& aItemExist,
  1033             CMPXMessageArray* aItemChangedMessages, TBool& aItemExist,
  1013             const TDesC& aAlbumArtist=KNullDesC,
  1034             const TDesC& aUri,
  1014             const TDesC& aGenre=KNullDesC);
  1035             const TDesC& aAlbumArtist=KNullDesC);
  1015 #else
  1036 #else
  1016 
  1037 
  1017         /**
  1038         /**
  1018         * @see MMPXDbMusicObserver
  1039         * @see MMPXDbMusicObserver
  1019         */
  1040         */
  1043 
  1064 
  1044         /**
  1065         /**
  1045         * @see MMPXDbMusicObserver
  1066         * @see MMPXDbMusicObserver
  1046         */
  1067         */
  1047         virtual void HandlePlaybackTimeModifiedL(CMPXMessageArray& aItemChangedMessages);
  1068         virtual void HandlePlaybackTimeModifiedL(CMPXMessageArray& aItemChangedMessages);
  1048 #ifdef ABSTRACTAUDIOALBUM_INCLUDED      
  1069 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  1049         /**
  1070         /**
  1050         * @see MMPXDbMusicObserver
  1071         * @see MMPXDbMusicObserver
  1051         */
  1072         */
  1052         virtual HBufC* HandleGetAlbumNameFromIdL(TUint32 aId);
  1073         virtual HBufC* HandleGetAlbumNameFromIdL(TUint32 aId);
  1053 #endif // ABSTRACTAUDIOALBUM_INCLUDED
  1074 #endif // ABSTRACTAUDIOALBUM_INCLUDED