mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbcategory.h
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbcategory.h Wed Sep 01 12:32:02 2010 +0100
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbcategory.h Tue Sep 14 21:14:08 2010 +0300
@@ -53,7 +53,8 @@
/**
* Add a category item. If the record already exists, its counter will
* be incremented.
- * @param aName: This is the name to be entered into the row
+ * @param aCategory category type
+ * @param aMedia: This is the media object to be entered into the row
* @param aDriveId: The Drive Id the name (category) belongs
* @param aNewRecord: indicates to the caller if a new record is created.
* ETrue if a new row is created in the table; otherwise EFalse.
@@ -61,14 +62,9 @@
* into consideration when generating the unique row id
* @return The unique id of the row added.
*/
-#ifdef ABSTRACTAUDIOALBUM_INCLUDED
- virtual TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord,
+ virtual TUint32 AddItemL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia, TInt aDriveId, TBool& aNewRecord,
TBool aCaseSensitive = ETrue);
-#else
- TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord,
- TBool aCaseSensitive = ETrue);
-#endif // ABSTRACTAUDIOALBUM_INCLUDED
-
+
/**
* Get the name field for a given ID.
* @param aId identifies the category item
@@ -90,7 +86,7 @@
*/
void FindAllL(const CMPXMedia& aCriteria, const TArray<TMPXAttribute>& aAttrs,
CMPXMediaArray& aMediaArray);
-
+
/**
* Decrement the number of songs for the item. If the count gets to 0, remove
* the item.
@@ -109,7 +105,7 @@
virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, TBool aMtpInUse = EFalse);
#else
- void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
+ virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
CMPXMessageArray* aItemChangedMessages, TBool& aItemExist);
#endif // ABSTRACTAUDIOALBUM_INCLUDED
/**
@@ -183,8 +179,8 @@
* @param aDriveId: The Drive Id the name (category) belongs
* @param aItemChangedMessages: if valid on return contains a updated message if the
* category was updated
- */
- void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages);
+ */
+ virtual void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages);
protected:
@@ -222,6 +218,15 @@
void ProcessRecordsetL(const TArray<TMPXAttribute>& aAttrs,
RSqlStatement& aRecordset, CMPXMediaArray& aMediaArray);
+ private:
+ /**
+ * Retrieve name from media object based on category
+ * @param aCategory the category to retrieve name
+ * @param aMedia media object
+ * @return name
+ */
+ TPtrC ItemNameL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia);
+
private: // from MMPXTable
/**