18
|
1 |
/**
|
|
2 |
* Copyright (c) 2010 Sasken Communication Technologies Ltd.
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the "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 |
* Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
* Manasij Roy, Nalina Hariharan
|
|
14 |
*
|
|
15 |
* Description:
|
25
|
16 |
* The SmfAlbum class represents an album
|
18
|
17 |
*
|
|
18 |
*/
|
|
19 |
#ifndef SMFALBUM_H_
|
|
20 |
#define SMFALBUM_H_
|
|
21 |
|
|
22 |
#include <QImage>
|
|
23 |
#include <qdatastream.h>
|
|
24 |
#include <QSharedData>
|
25
|
25 |
#include <QMetaType>
|
18
|
26 |
#include <smfclientglobal.h>
|
|
27 |
|
|
28 |
class SmfAlbumPrivate;
|
|
29 |
class SmfArtists;
|
25
|
30 |
class SmfLocation;
|
|
31 |
|
|
32 |
|
|
33 |
// Enums
|
|
34 |
enum SmfAlbumMediaType
|
|
35 |
{
|
|
36 |
SmfAlbumUnspecified,
|
|
37 |
SmfAlbumMusic,
|
|
38 |
SmfAlbumVideo,
|
|
39 |
SmfAlbumMixed
|
|
40 |
};
|
18
|
41 |
|
|
42 |
/**
|
|
43 |
* @ingroup smf_common_group
|
|
44 |
* The SmfAlbum class represents a music album
|
|
45 |
*/
|
|
46 |
class SMFCOMMON_EXPORT SmfAlbum
|
|
47 |
{
|
|
48 |
public:
|
|
49 |
/**
|
|
50 |
* Constructor with default argument
|
|
51 |
*/
|
|
52 |
SmfAlbum( );
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Copy Constructor
|
|
56 |
* @param aOther The reference object
|
|
57 |
*/
|
|
58 |
SmfAlbum( const SmfAlbum &aOther );
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Overloaded = operator
|
|
62 |
* @param aOther The reference object
|
|
63 |
* @return The target reference value
|
|
64 |
*/
|
|
65 |
SmfAlbum& operator=( const SmfAlbum &aOther );
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Destructor
|
|
69 |
*/
|
|
70 |
~SmfAlbum( );
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Method to get the album name
|
|
74 |
* @return The album name
|
|
75 |
*/
|
|
76 |
QString name( ) const;
|
|
77 |
|
|
78 |
/**
|
25
|
79 |
* Method to get the album's image url if any
|
|
80 |
* @return The album's image url if any
|
18
|
81 |
*/
|
25
|
82 |
QUrl imageUrl( ) const;
|
18
|
83 |
|
|
84 |
/**
|
|
85 |
* Method to get the artist names
|
|
86 |
* @return The list of artists in the album
|
|
87 |
*/
|
|
88 |
SmfArtists artists( ) const;
|
|
89 |
|
|
90 |
/**
|
25
|
91 |
* Method to get the location of this album
|
|
92 |
* @return The location of this album
|
|
93 |
*/
|
|
94 |
SmfLocation location( ) const;
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Method to get the number of items in this album
|
|
98 |
* @return The number of items in this album
|
|
99 |
*/
|
|
100 |
int itemsCount( ) const;
|
|
101 |
|
|
102 |
/**
|
|
103 |
* Method to get the type of this album
|
|
104 |
* @return The type of this album
|
|
105 |
*/
|
|
106 |
SmfAlbumMediaType type( ) const;
|
|
107 |
|
|
108 |
/**
|
|
109 |
* Method to get the id of the album, id is unique to service provider
|
18
|
110 |
* @return The ID value
|
|
111 |
*/
|
|
112 |
QString id( ) const;
|
|
113 |
|
|
114 |
/**
|
25
|
115 |
* Method to get the secondary id of the album, e.g. musicbrainz id of the album for a music album
|
|
116 |
* @return The ID value
|
|
117 |
*/
|
|
118 |
QString secondaryId( ) const;
|
|
119 |
|
|
120 |
|
|
121 |
/**
|
18
|
122 |
* Method to set the album name
|
|
123 |
* @param aName The album name
|
|
124 |
*/
|
|
125 |
void setName( const QString &aName );
|
|
126 |
|
|
127 |
/**
|
25
|
128 |
* Method to set the album's image url
|
|
129 |
* @param aUrl The album's image url
|
18
|
130 |
*/
|
25
|
131 |
void setImageUrl( const QUrl &aUrl );
|
18
|
132 |
|
|
133 |
/**
|
|
134 |
* Method to set the artist names
|
|
135 |
* @param aArtists The list of artists in the album
|
|
136 |
*/
|
|
137 |
void setArtists( const SmfArtists &aArtists );
|
|
138 |
|
|
139 |
/**
|
25
|
140 |
* Method to set the location of this album
|
|
141 |
* @param aLoc The location of the album
|
|
142 |
*/
|
|
143 |
void setLocation(const SmfLocation &aLoc );
|
|
144 |
|
|
145 |
/**
|
|
146 |
* Method to set the number of items in this album
|
|
147 |
* @param aCount the number of items in this album
|
|
148 |
*/
|
|
149 |
void setItemsCount( const int aCount );
|
|
150 |
|
|
151 |
/**
|
|
152 |
* Method to set the type of this album
|
|
153 |
* @param aType the type of this album
|
|
154 |
*/
|
|
155 |
void setType(SmfAlbumMediaType aType);
|
|
156 |
|
|
157 |
/**
|
18
|
158 |
* Method to set the id of the album
|
|
159 |
* @param aId The ID value
|
|
160 |
*/
|
|
161 |
void setId( const QString &aId );
|
|
162 |
|
25
|
163 |
/**
|
|
164 |
* Method to set the secondary id of the album, e.g. musicbrainz id of the album for a music album
|
|
165 |
* @param aSecondaryID the secondaryID of this album
|
|
166 |
*/
|
|
167 |
void setSecondaryId( const QString &aSecondaryID );
|
|
168 |
|
|
169 |
|
18
|
170 |
private:
|
|
171 |
QSharedDataPointer<SmfAlbumPrivate> d;
|
|
172 |
|
|
173 |
friend QDataStream &operator<<( QDataStream &aDataStream,
|
|
174 |
const SmfAlbum &aAlbum );
|
|
175 |
|
|
176 |
friend QDataStream &operator>>( QDataStream &aDataStream,
|
|
177 |
SmfAlbum &aAlbum );
|
|
178 |
|
|
179 |
};
|
|
180 |
|
|
181 |
|
|
182 |
/**
|
|
183 |
* Method for Externalization. Writes the SmfAlbum object to
|
|
184 |
* the stream and returns a reference to the stream.
|
|
185 |
* @param aDataStream Stream to be written
|
|
186 |
* @param aAlbum The SmfAlbum object to be externalized
|
|
187 |
* @return reference to the written stream
|
|
188 |
*/
|
|
189 |
SMFCOMMON_EXPORT QDataStream &operator<<( QDataStream &aDataStream,
|
|
190 |
const SmfAlbum &aAlbum );
|
|
191 |
|
|
192 |
/**
|
|
193 |
* Method for Internalization. Reads a SmfAlbum object from
|
|
194 |
* the stream and returns a reference to the stream.
|
|
195 |
* @param aDataStream Stream to be read
|
|
196 |
* @param aAlbum The SmfAlbum object to be internalized
|
|
197 |
* @return reference to the stream
|
|
198 |
*/
|
|
199 |
SMFCOMMON_EXPORT QDataStream &operator>>( QDataStream &aDataStream,
|
|
200 |
SmfAlbum &aAlbum);
|
|
201 |
|
25
|
202 |
typedef QList<SmfAlbum> SmfAlbumList;
|
|
203 |
|
18
|
204 |
// Make the class SmfAlbum known to QMetaType, so that as to register it.
|
|
205 |
Q_DECLARE_METATYPE(SmfAlbum)
|
|
206 |
Q_DECLARE_METATYPE(QList<SmfAlbum>)
|
|
207 |
|
|
208 |
#endif /* SMFALBUM_H_ */
|