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 aName: This is the name to be entered into the row |
56 * @param aCategory category type |
|
57 * @param aMedia: This is the media object to be entered into the row |
57 * @param aDriveId: The Drive Id the name (category) belongs |
58 * @param aDriveId: The Drive Id the name (category) belongs |
58 * @param aNewRecord: indicates to the caller if a new record is created. |
59 * @param aNewRecord: indicates to the caller if a new record is created. |
59 * ETrue if a new row is created in the table; otherwise EFalse. |
60 * ETrue if a new row is created in the table; otherwise EFalse. |
60 * @param aCaseSensitive indicates whether case sensitivity should be taken |
61 * @param aCaseSensitive indicates whether case sensitivity should be taken |
61 * into consideration when generating the unique row id |
62 * into consideration when generating the unique row id |
62 * @return The unique id of the row added. |
63 * @return The unique id of the row added. |
63 */ |
64 */ |
64 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
65 virtual TUint32 AddItemL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia, TInt aDriveId, TBool& aNewRecord, |
65 virtual TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord, |
|
66 TBool aCaseSensitive = ETrue); |
66 TBool aCaseSensitive = ETrue); |
67 #else |
|
68 TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord, |
|
69 TBool aCaseSensitive = ETrue); |
|
70 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
|
71 |
67 |
72 /** |
68 /** |
73 * Get the name field for a given ID. |
69 * Get the name field for a given ID. |
74 * @param aId identifies the category item |
70 * @param aId identifies the category item |
75 * @return name that matches aId. Ownership is abandoned. |
71 * @return name that matches aId. Ownership is abandoned. |
107 */ |
103 */ |
108 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
104 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
109 virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId, |
105 virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId, |
110 CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, TBool aMtpInUse = EFalse); |
106 CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, TBool aMtpInUse = EFalse); |
111 #else |
107 #else |
112 void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId, |
108 virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId, |
113 CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); |
109 CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); |
114 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
110 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
115 /** |
111 /** |
116 * Deletes a category. |
112 * Deletes a category. |
117 * @param aId identifies the category |
113 * @param aId identifies the category |
155 * @param aParentCategory identifies the parent category |
151 * @param aParentCategory identifies the parent category |
156 * @param aParentId identifies the parent item |
152 * @param aParentId identifies the parent item |
157 * @param aAttrs attributes to be returned |
153 * @param aAttrs attributes to be returned |
158 * @param aMediaArray returns the requested attributes for all items |
154 * @param aMediaArray returns the requested attributes for all items |
159 */ |
155 */ |
160 void GetSubCategoryItemsL(TMPXGeneralCategory aParentCategory, TUint32 aParentId, |
156 virtual void GetSubCategoryItemsL(TMPXGeneralCategory aParentCategory, TUint32 aParentId, |
161 const TArray<TMPXAttribute>& aAttrs, CMPXMediaArray& aMediaArray); |
157 const TArray<TMPXAttribute>& aAttrs, CMPXMediaArray& aMediaArray); |
162 |
158 |
163 /** |
159 /** |
164 * Checks if the specified category item exists. |
160 * Checks if the specified category item exists. |
165 * @param aDriveId drive to check or KDbManagerAllDrives |
161 * @param aDriveId drive to check or KDbManagerAllDrives |
181 * @param aId: The ID of the category to update |
177 * @param aId: The ID of the category to update |
182 * @param aMedia: The media data |
178 * @param aMedia: The media data |
183 * @param aDriveId: The Drive Id the name (category) belongs |
179 * @param aDriveId: The Drive Id the name (category) belongs |
184 * @param aItemChangedMessages: if valid on return contains a updated message if the |
180 * @param aItemChangedMessages: if valid on return contains a updated message if the |
185 * category was updated |
181 * category was updated |
186 */ |
182 */ |
187 void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages); |
183 virtual void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages); |
188 |
184 |
189 protected: |
185 protected: |
190 |
186 |
191 /** |
187 /** |
192 * Updates the media with information from the table |
188 * Updates the media with information from the table |
220 * @param aMediaArray returns the media instances |
216 * @param aMediaArray returns the media instances |
221 */ |
217 */ |
222 void ProcessRecordsetL(const TArray<TMPXAttribute>& aAttrs, |
218 void ProcessRecordsetL(const TArray<TMPXAttribute>& aAttrs, |
223 RSqlStatement& aRecordset, CMPXMediaArray& aMediaArray); |
219 RSqlStatement& aRecordset, CMPXMediaArray& aMediaArray); |
224 |
220 |
|
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 |
225 private: // from MMPXTable |
230 private: // from MMPXTable |
226 |
231 |
227 /** |
232 /** |
228 * @see MMPXTable |
233 * @see MMPXTable |
229 */ |
234 */ |