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