example/clientapi/smf/inc/common/smfmusic/smfplaylist.h
changeset 2 86af6c333601
parent 1 4b1e636e8a71
equal deleted inserted replaced
1:4b1e636e8a71 2:86af6c333601
     1 /**
     1 /**
     2  * @file	smfplaylist.h
     2  * Copyright (c) 2010 Sasken Communication Technologies Ltd.
     3  * @author  Nalina Hariharan,Manasij Roy 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 playlist class represents an instance of a playlist
    16  *
    17  *
    17  * The playlist class represents an instance of a playlist
       
    18  */
    18  */
    19 
    19 
    20 #ifndef SMFPLAYLIST_H_
    20 #ifndef SMFPLAYLIST_H_
    21 #define SMFPLAYLIST_H_
    21 #define SMFPLAYLIST_H_
    22 
    22 
    23 #include <smftrackinfo.h>
    23 #include <smftrackinfo.h>
    24 #include <qdatastream.h>
    24 #include <qdatastream.h>
       
    25 #include <QSharedData>
       
    26 #include <smfclientglobal.h>
       
    27 
       
    28 class SmfPlaylistPrivate;
    25 
    29 
    26 /**
    30 /**
       
    31  * @ingroup smf_common_group
    27  * The playlist class represents an instance of a playlist
    32  * The playlist class represents an instance of a playlist
    28  */
    33  */
    29 class SmfPlaylist : public QObject
    34 class SMFCLIENT_EXPORT SmfPlaylist : public QObject
    30 	{
    35 	{
    31 	Q_OBJECT
    36 	Q_OBJECT
    32 public:
    37 public:
    33 	/**
    38 	/**
    34 	 * Constructor with default argument
    39 	 * Constructor with default argument
    35 	 * @param aParent The parent object
    40 	 * @param aParent The parent object
    36 	 */
    41 	 */
    37 	SmfPlaylist( QObject *aParent = 0 );
    42 	SmfPlaylist( QObject *aParent = 0 );
    38 	
    43 	
    39 	/**
    44 	/**
       
    45 	 * Copy Constructor
       
    46 	 * @param aOther The reference object
       
    47 	 */
       
    48 	SmfPlaylist( const SmfPlaylist &aOther );
       
    49 	
       
    50 	/**
    40 	 * Destructor
    51 	 * Destructor
    41 	 */
    52 	 */
    42 	~SmfPlaylist( );
    53 	~SmfPlaylist( );
    43 	
    54 	
    44 	/**
    55 	/**
    45 	 * Method to get the list of tracks in the playlist
    56 	 * Method to get the list of tracks in the playlist
    46 	 * @param aList The list of tracks in the playlist
    57 	 * @return The list of tracks in the playlist
    47 	 */
    58 	 */
    48 	void getTrackList( QList<SmfTrackInfo>& aList );
    59 	QList<SmfTrackInfo> trackList( ) const;
    49 	
    60 	
    50 	/**
    61 	/**
    51 	 * Method to get the playlist title
    62 	 * Method to get the playlist title
    52 	 * @param aTitle The title of the playlist
    63 	 * @return The title of the playlist
    53 	 */
    64 	 */
    54 	void getPlayListTitle( QString &aTitle );
    65 	QString playListTitle( ) const;
    55 	
    66 	
    56 	/**
    67 	/**
    57 	 * Method to get the creation date of the playlist
    68 	 * Method to get the creation date of the playlist
    58 	 * @param aDate The date and time of creation of the playlist
    69 	 * @return The date and time of creation of the playlist
    59 	 */
    70 	 */
    60 	void getCreationDate( QDateTime &aDate );
    71 	QDateTime creationDate( ) const;
    61 	
    72 	
    62 	/**
    73 	/**
    63 	 * Method to get the id of the playlist
    74 	 * Method to get the id of the playlist
    64 	 * @param aId The ID value 
    75 	 * @return The ID value 
    65 	 */
    76 	 */
    66 	void getId( QString &aId );
    77 	QString id( ) const;
    67 	
    78 	
    68 	/**
    79 	/**
    69 	 * Method to set the list of tracks in the playlist
    80 	 * Method to set the list of tracks in the playlist
    70 	 * @param aList The new list of tracks in the playlist
    81 	 * @param aList The new list of tracks in the playlist
    71 	 */
    82 	 */
    82 	 * @param aDate The new date and time of creation of the playlist
    93 	 * @param aDate The new date and time of creation of the playlist
    83 	 */
    94 	 */
    84 	void setCreationDate( const QDateTime &aDate );
    95 	void setCreationDate( const QDateTime &aDate );
    85 	
    96 	
    86 private:
    97 private:
    87 	QList<SmfTrackInfo> m_trackList;	// list of tracks
    98 	QSharedDataPointer<SmfPlaylistPrivate> d;
    88 	QString m_title;				// playlist name
    99 	
    89 	QDateTime m_creationDate;		// creation date
   100 	friend QDataStream &operator<<( QDataStream &aDataStream, 
    90 	QString m_playlistId;
   101 			const SmfPlaylist &aPlaylist );
       
   102 
       
   103 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
   104 			SmfPlaylist &aPlaylist );
    91 	
   105 	
    92 	};
   106 	};
    93  /**
   107 
    94   * Externalization
   108 
    95   */
   109 /**
    96  QDataStream &operator<<(QDataStream &, const SmfPlaylist &);
   110  * Method for Externalization. Writes the SmfPlaylist object to 
    97  /**
   111  * the stream and returns a reference to the stream.
    98   * Internalization
   112  * @param aDataStream Stream to be written
    99   */
   113  * @param aPlaylist The SmfPlaylist object to be externalized
   100  QDataStream &operator>>(QDataStream &, SmfPlaylist &);
   114  * @return reference to the written stream
   101  
   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 
   102 #endif /* SMFPLAYLIST_H_ */
   129 #endif /* SMFPLAYLIST_H_ */