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