smf/smfservermodule/smfclient/common/smfplaylist.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 playlist class represents an instance of a playlist
       
    17  *
       
    18  */
       
    19 
       
    20 #ifndef SMFPLAYLIST_H_
       
    21 #define SMFPLAYLIST_H_
       
    22 
       
    23 #include <smftrackinfo.h>
       
    24 #include <qdatastream.h>
       
    25 #include <QSharedData>
       
    26 #include <smfclientglobal.h>
       
    27 #include <QMetaType>
       
    28 
       
    29 class SmfPlaylistPrivate;
       
    30 
       
    31 /**
       
    32  * @ingroup smf_common_group
       
    33  * The playlist class represents an instance of a playlist
       
    34  */
       
    35 class SMFCLIENT_EXPORT SmfPlaylist
       
    36 	{
       
    37 public:
       
    38 	/**
       
    39 	 * Constructor with default argument
       
    40 	 */
       
    41 	SmfPlaylist( );
       
    42 	
       
    43 	/**
       
    44 	 * Copy Constructor
       
    45 	 * @param aOther The reference object
       
    46 	 */
       
    47 	SmfPlaylist( const SmfPlaylist &aOther );
       
    48 	
       
    49 	/**
       
    50 	 * Overloaded = operator
       
    51 	 * @param aOther The reference object
       
    52 	 */
       
    53 	SmfPlaylist& operator=( const SmfPlaylist &aOther );
       
    54 	
       
    55 	/**
       
    56 	 * Destructor
       
    57 	 */
       
    58 	~SmfPlaylist( );
       
    59 	
       
    60 	/**
       
    61 	 * Method to get the list of tracks in the playlist
       
    62 	 * @return The list of tracks in the playlist
       
    63 	 */
       
    64 	QList<SmfTrackInfo> trackList( ) const;
       
    65 	
       
    66 	/**
       
    67 	 * Method to get the playlist title
       
    68 	 * @return The title of the playlist
       
    69 	 */
       
    70 	QString playListTitle( ) const;
       
    71 	
       
    72 	/**
       
    73 	 * Method to get the creation date of the playlist
       
    74 	 * @return The date and time of creation of the playlist
       
    75 	 */
       
    76 	QDateTime creationDate( ) const;
       
    77 	
       
    78 	/**
       
    79 	 * Method to get the id of the playlist
       
    80 	 * @return The ID value 
       
    81 	 */
       
    82 	QString id( ) const;
       
    83 	
       
    84 	/**
       
    85 	 * Method to set the list of tracks in the playlist
       
    86 	 * @param aList The new list of tracks in the playlist
       
    87 	 */
       
    88 	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 	
       
   108 private:
       
   109 	QSharedDataPointer<SmfPlaylistPrivate> d;
       
   110 	
       
   111 	friend QDataStream &operator<<( QDataStream &aDataStream, 
       
   112 			const SmfPlaylist &aPlaylist );
       
   113 
       
   114 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
   115 			SmfPlaylist &aPlaylist );
       
   116 	
       
   117 	};
       
   118 
       
   119 
       
   120 /**
       
   121  * Method for Externalization. Writes the SmfPlaylist object to 
       
   122  * the stream and returns a reference to the stream.
       
   123  * @param aDataStream Stream to be written
       
   124  * @param aPlaylist The SmfPlaylist object to be externalized
       
   125  * @return reference to the written stream
       
   126  */
       
   127 SMFCLIENT_EXPORT QDataStream &operator<<( QDataStream &aDataStream, 
       
   128 		const SmfPlaylist &aPlaylist );
       
   129 
       
   130 /**
       
   131  * Method for Internalization. Reads a SmfPlaylist object from 
       
   132  * the stream and returns a reference to the stream.
       
   133  * @param aDataStream Stream to be read
       
   134  * @param aPlaylist The SmfPlaylist object to be internalized
       
   135  * @return reference to the stream
       
   136  */
       
   137 SMFCLIENT_EXPORT QDataStream &operator>>( QDataStream &aDataStream, 
       
   138 		SmfPlaylist &aPlaylist);
       
   139 
       
   140 typedef QList<SmfPlaylist> SmfPlaylistList;
       
   141 
       
   142 // Make the class SmfPlaylist known to QMetaType, so that as to register it.
       
   143 Q_DECLARE_METATYPE(SmfPlaylist)
       
   144 Q_DECLARE_METATYPE(QList<SmfPlaylist>)
       
   145 
       
   146 #endif /* SMFPLAYLIST_H_ */