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: |
|
16 * The SmfAlbum class represents a music album |
|
17 * |
|
18 */ |
|
19 #ifndef SMFALBUM_H_ |
|
20 #define SMFALBUM_H_ |
|
21 |
|
22 #include <QImage> |
|
23 #include <qdatastream.h> |
|
24 #include <QSharedData> |
|
25 #include <smfclientglobal.h> |
|
26 |
|
27 class SmfAlbumPrivate; |
|
28 class SmfArtists; |
|
29 |
|
30 /** |
|
31 * @ingroup smf_common_group |
|
32 * The SmfAlbum class represents a music album |
|
33 */ |
|
34 class SMFCLIENT_EXPORT SmfAlbum |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Constructor with default argument |
|
39 */ |
|
40 SmfAlbum( ); |
|
41 |
|
42 /** |
|
43 * Copy Constructor |
|
44 * @param aOther The reference object |
|
45 */ |
|
46 SmfAlbum( const SmfAlbum &aOther ); |
|
47 |
|
48 /** |
|
49 * Overloaded = operator |
|
50 * @param aOther The reference object |
|
51 * @return The target reference value |
|
52 */ |
|
53 SmfAlbum& operator=( const SmfAlbum &aOther ); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 */ |
|
58 ~SmfAlbum( ); |
|
59 |
|
60 /** |
|
61 * Method to get the album name |
|
62 * @return The album name |
|
63 */ |
|
64 QString name( ) const; |
|
65 |
|
66 /** |
|
67 * Method to get the album's image |
|
68 * @return The album's image |
|
69 */ |
|
70 QImage image( ) const; |
|
71 |
|
72 /** |
|
73 * Method to get the artist names |
|
74 * @return The list of artists in the album |
|
75 */ |
|
76 SmfArtists artists( ) const; |
|
77 |
|
78 /** |
|
79 * Method to get the id of the album |
|
80 * @return The ID value |
|
81 */ |
|
82 QString id( ) const; |
|
83 |
|
84 /** |
|
85 * Method to set the album name |
|
86 * @param aName The album name |
|
87 */ |
|
88 void setName( const QString &aName ); |
|
89 |
|
90 /** |
|
91 * Method to set the album's image |
|
92 * @param aImage The album's image |
|
93 */ |
|
94 void setImage( const QImage &aImage ); |
|
95 |
|
96 /** |
|
97 * Method to set the artist names |
|
98 * @param aArtists The list of artists in the album |
|
99 */ |
|
100 void setArtists( const SmfArtists &aArtists ); |
|
101 |
|
102 /** |
|
103 * Method to set the id of the album |
|
104 * @param aId The ID value |
|
105 */ |
|
106 void setId( const QString &aId ); |
|
107 |
|
108 private: |
|
109 QSharedDataPointer<SmfAlbumPrivate> d; |
|
110 |
|
111 friend QDataStream &operator<<( QDataStream &aDataStream, |
|
112 const SmfAlbum &aAlbum ); |
|
113 |
|
114 friend QDataStream &operator>>( QDataStream &aDataStream, |
|
115 SmfAlbum &aAlbum ); |
|
116 |
|
117 }; |
|
118 |
|
119 |
|
120 /** |
|
121 * Method for Externalization. Writes the SmfAlbum object to |
|
122 * the stream and returns a reference to the stream. |
|
123 * @param aDataStream Stream to be written |
|
124 * @param aAlbum The SmfAlbum object to be externalized |
|
125 * @return reference to the written stream |
|
126 */ |
|
127 QDataStream &operator<<( QDataStream &aDataStream, |
|
128 const SmfAlbum &aAlbum ); |
|
129 |
|
130 /** |
|
131 * Method for Internalization. Reads a SmfAlbum object from |
|
132 * the stream and returns a reference to the stream. |
|
133 * @param aDataStream Stream to be read |
|
134 * @param aAlbum The SmfAlbum object to be internalized |
|
135 * @return reference to the stream |
|
136 */ |
|
137 QDataStream &operator>>( QDataStream &aDataStream, |
|
138 SmfAlbum &aAlbum); |
|
139 |
|
140 // Make the class SmfAlbum known to QMetaType, so that as to register it. |
|
141 Q_DECLARE_METATYPE(SmfAlbum) |
|
142 |
|
143 #endif /* SMFALBUM_H_ */ |
|