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