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