smf/inc/common/smfmusic/smfplaylist.h
changeset 3 0446eb7b28aa
child 5 edb9dc8273d9
equal deleted inserted replaced
2:86af6c333601 3:0446eb7b28aa
       
     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 
       
    28 class SmfPlaylistPrivate;
       
    29 
       
    30 /**
       
    31  * @ingroup smf_common_group
       
    32  * The playlist class represents an instance of a playlist
       
    33  */
       
    34 class SMFCLIENT_EXPORT SmfPlaylist : public QObject
       
    35 	{
       
    36 	Q_OBJECT
       
    37 public:
       
    38 	/**
       
    39 	 * Constructor with default argument
       
    40 	 * @param aParent The parent object
       
    41 	 */
       
    42 	SmfPlaylist( QObject *aParent = 0 );
       
    43 	
       
    44 	/**
       
    45 	 * Copy Constructor
       
    46 	 * @param aOther The reference object
       
    47 	 */
       
    48 	SmfPlaylist( const SmfPlaylist &aOther );
       
    49 	
       
    50 	/**
       
    51 	 * Destructor
       
    52 	 */
       
    53 	~SmfPlaylist( );
       
    54 	
       
    55 	/**
       
    56 	 * Method to get the list of tracks in the playlist
       
    57 	 * @return The list of tracks in the playlist
       
    58 	 */
       
    59 	QList<SmfTrackInfo> trackList( ) const;
       
    60 	
       
    61 	/**
       
    62 	 * Method to get the playlist title
       
    63 	 * @return The title of the playlist
       
    64 	 */
       
    65 	QString playListTitle( ) const;
       
    66 	
       
    67 	/**
       
    68 	 * Method to get the creation date of the playlist
       
    69 	 * @return The date and time of creation of the playlist
       
    70 	 */
       
    71 	QDateTime creationDate( ) const;
       
    72 	
       
    73 	/**
       
    74 	 * Method to get the id of the playlist
       
    75 	 * @return The ID value 
       
    76 	 */
       
    77 	QString id( ) const;
       
    78 	
       
    79 	/**
       
    80 	 * Method to set the list of tracks in the playlist
       
    81 	 * @param aList The new list of tracks in the playlist
       
    82 	 */
       
    83 	void setTrackList( const QList<SmfTrackInfo> &aList );
       
    84 	
       
    85 	/**
       
    86 	 * Method to set the playlist title
       
    87 	 * @param aTitle The new title of the playlist
       
    88 	 */
       
    89 	void setPlayListTitle( const QString &aTitle );
       
    90 	
       
    91 	/**
       
    92 	 * Method to set the creation date of the playlist
       
    93 	 * @param aDate The new date and time of creation of the playlist
       
    94 	 */
       
    95 	void setCreationDate( const QDateTime &aDate );
       
    96 	
       
    97 private:
       
    98 	QSharedDataPointer<SmfPlaylistPrivate> d;
       
    99 	
       
   100 	friend QDataStream &operator<<( QDataStream &aDataStream, 
       
   101 			const SmfPlaylist &aPlaylist );
       
   102 
       
   103 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
   104 			SmfPlaylist &aPlaylist );
       
   105 	
       
   106 	};
       
   107 
       
   108 
       
   109 /**
       
   110  * Method for Externalization. Writes the SmfPlaylist object to 
       
   111  * the stream and returns a reference to the stream.
       
   112  * @param aDataStream Stream to be written
       
   113  * @param aPlaylist The SmfPlaylist object to be externalized
       
   114  * @return reference to the written stream
       
   115  */
       
   116 QDataStream &operator<<( QDataStream &aDataStream, 
       
   117 		const SmfPlaylist &aPlaylist );
       
   118 
       
   119 /**
       
   120  * Method for Internalization. Reads a SmfPlaylist object from 
       
   121  * the stream and returns a reference to the stream.
       
   122  * @param aDataStream Stream to be read
       
   123  * @param aPlaylist The SmfPlaylist object to be internalized
       
   124  * @return reference to the stream
       
   125  */
       
   126 QDataStream &operator>>( QDataStream &aDataStream, 
       
   127 		SmfPlaylist &aPlaylist);
       
   128 
       
   129 // Make the class SmfPlaylist known to QMetaType, so that as to register it.
       
   130 Q_DECLARE_METATYPE(SmfPlaylist)
       
   131 
       
   132 #endif /* SMFPLAYLIST_H_ */