example/clientapi/smf/inc/common/smfmusic/smftrackinfo.h
changeset 2 86af6c333601
parent 1 4b1e636e8a71
equal deleted inserted replaced
1:4b1e636e8a71 2:86af6c333601
     1 /**
     1 /**
     2  * @file	smftrackinfo.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 track info class represents information about a music track
    16  *
    17  *
    17  * The track info class represents information about a music track
       
    18  */
    18  */
    19 
    19 
    20 #ifndef SMFTRACKINFO_H_
    20 #ifndef SMFTRACKINFO_H_
    21 #define SMFTRACKINFO_H_
    21 #define SMFTRACKINFO_H_
    22 
    22 
    23 #include <QTime>
    23 #include <QTime>
    24 #include <qdatastream.h>
    24 #include <qdatastream.h>
    25 #include <smfmusicrating.h>
    25 #include <smfmusicrating.h>
    26 #include "SmfClientGlobal.h"
    26 #include <smfartists.h>
    27 /**
    27 #include <smfalbum.h>
    28  * Music track info as track id,title, album, artist, genre,
    28 #include <QStringList>
    29  * tag, director,release year, rating, comment info 
    29 #include <QSharedData>
       
    30 #include <smfclientglobal.h>
       
    31 
       
    32 class SmfTrackInfoPrivate;
       
    33 
       
    34 /**
       
    35  * @ingroup smf_common_group
       
    36  * The track info class represents information about a music track
    30  */
    37  */
    31 class SMFCLIENT_EXPORT SmfTrackInfo : public QObject
    38 class SMFCLIENT_EXPORT SmfTrackInfo : public QObject
    32 	{
    39 	{
    33 	Q_OBJECT
    40 	Q_OBJECT
    34 public:
    41 public:
    35 	 /**
    42 	/**
    36 	  * Constructs track info 
    43 	 * Constructor with default argument
    37 	  */
    44 	 * @param aParent The parent object
    38 	SmfTrackInfo(QObject* parent=0);
    45 	 * (parent should be of type SmfMusicServicePlugin)
    39 	/**
    46 	 */
    40 	 * Gets track id
    47 	SmfTrackInfo(QObject *aParent = 0 );
    41 	 */
    48 	
    42 	void getId(QString& id);
    49 	/**
    43 	
    50 	 * Copy Constructor
    44 	/**
    51 	 * @param aOther The reference object
    45 	 * Gets title of the track
    52 	 */
    46 	 */
    53 	SmfTrackInfo( const SmfTrackInfo &aOther );
    47 	void getTitle(QString& title);
    54 	
    48 	
    55 	/**
    49 	/**
    56 	 * Destructor
    50 	 * Gets album name
    57 	 */
    51 	 */
    58 	~SmfTrackInfo( );
    52 	void getAlbum(QString& album);
    59 	
    53 	
    60 	/**
    54 	/**
    61 	 * Method to get the id of the track
    55 	 * Gets track artist
    62 	 * @return The ID value 
    56 	 */
    63 	 */
    57 	void getArtist(QString& artist);
    64 	QString id( ) const;
    58 	
    65 	
    59 	/**
    66 	/**
    60 	 * Gets track genre
    67 	 * Method to get the track title
    61 	 */
    68 	 * @return The title of the track
    62 	void getGenre(QString& genre);
    69 	 */
    63 	
    70 	QString title( ) const;
    64 	/**
    71 	
    65 	 * Gets track tag
    72 	/**
    66 	 */
    73 	 * Method to get the track album
    67 	void getTag(QString& tag);
    74 	 * @return The album of the track
    68 	
    75 	 */
    69 	/**
    76 	SmfAlbum album( ) const;
    70 	 * Gets director name
    77 	
    71 	 */
    78 	/**
    72 	void getDirector(QString& director);
    79 	 * Method to get the track's artists
    73 	
    80 	 * @return The artists of the track
    74 	/**
    81 	 */
    75 	 * Gets release year
    82 	SmfArtists artists( ) const;
    76 	 */
    83 	
    77 	void getYear(QString& year);
    84 	/**
    78 	
    85 	 * Method to get the genre of the track
    79 	/**
    86 	 * @return The genre of the track
    80 	 * Gets track rating 
    87 	 */
    81 	 */
    88 	QString genre( ) const;
    82 	void getRating(SmfMusicRating& rating);
    89 	
    83 	
    90 	/**
    84 	/**
    91 	 * Method to get the track's tag
    85 	 * Gets comments
    92 	 * @return The tag of the track
    86 	 */
    93 	 */
    87 	void getComment(QStringList& comment);
    94 	QStringList tags( ) const;
    88 	
    95 	
    89 	
    96 	/**
    90 	/**
    97 	 * Method to get the release year of the track
    91 	 * Sets id
    98 	 * @return The release year of the track
    92 	 */
    99 	 */
    93 	void setId(QString& id);
   100 	QDateTime year( ) const;
    94 	
   101 	
    95 	/**
   102 	/**
    96 	 * Sets title
   103 	 * Method to get the track's rating
    97 	 */
   104 	 * @return The rating of the track
    98 	void setTitle(QString& title);
   105 	 */
    99 	
   106 	SmfMusicRating rating( ) const;
   100 	/**
   107 	
   101 	 * Sets album name
   108 	/**
   102 	 */
   109 	 * Method to get the comments on the track
   103 	void setAlbum(QString& album);
   110 	 * @return The comments on the track
   104 	
   111 	 */
   105 	/**
   112 	QStringList comments( ) const;
   106 	 * Sets artist name
   113 	
   107 	 */
   114 	/**
   108 	void setArtist(QString& artist);
   115 	 * Method to get the track's duration
   109 	
   116 	 * @return The duration of the track
   110 	/**
   117 	 */
   111 	 * Sets genre
   118 	QTime duration( ) const;
   112 	 */
   119 	
   113 	void setGenre(QString& genre);
   120 	/**
   114 	
   121 	 * Method to set the track title
   115 	/**
   122 	 * @param aTitle The new title of the track
   116 	 * Sets tag
   123 	 */
   117 	 */
   124 	void setTitle( const QString &aTitle );
   118 	void setTag(QString& tag);
   125 	
   119 	
   126 	/**
   120 	/**
   127 	 * Method to set the track album
   121 	 * Sets director name
   128 	 * @param aAlbum The new album of the track
   122 	 */
   129 	 */
   123 	void setDirector(QString& director);
   130 	void setAlbum( const SmfAlbum &aAlbum );
   124 	
   131 	
   125 	/**
   132 	/**
   126 	 * Sets release year
   133 	 * Method to set the track's artists
   127 	 */
   134 	 * @param aArtists The new artists of the track
   128 	void setYear(QString& year);
   135 	 */
   129 	
   136 	void setArtists( const SmfArtists &aArtists );
   130 	/**
   137 	
   131 	 * Sets rating
   138 	/**
   132 	 */
   139 	 * Method to set the genre of the track
   133 	void setRating(SmfMusicRating& rating);
   140 	 * @param aGenre The new genre of the track
   134 	
   141 	 */
   135 	/**
   142 	void setGenre( const QString &aGenre );
   136 	 * Sets comment
   143 	
   137 	 */
   144 	/**
   138 	void setComment(QStringList& comment);
   145 	 * Method to set the track's tag
       
   146 	 * @param aTag The tag of the track
       
   147 	 */
       
   148 	void setTags( const QStringList &aTag );
       
   149 	
       
   150 	/**
       
   151 	 * Method to set the release year of the track
       
   152 	 * @param aYear The new release year of the track
       
   153 	 */
       
   154 	void setYear( const QDateTime &aYear );
       
   155 	
       
   156 	/**
       
   157 	 * Method to set the track's rating
       
   158 	 * @param aRating The new rating of the track
       
   159 	 */
       
   160 	void setRating( const SmfMusicRating &aRating );
       
   161 	
       
   162 	/**
       
   163 	 * Method to set the comments on the track
       
   164 	 * @param aComment The new comment of the track
       
   165 	 */
       
   166 	void setComment( const QString &aComment );
       
   167 	
       
   168 	/**
       
   169 	 * Method to set the duration of the track
       
   170 	 * @param aDuration The new duration of the track
       
   171 	 */
       
   172 	void setDuration( const QTime &aDuration );
   139 
   173 
   140 private:
   174 private:
   141 	QString m_id;
   175 	QSharedDataPointer<SmfTrackInfoPrivate> d;
   142 	QString m_title;
   176 	
   143 	QString m_albumTitle;
   177 	friend QDataStream &operator<<( QDataStream &aDataStream, 
   144 	QString m_artistName;
   178 			const SmfTrackInfo &aTrackInfo );
   145 	QString m_genre;
   179 
   146 	QString m_tag;
   180 	friend QDataStream &operator>>( QDataStream &aDataStream, 
   147 	QString m_director;
   181 			SmfTrackInfo &aTrackInfo );
   148 	QString m_year;
   182 	
   149 	SmfMusicRating m_rating;
       
   150 	QString m_comment;
       
   151 	};
   183 	};
   152 /**
   184 
   153 * Externalization
   185 
   154 */
   186 /**
   155 QDataStream &operator<<(QDataStream &, const SmfTrackInfo&);
   187  * Method for Externalization. Writes the SmfTrackInfo object to 
   156 /**
   188  * the stream and returns a reference to the stream.
   157  * Internalization
   189  * @param aDataStream Stream to be written
   158  */
   190  * @param aTrackInfo The SmfTrackInfo object to be externalized
   159 QDataStream &operator>>(QDataStream &, SmfTrackInfo&);
   191  * @return reference to the written stream
       
   192  */
       
   193 QDataStream &operator<<( QDataStream &aDataStream, 
       
   194 		const SmfTrackInfo &aTrackInfo );
       
   195 
       
   196 /**
       
   197  * Method for Internalization. Reads a SmfTrackInfo object from 
       
   198  * the stream and returns a reference to the stream.
       
   199  * @param aDataStream Stream to be read
       
   200  * @param aTrackInfo The SmfTrackInfo object to be internalized
       
   201  * @return reference to the stream
       
   202  */
       
   203 QDataStream &operator>>( QDataStream &aDataStream, 
       
   204 		SmfTrackInfo &aTrackInfo);
       
   205 
   160 #endif /* SMFTRACKINFO_H_ */
   206 #endif /* SMFTRACKINFO_H_ */