|
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 music profile class represents a user's profile in music site |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef SMFMUSICPROFILE_H_ |
|
21 #define SMFMUSICPROFILE_H_ |
|
22 |
|
23 #include <smftrackinfo.h> |
|
24 #include <smfevent.h> |
|
25 #include <qdatastream.h> |
|
26 #include <QSharedData> |
|
27 #include <smfclientglobal.h> |
|
28 |
|
29 class SmfMusicProfilePrivate; |
|
30 |
|
31 /** |
|
32 * @ingroup smf_common_group |
|
33 * The music profile class represents a user's profile in music site |
|
34 */ |
|
35 class SMFCLIENT_EXPORT SmfMusicProfile : public QObject |
|
36 { |
|
37 Q_OBJECT |
|
38 public: |
|
39 /** |
|
40 * Constructor with default argument |
|
41 * @param aParent The parent object |
|
42 */ |
|
43 SmfMusicProfile( QObject *aParent = 0 ); |
|
44 |
|
45 /** |
|
46 * Copy Constructor |
|
47 * @param aOther The reference object |
|
48 */ |
|
49 SmfMusicProfile( const SmfMusicProfile &aOther ); |
|
50 |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 ~SmfMusicProfile( ); |
|
55 |
|
56 /** |
|
57 * Method to get the user's used tracks |
|
58 * @return The users track list |
|
59 */ |
|
60 QList<SmfTrackInfo> musicUsageInfo( ) const; |
|
61 |
|
62 /** |
|
63 * Method to get the user's interested tracks |
|
64 * @return The users interested track list |
|
65 */ |
|
66 QList<SmfTrackInfo> interestInfo( ) const; |
|
67 |
|
68 /** |
|
69 * Method to get the user events as list of SmfEvents |
|
70 * @return The list of events |
|
71 */ |
|
72 QList<SmfEvent> userEvents( ) const; |
|
73 |
|
74 /** |
|
75 * Method to get the id of the music profile |
|
76 * @return The ID value |
|
77 */ |
|
78 QString id( ) const; |
|
79 |
|
80 /** |
|
81 * Method to set the user's used tracks |
|
82 * @param aUsage The users new track list |
|
83 */ |
|
84 void setMusicUsageInfo( const QList<SmfTrackInfo>& aUsage ); |
|
85 |
|
86 /** |
|
87 * Method to set the user's interested tracks |
|
88 * @param aInterest The users new interested track list |
|
89 */ |
|
90 void setInterestInfo( const QList<SmfTrackInfo>& aInterest ); |
|
91 |
|
92 private: |
|
93 QSharedDataPointer<SmfMusicProfilePrivate> d; |
|
94 |
|
95 friend QDataStream &operator<<( QDataStream &aDataStream, |
|
96 const SmfMusicProfile &aProfile ); |
|
97 |
|
98 friend QDataStream &operator>>( QDataStream &aDataStream, |
|
99 SmfMusicProfile &aProfile ); |
|
100 |
|
101 }; |
|
102 |
|
103 |
|
104 /** |
|
105 * Method for Externalization. Writes the SmfMusicProfile object to |
|
106 * the stream and returns a reference to the stream. |
|
107 * @param aDataStream Stream to be written |
|
108 * @param aProfile The SmfMusicProfile object to be externalized |
|
109 * @return reference to the written stream |
|
110 */ |
|
111 QDataStream &operator<<( QDataStream &aDataStream, |
|
112 const SmfMusicProfile &aProfile ); |
|
113 |
|
114 /** |
|
115 * Method for Internalization. Reads a SmfMusicProfile object from |
|
116 * the stream and returns a reference to the stream. |
|
117 * @param aDataStream Stream to be read |
|
118 * @param aProfile The SmfMusicProfile object to be internalized |
|
119 * @return reference to the stream |
|
120 */ |
|
121 QDataStream &operator>>( QDataStream &aDataStream, |
|
122 SmfMusicProfile &aProfile); |
|
123 |
|
124 // Make the class SmfMusicProfile known to QMetaType, so that as to register it. |
|
125 Q_DECLARE_METATYPE(SmfMusicProfile) |
|
126 |
|
127 #endif /* SMFMUSICPROFILE_H_ */ |