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