diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfmusicprofile.h --- a/example/clientapi/smf/inc/common/smfmusic/smfmusicprofile.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfmusic/smfmusicprofile.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,86 +1,124 @@ /** - * @file smfmusicprofile.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * Copyright (c) 2010 Sasken Communication Technologies Ltd. * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of the "{License}" - * which accompanies this distribution, and is available - * at the URL "{LicenseUrl}". + * This component and the accompanying materials are made available + * under the terms of the "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html" + * + * Initial Contributors: + * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution + * + * Contributors: + * Manasij Roy, Nalina Hariharan * - * @section DESCRIPTION + * Description: + * The music profile class represents a user's profile in music site * - * The music profile class represents a user's profile in music site */ #ifndef SMFMUSICPROFILE_H_ #define SMFMUSICPROFILE_H_ +#include +#include #include -#include "SmfClientGlobal.h" +#include +#include -#include "smfcontact.h" -class SmfTrackInfo; -class SmfEventsList; -typedef QList SmfTrackInfoList; -/** - * User profile containing music usage and interest info, extends SmfContact. - * Consists of,- - * 1. Conatct info - * 2. Music usage info as SmfTrackInfoList - * 3. Interest info as SmfTrackInfoList - * 4. Events SmfEventsList - */ -class SMFCLIENT_EXPORT SmfMusicProfile : public SmfContact - { - Q_OBJECT +class SmfMusicProfilePrivate; - public: - // Seeing as this is a plug-in implementation, these will realistically - // be generated by SMF factory of some kind - SmfMusicProfile(QObject* parent = 0); - ~SmfMusicProfile(); - - /** - * Gets the music usage info of the user as list of SmfTrackInfo - */ - SmfTrackInfoList* getMusicUsageInfo(); - - /** - * Gets the music interest info of the user as list of SmfTrackInfo - */ - SmfTrackInfoList* getInterestInfo(); - - /** - * Gets the user events as list of SmfEvents - */ - SmfEventsList* getUserEvents(); - - /** - * Sets the music usage info of the user as list of SmfTrackInfo - */ - void setMusicUsageInfo(SmfTrackInfoList* usage); - - /** - * Gets the music interest info of the user as list of SmfTrackInfo - */ - void setInterestInfo(SmfTrackInfoList* interest); +/** + * @ingroup smf_common_group + * The music profile class represents a user's profile in music site + */ +class SMFCLIENT_EXPORT SmfMusicProfile : public QObject + { + Q_OBJECT +public: + /** + * Constructor with default argument + * @param aParent The parent object + */ + SmfMusicProfile( QObject *aParent = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfMusicProfile( const SmfMusicProfile &aOther ); + + /** + * Destructor + */ + ~SmfMusicProfile( ); + + /** + * Method to get the user's used tracks + * @return The users track list + */ + QList musicUsageInfo( ) const; + + /** + * Method to get the user's interested tracks + * @return The users interested track list + */ + QList interestInfo( ) const; + + /** + * Method to get the user events as list of SmfEvents + * @return The list of events + */ + QList userEvents( ) const; + + /** + * Method to get the id of the music profile + * @return The ID value + */ + QString id( ) const; + + /** + * Method to set the user's used tracks + * @param aUsage The users new track list + */ + void setMusicUsageInfo( const QList& aUsage ); + + /** + * Method to set the user's interested tracks + * @param aInterest The users new interested track list + */ + void setInterestInfo( const QList& aInterest ); - private: - SmfTrackInfoList* usage; - SmfTrackInfoList* interest; - +private: + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfMusicProfile &aProfile ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfMusicProfile &aProfile ); + }; + + /** -* Externalization -*/ -QDataStream &operator<<(QDataStream &, const SmfMusicProfile&); + * Method for Externalization. Writes the SmfMusicProfile object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aProfile The SmfMusicProfile object to be externalized + * @return reference to the written stream + */ +QDataStream &operator<<( QDataStream &aDataStream, + const SmfMusicProfile &aProfile ); + /** - * Internalization + * Method for Internalization. Reads a SmfMusicProfile object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aProfile The SmfMusicProfile object to be internalized + * @return reference to the stream */ -QDataStream &operator>>(QDataStream &, SmfMusicProfile&); +QDataStream &operator>>( QDataStream &aDataStream, + SmfMusicProfile &aProfile); + #endif /* SMFMUSICPROFILE_H_ */