smf/smfservermodule/smfclient/common/smftrackinfo.h
changeset 10 1d94eb8df9c2
parent 9 b85b0c039c14
equal deleted inserted replaced
9:b85b0c039c14 10:1d94eb8df9c2
     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 track info class represents information about a music track
       
    17  *
       
    18  */
       
    19 
       
    20 #ifndef SMFTRACKINFO_H_
       
    21 #define SMFTRACKINFO_H_
       
    22 
       
    23 #include <QTime>
       
    24 #include <qdatastream.h>
       
    25 #include <smfmusicrating.h>
       
    26 #include <smfartists.h>
       
    27 #include "smfalbum.h"
       
    28 #include <smfcomment.h>
       
    29 #include <QStringList>
       
    30 #include <QSharedData>
       
    31 #include <smfclientglobal.h>
       
    32 #include <QMetaType>
       
    33 
       
    34 class SmfTrackInfoPrivate;
       
    35 
       
    36 /**
       
    37  * @ingroup smf_common_group
       
    38  * The track info class represents information about a music track
       
    39  */
       
    40 class SMFCLIENT_EXPORT SmfTrackInfo
       
    41 	{
       
    42 public:
       
    43 	/**
       
    44 	 * Constructor with default argument
       
    45 	 */
       
    46 	SmfTrackInfo( );
       
    47 	
       
    48 	/**
       
    49 	 * Copy Constructor
       
    50 	 * @param aOther The reference object
       
    51 	 */
       
    52 	SmfTrackInfo( const SmfTrackInfo &aOther );
       
    53 	
       
    54 	/**
       
    55 	 * Overloaded = operator
       
    56 	 * @param aOther The reference object
       
    57 	 */
       
    58 	SmfTrackInfo& operator=( const SmfTrackInfo &aOther );
       
    59 	
       
    60 	/**
       
    61 	 * Destructor
       
    62 	 */
       
    63 	~SmfTrackInfo( );
       
    64 	
       
    65 	/**
       
    66 	 * Method to get the track title
       
    67 	 * @return The title of the track
       
    68 	 */
       
    69 	QString title( ) const;
       
    70 	
       
    71 	/**
       
    72 	 * Method to get the track album
       
    73 	 * @return The album of the track
       
    74 	 */
       
    75 	SmfAlbum album( ) const;
       
    76 	
       
    77 	/**
       
    78 	 * Method to get the track's artists
       
    79 	 * @return The artists of the track
       
    80 	 */
       
    81 	SmfArtists artists( ) const;
       
    82 	
       
    83 	/**
       
    84 	 * Method to get the genre of the track
       
    85 	 * @return The genre of the track
       
    86 	 */
       
    87 	QString genre( ) const;
       
    88 	
       
    89 	/**
       
    90 	 * Method to get the track's tag
       
    91 	 * @return The tag of the track
       
    92 	 */
       
    93 	QStringList tags( ) const;
       
    94 	
       
    95 	/**
       
    96 	 * Method to get the release year of the track
       
    97 	 * @return The release year of the track
       
    98 	 */
       
    99 	QDateTime year( ) const;
       
   100 	
       
   101 	/**
       
   102 	 * Method to get the track's rating
       
   103 	 * @return The rating of the track
       
   104 	 */
       
   105 	SmfMusicRating rating( ) const;
       
   106 	
       
   107 	/**
       
   108 	 * Method to get the comments on the track
       
   109 	 * @return The comments on the track
       
   110 	 */
       
   111 	QList<SmfComment> comments( ) const;
       
   112 	
       
   113 	/**
       
   114 	 * Method to get the track's duration
       
   115 	 * @return The duration of the track
       
   116 	 */
       
   117 	QTime duration( ) const;
       
   118 	
       
   119 	/**
       
   120 	 * Method to get the id of the track
       
   121 	 * @return The ID value 
       
   122 	 */
       
   123 	QString id( ) const;
       
   124 	
       
   125 	/**
       
   126 	 * Method to set the track title
       
   127 	 * @param aTitle The new title of the track
       
   128 	 */
       
   129 	void setTitle( const QString &aTitle );
       
   130 	
       
   131 	/**
       
   132 	 * Method to set the track album
       
   133 	 * @param aAlbum The new album of the track
       
   134 	 */
       
   135 	void setAlbum( const SmfAlbum &aAlbum );
       
   136 	
       
   137 	/**
       
   138 	 * Method to set the track's artists
       
   139 	 * @param aArtists The new artists of the track
       
   140 	 */
       
   141 	void setArtists( const SmfArtists &aArtists );
       
   142 	
       
   143 	/**
       
   144 	 * Method to set the genre of the track
       
   145 	 * @param aGenre The new genre of the track
       
   146 	 */
       
   147 	void setGenre( const QString &aGenre );
       
   148 	
       
   149 	/**
       
   150 	 * Method to set the track's tag
       
   151 	 * @param aTag The tag of the track
       
   152 	 */
       
   153 	void setTags( const QStringList &aTags );
       
   154 	
       
   155 	/**
       
   156 	 * Method to set the release year of the track
       
   157 	 * @param aYear The new release year of the track
       
   158 	 */
       
   159 	void setYear( const QDateTime &aYear );
       
   160 	
       
   161 	/**
       
   162 	 * Method to set the track's rating
       
   163 	 * @param aRating The new rating of the track
       
   164 	 */
       
   165 	void setRating( const SmfMusicRating &aRating );
       
   166 	
       
   167 	/**
       
   168 	 * Method to set the comments on the track
       
   169 	 * @param aComment The new comment of the track
       
   170 	 */
       
   171 	void setComment( const QList<SmfComment> &aComments );
       
   172 	
       
   173 	/**
       
   174 	 * Method to set the duration of the track
       
   175 	 * @param aDuration The new duration of the track
       
   176 	 */
       
   177 	void setDuration( const QTime &aDuration );
       
   178 	
       
   179 	/**
       
   180 	 * Method to set the id of the track
       
   181 	 * @param aId The ID value 
       
   182 	 */
       
   183 	void setId( const QString &aId );
       
   184 
       
   185 private:
       
   186 	QSharedDataPointer<SmfTrackInfoPrivate> d;
       
   187 	
       
   188 	friend QDataStream &operator<<( QDataStream &aDataStream, 
       
   189 			const SmfTrackInfo &aTrackInfo );
       
   190 
       
   191 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
   192 			SmfTrackInfo &aTrackInfo );
       
   193 	
       
   194 	};
       
   195 
       
   196 
       
   197 /**
       
   198  * Method for Externalization. Writes the SmfTrackInfo object to 
       
   199  * the stream and returns a reference to the stream.
       
   200  * @param aDataStream Stream to be written
       
   201  * @param aTrackInfo The SmfTrackInfo object to be externalized
       
   202  * @return reference to the written stream
       
   203  */
       
   204 SMFCLIENT_EXPORT QDataStream &operator<<( QDataStream &aDataStream, 
       
   205 		const SmfTrackInfo &aTrackInfo );
       
   206 
       
   207 /**
       
   208  * Method for Internalization. Reads a SmfTrackInfo object from 
       
   209  * the stream and returns a reference to the stream.
       
   210  * @param aDataStream Stream to be read
       
   211  * @param aTrackInfo The SmfTrackInfo object to be internalized
       
   212  * @return reference to the stream
       
   213  */
       
   214 SMFCLIENT_EXPORT QDataStream &operator>>( QDataStream &aDataStream, 
       
   215 		SmfTrackInfo &aTrackInfo);
       
   216 
       
   217 
       
   218 typedef QList<SmfTrackInfo> SmfTrackInfoList;
       
   219 
       
   220 // Make the class SmfTrackInfo known to QMetaType, so that as to register it.
       
   221 Q_DECLARE_METATYPE(SmfTrackInfo)
       
   222 Q_DECLARE_METATYPE(QList<SmfTrackInfo>)
       
   223 
       
   224 #endif /* SMFTRACKINFO_H_ */