author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:14:08 +0300 | |
branch | RCL_3 |
changeset 56 | 2cbbefa9af78 |
parent 53 | 3de6c4cf6b67 |
child 66 | 1f1dad4af8f8 |
permissions | -rw-r--r-- |
53 | 1 |
/* |
2 |
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: This class is responsible for all category tables (Artist, |
|
15 |
* Album, Genre, Composer). |
|
16 |
* |
|
17 |
* |
|
18 |
*/ |
|
19 |
||
20 |
||
21 |
#ifndef MPXDBALBUM_H |
|
22 |
#define MPXDBALBUM_H |
|
23 |
||
24 |
// INCLUDES |
|
25 |
#include "mpxdbcategory.h" |
|
26 |
||
27 |
// CLASS DECLARATION |
|
28 |
||
29 |
class MMPXDbAlbumObserver |
|
30 |
{ |
|
31 |
public: |
|
32 |
/** |
|
33 |
* HandleAlbumartForAlbumL. |
|
34 |
* @param aId, The album ID. |
|
35 |
* @param aArt, The albumart uri. |
|
36 |
* @returns alternative albumart retrieved in the specified Album. |
|
37 |
*/ |
|
38 |
virtual HBufC* HandleAlbumartForAlbumL( const TUint32 aId, TPtrC aArt ) = 0; |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
39 |
|
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
40 |
/** |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
41 |
* Called when album artist is removed from an album |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
42 |
* @param aCategoryId category item ID |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
43 |
* @param aDrive drive the category item is on |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
44 |
* @param aItemChangedMessages changed mesages array to be updated or NULL |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
45 |
*/ |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
46 |
virtual void DeleteAlbumForArtistL(TUint32 aCategoryId, |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
47 |
TInt aDrive, CMPXMessageArray* aItemChangedMessages) = 0; |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
48 |
|
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
49 |
/** |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
50 |
* Called when album artist is added to an album |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
51 |
* @param aName name string |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
52 |
* @param aArt Album art path |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
53 |
* @param aDriveId drive to add the category to |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
54 |
* @return the ID of the category item (new or existing) |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
55 |
*/ |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
56 |
virtual TUint32 AddAlbumArtistL(const TDesC& aName, const TDesC& aArt, TInt aDriveId) = 0; |
53 | 57 |
}; |
58 |
/** |
|
59 |
* Responsible for managing all music databases |
|
60 |
* |
|
61 |
* @lib MPXDbPlugin.lib |
|
62 |
*/ |
|
63 |
||
64 |
class CMPXDbAlbum : |
|
65 |
public CMPXDbCategory |
|
66 |
{ |
|
67 |
public: |
|
68 |
||
69 |
/** |
|
70 |
* Two-phased constructor. |
|
71 |
* @param aDbManager database manager to use for database interactions |
|
72 |
* @param aCategory identifies the category |
|
73 |
* @return New CMPXDbCategory instance. |
|
74 |
*/ |
|
75 |
static CMPXDbAlbum* NewL(CMPXDbManager& aDbManager, |
|
76 |
TMPXGeneralCategory aCategory, MMPXDbAlbumObserver& aObserver); |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
77 |
|
53 | 78 |
/** |
79 |
* Two-phased constructor. |
|
80 |
* @param aDbManager database manager to use for database interactions |
|
81 |
* @param aCategory identifies the category |
|
82 |
* @return New CMPXDbCategory instance on the cleanup stack. |
|
83 |
*/ |
|
84 |
static CMPXDbAlbum* NewLC(CMPXDbManager& aDbManager, |
|
85 |
TMPXGeneralCategory aCategory, MMPXDbAlbumObserver& aObserver); |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
86 |
|
53 | 87 |
/** |
88 |
* Destructor |
|
89 |
*/ |
|
90 |
virtual ~CMPXDbAlbum(); |
|
91 |
||
92 |
public: |
|
93 |
/** |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
94 |
* Add an album item. If the record already exists, its counter will |
53 | 95 |
* be incremented. |
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
96 |
* @param aCategory category type |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
97 |
* @param aMedia: The media object |
53 | 98 |
* @param aDriveId: The Drive Id the name (category) belongs |
99 |
* @param aNewRecord: indicates to the caller if a new record is created. |
|
100 |
* ETrue if a new row is created in the table; otherwise EFalse. |
|
101 |
* @param aCaseSensitive indicates whether case sensitivity should be taken |
|
102 |
* into consideration when generating the unique row id |
|
103 |
* @return The unique id of the row added. |
|
104 |
*/ |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
105 |
virtual TUint32 AddItemL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia, TInt aDriveId, TBool& aNewRecord, |
53 | 106 |
TBool aCaseSensitive = ETrue); |
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
107 |
|
53 | 108 |
/** |
109 |
* Decrement the number of songs for the item. If the count gets to 0, remove |
|
110 |
* the item. |
|
111 |
* @param aId: The ID of the category to delete. |
|
112 |
* @param aDriveId: The drive Id the name (category) belongs to. Songs on different |
|
113 |
* drives may belong to the same album or artist; consequently, one |
|
114 |
* row for each artist/album id and drive ID pair will exist in the |
|
115 |
* lookup table with a count existing for each row that tracks the |
|
116 |
* number number of songs on that drive with that album/artist. |
|
117 |
* @param aItemChangedMessages if valid on return contains a deleted message if the |
|
118 |
* category was deleted |
|
119 |
* @param aItemExist Out parameter, ETrue if the category is not deleted after the delete, |
|
120 |
* EFalse otherwise |
|
121 |
* @param aArt: The albumart uri |
|
122 |
*/ |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
123 |
void DecrementSongsForAlbumL(TUint32 aId, TInt aDriveId, |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
124 |
CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, const TDesC& aArt ); |
53 | 125 |
|
126 |
/** |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
127 |
* Gets the details for all category items. |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
128 |
* @param aAttrs attributes to be returned |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
129 |
* @param aMediaArray returns the requested attributes for all items |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
130 |
*/ |
53 | 131 |
void GetAllCategoryItemsL(const TArray<TMPXAttribute>& aAttrs, |
132 |
CMPXMediaArray& aMediaArray); |
|
133 |
||
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
134 |
/** |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
135 |
* Update a category item. |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
136 |
* @param aId: The ID of the category to update |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
137 |
* @param aMedia: The media data |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
138 |
* @param aDriveId: The Drive Id the name (category) belongs |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
139 |
* @param aItemChangedMessages: if valid on return contains a updated message if the |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
140 |
* category was updated |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
141 |
*/ |
53 | 142 |
void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages); |
143 |
||
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
144 |
public: |
53 | 145 |
/** |
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
146 |
* Get songs count for a specified album and a specified artist |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
147 |
* @param aArtistId: The ID of the artist |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
148 |
* @param aAlbumId: The ID of the album |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
149 |
*/ |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
150 |
TInt GetSongsCountInAlbumMatchingArtistL(TUint32 aArtistId, TUint32 aAlbumId); |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
151 |
/** |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
152 |
* Check if the specified album ID is an unknown album. |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
153 |
* An “Unknown album” is one where the album name and album artist are unknown. |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
154 |
* @param aId: The ID of the album |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
155 |
* @return ETrue if it's an unknown album |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
156 |
*/ |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
157 |
TBool IsUnknownAlbumL(const TUint32 aId); |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
158 |
|
53 | 159 |
/** |
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
160 |
* Generate Unique ID for Album |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
161 |
* @param aMedia media object |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
162 |
* @param aCaseSensitive indicates whether case sensitivity should be taken |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
163 |
* into consideration when generating the unique row id |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
164 |
* @return the ID of album |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
165 |
*/ |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
166 |
TUint32 GenerateUniqueIdL(const CMPXMedia& aMedia); |
53 | 167 |
|
168 |
private: |
|
169 |
/** |
|
170 |
* Updates the media with information from the table |
|
171 |
* @param aRecord record containing the source fields |
|
172 |
* @param aAttrs attributes to be returned |
|
173 |
* @param aMedia returns the requested attributes |
|
174 |
*/ |
|
175 |
void UpdateMediaL(RSqlStatement& aRecord, const TArray<TMPXAttribute>& aAttrs, |
|
176 |
CMPXMedia& aMedia); |
|
177 |
||
178 |
/** |
|
179 |
* Generate searching criteria for album table from the given criteria |
|
180 |
* @param aMedia media data |
|
181 |
* @param aFields fields of Album table |
|
182 |
* @param aValues values of each field of Album table |
|
183 |
* @return a string containing the selection criteria. The ownership is passed to the caller. |
|
184 |
*/ |
|
185 |
void GenerateAlbumFieldsValuesL(const CMPXMedia& aMedia, |
|
186 |
CDesCArray& aFields, CDesCArray& aValues); |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
187 |
|
53 | 188 |
/** |
189 |
* Get the Albumart of song which belongs to the specified Album. |
|
190 |
* @param aId The ID of the album |
|
191 |
* @param aArt albumart with the song is deleted. |
|
192 |
* @returns alternative albumart retrieved in the specified Album. |
|
193 |
*/ |
|
194 |
HBufC* AlbumartForAlbumL(const TUint32 aId, TPtrC aArt); |
|
195 |
||
196 |
/** |
|
197 |
* Processes a recordset by constructing media instances and adding them |
|
198 |
* to the specified array. |
|
199 |
* @param aAttrs attributes to be returned |
|
200 |
* @param aRecordset recordset to be processed |
|
201 |
* @param aMediaArray returns the media instances |
|
202 |
*/ |
|
203 |
void ProcessAlbumRecordSetL(const TArray<TMPXAttribute>& aAttrs, |
|
204 |
RSqlStatement& aRecordset, CMPXMediaArray& aMediaArray); |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
205 |
|
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
206 |
/** |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
207 |
* Retrieve AlbumArtist name from media object |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
208 |
* @param aMedia media object |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
209 |
* @param aName returned name |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
210 |
* @return ETrue if name is available |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
211 |
*/ |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
212 |
TBool RetrieveAlbumArtistL(const CMPXMedia& aMedia, TPtrC& aName); |
53 | 213 |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
214 |
/** |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
215 |
* Retrieve Artist name from media object |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
216 |
* @param aMedia media object |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
217 |
* @param aName returned name |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
218 |
*/ |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
219 |
void RetrieveArtist(const CMPXMedia& aMedia, TPtrC& aName); |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
220 |
|
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
221 |
/** |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
222 |
* Check if Art needs to be updated |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
223 |
* @param aDeletedSongArt deleted song's art |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
224 |
* @param aCurrentAlbumArt Album's current art |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
225 |
* @return ETrue if aDeletedSongArt is not non-embedded album art and |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
226 |
* aDeleteSongArt and aCurrentAlbumArt are the same and known |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
227 |
*/ |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
228 |
TBool NeedToUpdateArt(const TDesC& aDeletedSongArt, const TDesC& aCurrentAlbumArt); |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
229 |
|
53 | 230 |
private: // from MMPXTable |
231 |
||
232 |
/** |
|
233 |
* @see MMPXTable |
|
234 |
*/ |
|
235 |
virtual void CreateTableL(RSqlDatabase& aDatabase, TBool aCorruptTable); |
|
236 |
||
237 |
/** |
|
238 |
* @see MMPXTable |
|
239 |
*/ |
|
240 |
virtual TBool CheckTableL(RSqlDatabase& aDatabase); |
|
241 |
||
242 |
private: |
|
243 |
||
244 |
/** |
|
245 |
* C++ constructor. |
|
246 |
* @param aDbManager database manager to use for database interactions |
|
247 |
* @param aCategory identifies the category |
|
248 |
*/ |
|
249 |
CMPXDbAlbum(CMPXDbManager& aDbManager, TMPXGeneralCategory aCategory, MMPXDbAlbumObserver& aObserver); |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
250 |
|
53 | 251 |
/** |
252 |
* Second phase constructor. |
|
253 |
*/ |
|
254 |
void ConstructL(); |
|
255 |
||
256 |
public: |
|
257 |
||
258 |
/** |
|
259 |
* Column indexes in the category tables |
|
260 |
*/ |
|
261 |
enum TAlbumColumns |
|
262 |
{ |
|
263 |
EAlbumUniqueId = KMPXTableDefaultIndex, |
|
264 |
EAlbumName, |
|
265 |
EAlbumSongCount, |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
266 |
EAlbumArtist, |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
267 |
EAlbumArtistName, |
53 | 268 |
EAlbumArt, |
269 |
EAlbumFieldCount |
|
270 |
}; |
|
271 |
||
272 |
private: // Data |
|
273 |
MMPXDbAlbumObserver& iObserver; |
|
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
274 |
RPointerArray<CMPXMedia> iUnknownArtists; |
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
275 |
RPointerArray<CMPXMedia> iUnknownAlbums; |
53 | 276 |
}; |
56
2cbbefa9af78
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
53
diff
changeset
|
277 |
|
53 | 278 |
#endif // MPXDBALBUM_H |
279 |
||
280 |
// End of File |