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