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 track info class represents information about a music track |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef SMFTRACKINFO_H_ |
|
21 #define SMFTRACKINFO_H_ |
|
22 |
|
23 #include <QTime> |
|
24 #include <qdatastream.h> |
|
25 #include <smfmusicrating.h> |
|
26 #include <smfartists.h> |
|
27 #include <smfalbum.h> |
|
28 #include <QStringList> |
|
29 #include <QSharedData> |
|
30 #include <smfclientglobal.h> |
|
31 |
|
32 class SmfTrackInfoPrivate; |
|
33 |
|
34 /** |
|
35 * @ingroup smf_common_group |
|
36 * The track info class represents information about a music track |
|
37 */ |
|
38 class SMFCLIENT_EXPORT SmfTrackInfo : public QObject |
|
39 { |
|
40 Q_OBJECT |
|
41 public: |
|
42 /** |
|
43 * Constructor with default argument |
|
44 * @param aParent The parent object |
|
45 * (parent should be of type SmfMusicServicePlugin) |
|
46 */ |
|
47 SmfTrackInfo(QObject *aParent = 0 ); |
|
48 |
|
49 /** |
|
50 * Copy Constructor |
|
51 * @param aOther The reference object |
|
52 */ |
|
53 SmfTrackInfo( const SmfTrackInfo &aOther ); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 */ |
|
58 ~SmfTrackInfo( ); |
|
59 |
|
60 /** |
|
61 * Method to get the id of the track |
|
62 * @return The ID value |
|
63 */ |
|
64 QString id( ) const; |
|
65 |
|
66 /** |
|
67 * Method to get the track title |
|
68 * @return The title of the track |
|
69 */ |
|
70 QString title( ) const; |
|
71 |
|
72 /** |
|
73 * Method to get the track album |
|
74 * @return The album of the track |
|
75 */ |
|
76 SmfAlbum album( ) const; |
|
77 |
|
78 /** |
|
79 * Method to get the track's artists |
|
80 * @return The artists of the track |
|
81 */ |
|
82 SmfArtists artists( ) const; |
|
83 |
|
84 /** |
|
85 * Method to get the genre of the track |
|
86 * @return The genre of the track |
|
87 */ |
|
88 QString genre( ) const; |
|
89 |
|
90 /** |
|
91 * Method to get the track's tag |
|
92 * @return The tag of the track |
|
93 */ |
|
94 QStringList tags( ) const; |
|
95 |
|
96 /** |
|
97 * Method to get the release year of the track |
|
98 * @return The release year of the track |
|
99 */ |
|
100 QDateTime year( ) const; |
|
101 |
|
102 /** |
|
103 * Method to get the track's rating |
|
104 * @return The rating of the track |
|
105 */ |
|
106 SmfMusicRating rating( ) const; |
|
107 |
|
108 /** |
|
109 * Method to get the comments on the track |
|
110 * @return The comments on the track |
|
111 */ |
|
112 QStringList comments( ) const; |
|
113 |
|
114 /** |
|
115 * Method to get the track's duration |
|
116 * @return The duration of the track |
|
117 */ |
|
118 QTime duration( ) const; |
|
119 |
|
120 /** |
|
121 * Method to set the track title |
|
122 * @param aTitle The new title of the track |
|
123 */ |
|
124 void setTitle( const QString &aTitle ); |
|
125 |
|
126 /** |
|
127 * Method to set the track album |
|
128 * @param aAlbum The new album of the track |
|
129 */ |
|
130 void setAlbum( const SmfAlbum &aAlbum ); |
|
131 |
|
132 /** |
|
133 * Method to set the track's artists |
|
134 * @param aArtists The new artists of the track |
|
135 */ |
|
136 void setArtists( const SmfArtists &aArtists ); |
|
137 |
|
138 /** |
|
139 * Method to set the genre of the track |
|
140 * @param aGenre The new genre of the track |
|
141 */ |
|
142 void setGenre( const QString &aGenre ); |
|
143 |
|
144 /** |
|
145 * Method to set the track's tag |
|
146 * @param aTag The tag of the track |
|
147 */ |
|
148 void setTags( const QStringList &aTag ); |
|
149 |
|
150 /** |
|
151 * Method to set the release year of the track |
|
152 * @param aYear The new release year of the track |
|
153 */ |
|
154 void setYear( const QDateTime &aYear ); |
|
155 |
|
156 /** |
|
157 * Method to set the track's rating |
|
158 * @param aRating The new rating of the track |
|
159 */ |
|
160 void setRating( const SmfMusicRating &aRating ); |
|
161 |
|
162 /** |
|
163 * Method to set the comments on the track |
|
164 * @param aComment The new comment of the track |
|
165 */ |
|
166 void setComment( const QString &aComment ); |
|
167 |
|
168 /** |
|
169 * Method to set the duration of the track |
|
170 * @param aDuration The new duration of the track |
|
171 */ |
|
172 void setDuration( const QTime &aDuration ); |
|
173 |
|
174 private: |
|
175 QSharedDataPointer<SmfTrackInfoPrivate> d; |
|
176 |
|
177 friend QDataStream &operator<<( QDataStream &aDataStream, |
|
178 const SmfTrackInfo &aTrackInfo ); |
|
179 |
|
180 friend QDataStream &operator>>( QDataStream &aDataStream, |
|
181 SmfTrackInfo &aTrackInfo ); |
|
182 |
|
183 }; |
|
184 |
|
185 |
|
186 /** |
|
187 * Method for Externalization. Writes the SmfTrackInfo object to |
|
188 * the stream and returns a reference to the stream. |
|
189 * @param aDataStream Stream to be written |
|
190 * @param aTrackInfo The SmfTrackInfo object to be externalized |
|
191 * @return reference to the written stream |
|
192 */ |
|
193 QDataStream &operator<<( QDataStream &aDataStream, |
|
194 const SmfTrackInfo &aTrackInfo ); |
|
195 |
|
196 /** |
|
197 * Method for Internalization. Reads a SmfTrackInfo object from |
|
198 * the stream and returns a reference to the stream. |
|
199 * @param aDataStream Stream to be read |
|
200 * @param aTrackInfo The SmfTrackInfo object to be internalized |
|
201 * @return reference to the stream |
|
202 */ |
|
203 QDataStream &operator>>( QDataStream &aDataStream, |
|
204 SmfTrackInfo &aTrackInfo); |
|
205 |
|
206 #endif /* SMFTRACKINFO_H_ */ |
|