smf/smfservermodule/smfclient/common/smfplaylist.h
changeset 14 a469c0e6e7fb
parent 7 be09cf1f39dd
equal deleted inserted replaced
13:b5d63d5fc252 14:a469c0e6e7fb
    11  *
    11  *
    12  * Contributors:
    12  * Contributors:
    13  * Manasij Roy, Nalina Hariharan
    13  * Manasij Roy, Nalina Hariharan
    14  * 
    14  * 
    15  * Description:
    15  * Description:
    16  * The playlist class represents an instance of a playlist
    16  * The playlist class represents an instance of a playlist.
       
    17  * SmfPlaylist class is in accordance with the XML Shareable Playlist Format (XSPF)
       
    18  * as mentioned in http://xspf.org/xspf-v1.html
    17  *
    19  *
    18  */
    20  */
    19 
    21 
    20 #ifndef SMFPLAYLIST_H_
    22 #ifndef SMFPLAYLIST_H_
    21 #define SMFPLAYLIST_H_
    23 #define SMFPLAYLIST_H_
    22 
    24 
    23 #include <smftrackinfo.h>
       
    24 #include <qdatastream.h>
    25 #include <qdatastream.h>
    25 #include <QSharedData>
    26 #include <QSharedData>
    26 #include <smfclientglobal.h>
       
    27 #include <QMetaType>
    27 #include <QMetaType>
       
    28 #include <QVariant>
       
    29 
       
    30 #include "smfclientglobal.h"
       
    31 #include "smftrackinfo.h"
       
    32 #include "smfcomment.h"
    28 
    33 
    29 class SmfPlaylistPrivate;
    34 class SmfPlaylistPrivate;
    30 
    35 
    31 /**
    36 /**
    32  * @ingroup smf_common_group
    37  * @ingroup smf_common_group
    33  * The playlist class represents an instance of a playlist
    38  * The playlist class represents an instance of a playlist.
       
    39  * SmfPlaylist class is in accordance with the XML Shareable Playlist Format (XSPF)
       
    40  * as mentioned in http://xspf.org/xspf-v1.html
    34  */
    41  */
    35 class SMFCLIENT_EXPORT SmfPlaylist
    42 class SMFCLIENT_EXPORT SmfPlaylist
    36 	{
    43 	{
    37 public:
    44 public:
    38 	/**
    45 	/**
    56 	 * Destructor
    63 	 * Destructor
    57 	 */
    64 	 */
    58 	~SmfPlaylist( );
    65 	~SmfPlaylist( );
    59 	
    66 	
    60 	/**
    67 	/**
       
    68 	 * Method to get the version of the playlist
       
    69 	 * @return The version of the playlist
       
    70 	 */
       
    71 	QString version( ) const;
       
    72 	
       
    73 	/**
       
    74 	 * Method to get the playlist title
       
    75 	 * @return The title of the playlist
       
    76 	 */
       
    77 	QString playListTitle( ) const;
       
    78 	
       
    79 	/**
       
    80 	 * Method to get the author of the playlist
       
    81 	 * @return The author of the playlist
       
    82 	 */
       
    83 	QString author( ) const;
       
    84 	
       
    85 	/**
       
    86 	 * Method to get the comments on the playlist
       
    87 	 * @return The comments on the playlist
       
    88 	 */
       
    89 	QList<SmfComment> comments( ) const;
       
    90 	
       
    91 	/**
       
    92 	 * Method to get the URI of a web page to find out more about this playlist
       
    93 	 * @return The info Url
       
    94 	 */
       
    95 	QUrl info( ) const;
       
    96 	
       
    97 	/**
       
    98 	 * Method to get the Source URI for this playlist
       
    99 	 * @return The Source URI for this playlist
       
   100 	 */
       
   101 	QUrl location( ) const;
       
   102 	
       
   103 	/**
       
   104 	 * Method to get the id of the playlist
       
   105 	 * @return The ID value 
       
   106 	 */
       
   107 	QString id( ) const;
       
   108 	
       
   109 	/**
       
   110 	 * Method to get the URI of an image to display in the absence 
       
   111 	 * of an image for playlist's tracks
       
   112 	 * @return The deafult image Url
       
   113 	 */
       
   114 	QUrl image( ) const;
       
   115 	
       
   116 	/**
       
   117 	 * Method to get the creation date of the playlist
       
   118 	 * @return The date and time of creation of the playlist
       
   119 	 */
       
   120 	QDateTime creationDate( ) const;
       
   121 	
       
   122 	/**
       
   123 	 * Method to get the URI of a resource that describes the license 
       
   124 	 * under which this playlist was released
       
   125 	 * @return The license Url
       
   126 	 */
       
   127 	QUrl license( ) const;
       
   128 	
       
   129 	/**
       
   130 	 * Method to get the ordered list of URIs. The purpose is to satisfy 
       
   131 	 * licenses allowing modification but requiring attribution
       
   132 	 * @return The list of license Urls
       
   133 	 */
       
   134 	QList<QUrl> attribution( ) const;
       
   135 	
       
   136 	/**
       
   137 	 * Method to get the meta element that allows metadata fields to be added to XSPF
       
   138 	 * @return The meta elements as a QVarintMap
       
   139 	 */
       
   140 	QVariantMap metadata( ) const;
       
   141 	
       
   142 	/**
       
   143 	 * Method to get the extension element that allows non-XSPF XML 
       
   144 	 * to be included in XSPF documents
       
   145 	 * @return The extension elements as a QVarintMap
       
   146 	 */
       
   147 	QVariantMap extension( ) const;
       
   148 	
       
   149 	/**
    61 	 * Method to get the list of tracks in the playlist
   150 	 * Method to get the list of tracks in the playlist
    62 	 * @return The list of tracks in the playlist
   151 	 * @return The list of tracks in the playlist
    63 	 */
   152 	 */
    64 	QList<SmfTrackInfo> trackList( ) const;
   153 	QList<SmfTrackInfo> trackList( ) const;
    65 	
   154 	
    66 	/**
   155 	/**
    67 	 * Method to get the playlist title
   156 	 * Method to set the version of the playlist
    68 	 * @return The title of the playlist
   157 	 * @param aVersion The version of the playlist
    69 	 */
   158 	 */
    70 	QString playListTitle( ) const;
   159 	void setVersion( const QString& aVersion );
    71 	
   160 	
    72 	/**
   161 	/**
    73 	 * Method to get the creation date of the playlist
   162 	 * Method to set the playlist title
    74 	 * @return The date and time of creation of the playlist
   163 	 * @param aTitle The title of the playlist
    75 	 */
   164 	 */
    76 	QDateTime creationDate( ) const;
   165 	void setPlayListTitle( const QString &aTitle );
    77 	
   166 	
    78 	/**
   167 	/**
    79 	 * Method to get the id of the playlist
   168 	 * Method to set the author of the playlist
    80 	 * @return The ID value 
   169 	 * @param aAuthor The author of the playlist
    81 	 */
   170 	 */
    82 	QString id( ) const;
   171 	void setAuthor( const QString& aAuthor );
       
   172 	
       
   173 	/**
       
   174 	 * Method to set the comments on the playlist
       
   175 	 * @param aComments The comments on the playlist
       
   176 	 */
       
   177 	void setComments( const QList<SmfComment>& aComments );
       
   178 	
       
   179 	/**
       
   180 	 * Method to set the URI of a web page to find out more about this playlist
       
   181 	 * @param aInfoUrl The info Url
       
   182 	 */
       
   183 	void setInfo( const QUrl& aInfoUrl );
       
   184 	
       
   185 	/**
       
   186 	 * Method to set the Source URI for this playlist
       
   187 	 * @param aLocation The Source URI for this playlist
       
   188 	 */
       
   189 	void setLocation( const QUrl& aLocation );
       
   190 	
       
   191 	/**
       
   192 	 * Method to set the id of the playlist
       
   193 	 * @param aId The ID value 
       
   194 	 */
       
   195 	void setId( const QString &aId);
       
   196 	
       
   197 	/**
       
   198 	 * Method to set the URI of an image to display in the absence 
       
   199 	 * of an image for playlist's tracks
       
   200 	 * @param aImage The default image Url
       
   201 	 */
       
   202 	void setImage( const QUrl& aImage );
       
   203 	
       
   204 	/**
       
   205 	 * Method to set the creation date of the playlist
       
   206 	 * @param aDate The date and time of creation of the playlist
       
   207 	 */
       
   208 	void setCreationDate( const QDateTime& aDate );
       
   209 	
       
   210 	/**
       
   211 	 * Method to set the URI of a resource that describes the license 
       
   212 	 * under which this playlist was released
       
   213 	 * @param aLicense The license Url
       
   214 	 */
       
   215 	void setLicense( const QUrl& aLicense );
       
   216 	
       
   217 	/**
       
   218 	 * Method to set the ordered list of URIs. The purpose is to satisfy 
       
   219 	 * licenses allowing modification but requiring attribution
       
   220 	 * @param aAttribution The list of license Urls
       
   221 	 */
       
   222 	void setAttribution( const QList<QUrl>& aAttribution );
       
   223 	
       
   224 	/**
       
   225 	 * Method to set the meta element that allows metadata fields to be added to XSPF
       
   226 	 * @param aMetaData The meta elements as a QVarintMap
       
   227 	 */
       
   228 	void setMetadata( const QVariantMap& aMetaData );
       
   229 	
       
   230 	/**
       
   231 	 * Method to set the extension element that allows non-XSPF XML 
       
   232 	 * to be included in XSPF documents
       
   233 	 * @param aExtension The extension elements as a QVarintMap
       
   234 	 */
       
   235 	void setExtension( const QVariantMap& aExtension );
    83 	
   236 	
    84 	/**
   237 	/**
    85 	 * Method to set the list of tracks in the playlist
   238 	 * Method to set the list of tracks in the playlist
    86 	 * @param aList The new list of tracks in the playlist
   239 	 * @param aList The new list of tracks in the playlist
    87 	 */
   240 	 */
    88 	void setTrackList( const QList<SmfTrackInfo> &aList );
   241 	void setTrackList( const QList<SmfTrackInfo> &aList );
    89 	
       
    90 	/**
       
    91 	 * Method to set the playlist title
       
    92 	 * @param aTitle The new title of the playlist
       
    93 	 */
       
    94 	void setPlayListTitle( const QString &aTitle );
       
    95 	
       
    96 	/**
       
    97 	 * Method to set the creation date of the playlist
       
    98 	 * @param aDate The new date and time of creation of the playlist
       
    99 	 */
       
   100 	void setCreationDate( const QDateTime &aDate );
       
   101 	
       
   102 	/**
       
   103 	 * Method to set the id of the playlist
       
   104 	 * @param aId The ID value 
       
   105 	 */
       
   106 	void setId( const QString &aId);
       
   107 	
   242 	
   108 private:
   243 private:
   109 	QSharedDataPointer<SmfPlaylistPrivate> d;
   244 	QSharedDataPointer<SmfPlaylistPrivate> d;
   110 	
   245 	
   111 	friend QDataStream &operator<<( QDataStream &aDataStream, 
   246 	friend QDataStream &operator<<( QDataStream &aDataStream, 
   142 // Make the class SmfPlaylist known to QMetaType, so that as to register it.
   277 // Make the class SmfPlaylist known to QMetaType, so that as to register it.
   143 Q_DECLARE_METATYPE(SmfPlaylist)
   278 Q_DECLARE_METATYPE(SmfPlaylist)
   144 Q_DECLARE_METATYPE(QList<SmfPlaylist>)
   279 Q_DECLARE_METATYPE(QList<SmfPlaylist>)
   145 
   280 
   146 #endif /* SMFPLAYLIST_H_ */
   281 #endif /* SMFPLAYLIST_H_ */
       
   282