11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * Manasij Roy, Nalina Hariharan |
13 * Manasij Roy, Nalina Hariharan |
14 * |
14 * |
15 * Description: |
15 * Description: |
16 * The SmfAlbum class represents a music album |
16 * The SmfAlbum class represents an album |
17 * |
17 * |
18 */ |
18 */ |
19 #ifndef SMFALBUM_H_ |
19 #ifndef SMFALBUM_H_ |
20 #define SMFALBUM_H_ |
20 #define SMFALBUM_H_ |
21 |
21 |
22 #include <QImage> |
22 #include <QImage> |
23 #include <qdatastream.h> |
23 #include <qdatastream.h> |
24 #include <QSharedData> |
24 #include <QSharedData> |
|
25 #include <QMetaType> |
25 #include <smfclientglobal.h> |
26 #include <smfclientglobal.h> |
26 #include <QMetaType> |
|
27 |
27 |
28 class SmfAlbumPrivate; |
28 class SmfAlbumPrivate; |
29 class SmfArtists; |
29 class SmfArtists; |
|
30 class SmfLocation; |
|
31 |
|
32 |
|
33 // Enums |
|
34 enum SmfAlbumMediaType |
|
35 { |
|
36 SmfAlbumUnspecified, |
|
37 SmfAlbumMusic, |
|
38 SmfAlbumVideo, |
|
39 SmfAlbumMixed |
|
40 }; |
30 |
41 |
31 /** |
42 /** |
32 * @ingroup smf_common_group |
43 * @ingroup smf_common_group |
33 * The SmfAlbum class represents a music album |
44 * The SmfAlbum class represents a music album |
34 */ |
45 */ |
63 * @return The album name |
74 * @return The album name |
64 */ |
75 */ |
65 QString name( ) const; |
76 QString name( ) const; |
66 |
77 |
67 /** |
78 /** |
68 * Method to get the album's image |
79 * Method to get the album's image url if any |
69 * @return The album's image |
80 * @return The album's image url if any |
70 */ |
81 */ |
71 QImage image( ) const; |
82 QUrl imageUrl( ) const; |
72 |
83 |
73 /** |
84 /** |
74 * Method to get the artist names |
85 * Method to get the artist names |
75 * @return The list of artists in the album |
86 * @return The list of artists in the album |
76 */ |
87 */ |
77 SmfArtists artists( ) const; |
88 SmfArtists artists( ) const; |
78 |
89 |
79 /** |
90 /** |
80 * Method to get the id of the album |
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 |
81 * @return The ID value |
110 * @return The ID value |
82 */ |
111 */ |
83 QString id( ) const; |
112 QString id( ) const; |
|
113 |
|
114 /** |
|
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 |
84 |
120 |
85 /** |
121 /** |
86 * Method to set the album name |
122 * Method to set the album name |
87 * @param aName The album name |
123 * @param aName The album name |
88 */ |
124 */ |
89 void setName( const QString &aName ); |
125 void setName( const QString &aName ); |
90 |
126 |
91 /** |
127 /** |
92 * Method to set the album's image |
128 * Method to set the album's image url |
93 * @param aImage The album's image |
129 * @param aUrl The album's image url |
94 */ |
130 */ |
95 void setImage( const QImage &aImage ); |
131 void setImageUrl( const QUrl &aUrl ); |
96 |
132 |
97 /** |
133 /** |
98 * Method to set the artist names |
134 * Method to set the artist names |
99 * @param aArtists The list of artists in the album |
135 * @param aArtists The list of artists in the album |
100 */ |
136 */ |
101 void setArtists( const SmfArtists &aArtists ); |
137 void setArtists( const SmfArtists &aArtists ); |
102 |
138 |
103 /** |
139 /** |
|
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 /** |
104 * Method to set the id of the album |
158 * Method to set the id of the album |
105 * @param aId The ID value |
159 * @param aId The ID value |
106 */ |
160 */ |
107 void setId( const QString &aId ); |
161 void setId( const QString &aId ); |
|
162 |
|
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 |
108 |
169 |
109 private: |
170 private: |
110 QSharedDataPointer<SmfAlbumPrivate> d; |
171 QSharedDataPointer<SmfAlbumPrivate> d; |
111 |
172 |
112 friend QDataStream &operator<<( QDataStream &aDataStream, |
173 friend QDataStream &operator<<( QDataStream &aDataStream, |
136 * @return reference to the stream |
197 * @return reference to the stream |
137 */ |
198 */ |
138 SMFCOMMON_EXPORT QDataStream &operator>>( QDataStream &aDataStream, |
199 SMFCOMMON_EXPORT QDataStream &operator>>( QDataStream &aDataStream, |
139 SmfAlbum &aAlbum); |
200 SmfAlbum &aAlbum); |
140 |
201 |
|
202 typedef QList<SmfAlbum> SmfAlbumList; |
|
203 |
141 // Make the class SmfAlbum known to QMetaType, so that as to register it. |
204 // Make the class SmfAlbum known to QMetaType, so that as to register it. |
142 Q_DECLARE_METATYPE(SmfAlbum) |
205 Q_DECLARE_METATYPE(SmfAlbum) |
143 Q_DECLARE_METATYPE(QList<SmfAlbum>) |
206 Q_DECLARE_METATYPE(QList<SmfAlbum>) |
144 |
207 |
145 #endif /* SMFALBUM_H_ */ |
208 #endif /* SMFALBUM_H_ */ |