diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smftrackinfo.h --- a/example/clientapi/smf/inc/common/smfmusic/smftrackinfo.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfmusic/smftrackinfo.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,20 +1,20 @@ /** - * @file smftrackinfo.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 track info class represents information about a music track * - * The track info class represents information about a music track */ #ifndef SMFTRACKINFO_H_ @@ -23,138 +23,184 @@ #include #include #include -#include "SmfClientGlobal.h" +#include +#include +#include +#include +#include + +class SmfTrackInfoPrivate; + /** - * Music track info as track id,title, album, artist, genre, - * tag, director,release year, rating, comment info + * @ingroup smf_common_group + * The track info class represents information about a music track */ class SMFCLIENT_EXPORT SmfTrackInfo : public QObject { Q_OBJECT public: - /** - * Constructs track info - */ - SmfTrackInfo(QObject* parent=0); /** - * Gets track id + * Constructor with default argument + * @param aParent The parent object + * (parent should be of type SmfMusicServicePlugin) */ - void getId(QString& id); + SmfTrackInfo(QObject *aParent = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfTrackInfo( const SmfTrackInfo &aOther ); /** - * Gets title of the track + * Destructor */ - void getTitle(QString& title); + ~SmfTrackInfo( ); + + /** + * Method to get the id of the track + * @return The ID value + */ + QString id( ) const; /** - * Gets album name + * Method to get the track title + * @return The title of the track */ - void getAlbum(QString& album); + QString title( ) const; /** - * Gets track artist + * Method to get the track album + * @return The album of the track */ - void getArtist(QString& artist); - - /** - * Gets track genre - */ - void getGenre(QString& genre); + SmfAlbum album( ) const; /** - * Gets track tag + * Method to get the track's artists + * @return The artists of the track */ - void getTag(QString& tag); + SmfArtists artists( ) const; /** - * Gets director name + * Method to get the genre of the track + * @return The genre of the track */ - void getDirector(QString& director); + QString genre( ) const; /** - * Gets release year + * Method to get the track's tag + * @return The tag of the track */ - void getYear(QString& year); + QStringList tags( ) const; /** - * Gets track rating + * Method to get the release year of the track + * @return The release year of the track */ - void getRating(SmfMusicRating& rating); + QDateTime year( ) const; /** - * Gets comments + * Method to get the track's rating + * @return The rating of the track */ - void getComment(QStringList& comment); - + SmfMusicRating rating( ) const; /** - * Sets id + * Method to get the comments on the track + * @return The comments on the track */ - void setId(QString& id); + QStringList comments( ) const; + + /** + * Method to get the track's duration + * @return The duration of the track + */ + QTime duration( ) const; /** - * Sets title + * Method to set the track title + * @param aTitle The new title of the track */ - void setTitle(QString& title); + void setTitle( const QString &aTitle ); /** - * Sets album name + * Method to set the track album + * @param aAlbum The new album of the track */ - void setAlbum(QString& album); + void setAlbum( const SmfAlbum &aAlbum ); + + /** + * Method to set the track's artists + * @param aArtists The new artists of the track + */ + void setArtists( const SmfArtists &aArtists ); /** - * Sets artist name + * Method to set the genre of the track + * @param aGenre The new genre of the track */ - void setArtist(QString& artist); + void setGenre( const QString &aGenre ); /** - * Sets genre + * Method to set the track's tag + * @param aTag The tag of the track */ - void setGenre(QString& genre); + void setTags( const QStringList &aTag ); /** - * Sets tag + * Method to set the release year of the track + * @param aYear The new release year of the track */ - void setTag(QString& tag); + void setYear( const QDateTime &aYear ); /** - * Sets director name + * Method to set the track's rating + * @param aRating The new rating of the track */ - void setDirector(QString& director); + void setRating( const SmfMusicRating &aRating ); /** - * Sets release year + * Method to set the comments on the track + * @param aComment The new comment of the track */ - void setYear(QString& year); + void setComment( const QString &aComment ); /** - * Sets rating + * Method to set the duration of the track + * @param aDuration The new duration of the track */ - void setRating(SmfMusicRating& rating); - - /** - * Sets comment - */ - void setComment(QStringList& comment); + void setDuration( const QTime &aDuration ); private: - QString m_id; - QString m_title; - QString m_albumTitle; - QString m_artistName; - QString m_genre; - QString m_tag; - QString m_director; - QString m_year; - SmfMusicRating m_rating; - QString m_comment; + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfTrackInfo &aTrackInfo ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfTrackInfo &aTrackInfo ); + }; -/** -* Externalization -*/ -QDataStream &operator<<(QDataStream &, const SmfTrackInfo&); + + /** - * Internalization + * Method for Externalization. Writes the SmfTrackInfo object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aTrackInfo The SmfTrackInfo object to be externalized + * @return reference to the written stream */ -QDataStream &operator>>(QDataStream &, SmfTrackInfo&); +QDataStream &operator<<( QDataStream &aDataStream, + const SmfTrackInfo &aTrackInfo ); + +/** + * Method for Internalization. Reads a SmfTrackInfo object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aTrackInfo The SmfTrackInfo object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfTrackInfo &aTrackInfo); + #endif /* SMFTRACKINFO_H_ */