51 public: |
51 public: |
52 |
52 |
53 /** |
53 /** |
54 * Add a category item. If the record already exists, its counter will |
54 * Add a category item. If the record already exists, its counter will |
55 * be incremented. |
55 * be incremented. |
56 * @param aCategory category type |
56 * @param aName: This is the name to be entered into the row |
57 * @param aMedia: This is the media object to be entered into the row |
|
58 * @param aDriveId: The Drive Id the name (category) belongs |
57 * @param aDriveId: The Drive Id the name (category) belongs |
59 * @param aNewRecord: indicates to the caller if a new record is created. |
58 * @param aNewRecord: indicates to the caller if a new record is created. |
60 * ETrue if a new row is created in the table; otherwise EFalse. |
59 * ETrue if a new row is created in the table; otherwise EFalse. |
61 * @param aCaseSensitive indicates whether case sensitivity should be taken |
60 * @param aCaseSensitive indicates whether case sensitivity should be taken |
62 * into consideration when generating the unique row id |
61 * into consideration when generating the unique row id |
63 * @return The unique id of the row added. |
62 * @return The unique id of the row added. |
64 */ |
63 */ |
65 virtual TUint32 AddItemL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia, TInt aDriveId, TBool& aNewRecord, |
64 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
65 virtual TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord, |
66 TBool aCaseSensitive = ETrue); |
66 TBool aCaseSensitive = ETrue); |
67 |
67 #else |
|
68 TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord, |
|
69 TBool aCaseSensitive = ETrue); |
|
70 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
|
71 |
68 /** |
72 /** |
69 * Get the name field for a given ID. |
73 * Get the name field for a given ID. |
70 * @param aId identifies the category item |
74 * @param aId identifies the category item |
71 * @return name that matches aId. Ownership is abandoned. |
75 * @return name that matches aId. Ownership is abandoned. |
72 */ |
76 */ |
84 * @param aAttrs, attributes for the matching record(s) |
88 * @param aAttrs, attributes for the matching record(s) |
85 * @param aMediaArray returns the matching record(s) |
89 * @param aMediaArray returns the matching record(s) |
86 */ |
90 */ |
87 void FindAllL(const CMPXMedia& aCriteria, const TArray<TMPXAttribute>& aAttrs, |
91 void FindAllL(const CMPXMedia& aCriteria, const TArray<TMPXAttribute>& aAttrs, |
88 CMPXMediaArray& aMediaArray); |
92 CMPXMediaArray& aMediaArray); |
89 |
93 |
90 /** |
94 /** |
91 * Decrement the number of songs for the item. If the count gets to 0, remove |
95 * Decrement the number of songs for the item. If the count gets to 0, remove |
92 * the item. |
96 * the item. |
93 * @param aId: The ID of the category to delete. |
97 * @param aId: The ID of the category to delete. |
94 * @param aDriveId: The drive Id the name (category) belongs to. Songs on different |
98 * @param aDriveId: The drive Id the name (category) belongs to. Songs on different |
103 */ |
107 */ |
104 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
108 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
105 virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId, |
109 virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId, |
106 CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, TBool aMtpInUse = EFalse); |
110 CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, TBool aMtpInUse = EFalse); |
107 #else |
111 #else |
108 virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId, |
112 void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId, |
109 CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); |
113 CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); |
110 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
114 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
111 /** |
115 /** |
112 * Deletes a category. |
116 * Deletes a category. |
113 * @param aId identifies the category |
117 * @param aId identifies the category |
177 * @param aId: The ID of the category to update |
181 * @param aId: The ID of the category to update |
178 * @param aMedia: The media data |
182 * @param aMedia: The media data |
179 * @param aDriveId: The Drive Id the name (category) belongs |
183 * @param aDriveId: The Drive Id the name (category) belongs |
180 * @param aItemChangedMessages: if valid on return contains a updated message if the |
184 * @param aItemChangedMessages: if valid on return contains a updated message if the |
181 * category was updated |
185 * category was updated |
182 */ |
186 */ |
183 virtual void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages); |
187 void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages); |
184 |
188 |
185 protected: |
189 protected: |
186 |
190 |
187 /** |
191 /** |
188 * Updates the media with information from the table |
192 * Updates the media with information from the table |
216 * @param aMediaArray returns the media instances |
220 * @param aMediaArray returns the media instances |
217 */ |
221 */ |
218 void ProcessRecordsetL(const TArray<TMPXAttribute>& aAttrs, |
222 void ProcessRecordsetL(const TArray<TMPXAttribute>& aAttrs, |
219 RSqlStatement& aRecordset, CMPXMediaArray& aMediaArray); |
223 RSqlStatement& aRecordset, CMPXMediaArray& aMediaArray); |
220 |
224 |
221 private: |
|
222 /** |
|
223 * Retrieve name from media object based on category |
|
224 * @param aCategory the category to retrieve name |
|
225 * @param aMedia media object |
|
226 * @return name |
|
227 */ |
|
228 TPtrC ItemNameL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia); |
|
229 |
|
230 private: // from MMPXTable |
225 private: // from MMPXTable |
231 |
226 |
232 /** |
227 /** |
233 * @see MMPXTable |
228 * @see MMPXTable |
234 */ |
229 */ |