example/clientapi/smf/inc/common/smfmusic/smfmusicprofile.h
changeset 2 86af6c333601
parent 1 4b1e636e8a71
equal deleted inserted replaced
1:4b1e636e8a71 2:86af6c333601
     1 /**
     1 /**
     2  * @file	smfmusicprofile.h
     2  * Copyright (c) 2010 Sasken Communication Technologies Ltd.
     3  * @author  Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution
     3  * All rights reserved.
     4  * @version 1.0
     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"
     5  *
     8  *
     6  * @section LICENSE
     9  * Initial Contributors:
       
    10  * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
     7  *
    11  *
     8  * Copyright (c) 2010 Sasken Communication Technologies Ltd. 
    12  * Contributors:
     9  * All rights reserved.
    13  * Manasij Roy, Nalina Hariharan
    10  * This component and the accompanying materials are made available 
       
    11  * under the terms of the "{License}" 
       
    12  * which accompanies  this distribution, and is available 
       
    13  * at the URL "{LicenseUrl}".
       
    14  * 
    14  * 
    15  * @section DESCRIPTION
    15  * Description:
       
    16  * The music profile class represents a user's profile in music site
    16  *
    17  *
    17  * The music profile class represents a user's profile in music site
       
    18  */
    18  */
    19 
    19 
    20 #ifndef SMFMUSICPROFILE_H_
    20 #ifndef SMFMUSICPROFILE_H_
    21 #define SMFMUSICPROFILE_H_
    21 #define SMFMUSICPROFILE_H_
    22 
    22 
       
    23 #include <smftrackinfo.h>
       
    24 #include <smfevent.h>
    23 #include <qdatastream.h>
    25 #include <qdatastream.h>
    24 #include "SmfClientGlobal.h"
    26 #include <QSharedData>
       
    27 #include <smfclientglobal.h>
    25 
    28 
    26 #include "smfcontact.h"
    29 class SmfMusicProfilePrivate;
    27 class SmfTrackInfo;
    30 
    28 class SmfEventsList;
       
    29 typedef QList<SmfTrackInfo> SmfTrackInfoList; 
       
    30 /**
    31 /**
    31  * User profile containing music usage and interest info, extends SmfContact.
    32  * @ingroup smf_common_group
    32  * Consists of,-
    33  * The music profile class represents a user's profile in music site
    33  * 1. Conatct info
       
    34  * 2. Music usage info as SmfTrackInfoList
       
    35  * 3. Interest info as SmfTrackInfoList
       
    36  * 4. Events SmfEventsList
       
    37  */
    34  */
    38 class SMFCLIENT_EXPORT SmfMusicProfile : public SmfContact
    35 class SMFCLIENT_EXPORT SmfMusicProfile : public QObject
    39 	{
    36 	{
    40 	  Q_OBJECT
    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 );
    41 
    91 
    42 	public:
    92 private:
    43 	  // Seeing as this is a plug-in implementation, these will realistically
    93 	QSharedDataPointer<SmfMusicProfilePrivate> d;
    44 	  // be generated by SMF factory of some kind
       
    45 	  SmfMusicProfile(QObject* parent = 0);
       
    46 	  ~SmfMusicProfile();
       
    47 	  
       
    48 	  /**
       
    49 	   * Gets the music usage info of the user as list of SmfTrackInfo
       
    50 	   */
       
    51 	  SmfTrackInfoList* getMusicUsageInfo();
       
    52 	  
       
    53 	  /**
       
    54 	   * Gets the music interest info of the user as list of SmfTrackInfo
       
    55 	   */
       
    56 	  SmfTrackInfoList* getInterestInfo();
       
    57 	  
       
    58 	  /**
       
    59 	   * Gets the user events as list of SmfEvents
       
    60 	   */
       
    61 	  SmfEventsList* getUserEvents();
       
    62 	  
       
    63 	  /**
       
    64 	   * Sets the music usage info of the user as list of SmfTrackInfo
       
    65 	   */
       
    66 	  void setMusicUsageInfo(SmfTrackInfoList* usage);
       
    67 	  
       
    68 	  /**
       
    69 	   * Gets the music interest info of the user as list of SmfTrackInfo
       
    70 	   */
       
    71 	  void setInterestInfo(SmfTrackInfoList* interest);
       
    72 
    94 
    73 	private:
    95 	friend QDataStream &operator<<( QDataStream &aDataStream, 
    74 	  SmfTrackInfoList* usage;
    96 			const SmfMusicProfile &aProfile );
    75 	  SmfTrackInfoList* interest;
    97 
    76 	  
    98 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
    99 			SmfMusicProfile &aProfile );
       
   100 	
    77 	};
   101 	};
       
   102 
       
   103 
    78 /**
   104 /**
    79 * Externalization
   105  * Method for Externalization. Writes the SmfMusicProfile object to 
    80 */
   106  * the stream and returns a reference to the stream.
    81 QDataStream &operator<<(QDataStream &, const SmfMusicProfile&);
   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 
    82 /**
   114 /**
    83  * Internalization
   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
    84  */
   120  */
    85 QDataStream &operator>>(QDataStream &, SmfMusicProfile&);
   121 QDataStream &operator>>( QDataStream &aDataStream, 
       
   122 		SmfMusicProfile &aProfile);
       
   123 
    86 #endif /* SMFMUSICPROFILE_H_ */
   124 #endif /* SMFMUSICPROFILE_H_ */