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