example/clientapi/smf/inc/smfplugins/smfmusic/smfplaylistserviceplugin.h
changeset 1 4b1e636e8a71
child 2 86af6c333601
equal deleted inserted replaced
0:5d2360e70d9f 1:4b1e636e8a71
       
     1 /**
       
     2  * @file	smfplaylistserviceplugin.h
       
     3  * @author  Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution
       
     4  * @version 1.0
       
     5  *
       
     6  * @section LICENSE
       
     7  *
       
     8  * Copyright (c) 2010 Sasken Communication Technologies Ltd. 
       
     9  * All rights reserved.
       
    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  * 
       
    15  * @section DESCRIPTION
       
    16  *
       
    17  * Interface specification for playlists service
       
    18  */
       
    19 
       
    20 #ifndef SMFPLAYLISTSERVICEPLUGIN_H_
       
    21 #define SMFPLAYLISTSERVICEPLUGIN_H_
       
    22 
       
    23 #include <smfproviderbase.h>
       
    24 #include <smfplaylist.h>
       
    25 #include <smfmusicprofile.h>
       
    26 #include <smftrackinfo.h>
       
    27 
       
    28 /**
       
    29  * Interface specification for playlists service. This class provides 
       
    30  * basic functionality to allow applications to get playlists of a user, 
       
    31  * add some track to an existing playlist, post the current playing 
       
    32  * playlists etc.
       
    33  *
       
    34  * All of the functionality described here should be implemented by a service
       
    35  * specific plug-in.
       
    36  */
       
    37 class SmfPlaylistServicePlugin : public QObject
       
    38 	{
       
    39 	Q_OBJECT
       
    40 public:
       
    41 	/**
       
    42 	 * Constructor with default argument
       
    43 	 * @param aParent The parent object
       
    44 	 */
       
    45 	SmfPlaylistServicePlugin( QObject *aParent = 0 );
       
    46 	
       
    47 	/**
       
    48 	 * Destructor
       
    49 	 */
       
    50 	~SmfPlaylistServicePlugin( );
       
    51 	
       
    52 	/**
       
    53 	 * Method to get the provider information
       
    54 	 * @return Instance of SmfProviderBase
       
    55 	 */
       
    56 	virtual SmfProviderBase* getProviderInfo( ) = 0;
       
    57 	
       
    58 	/**
       
    59 	 * Method to get the playlist
       
    60 	 * @param aRequest [out] The request data to be sent to network
       
    61 	 * @param aPageNum The page to be extracted
       
    62 	 * @param aItemsPerPage Number of items per page
       
    63 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    64 	 */
       
    65 	virtual SmfPluginError playlists( 
       
    66 			SmfPluginRequestData *aRequest,
       
    67 			const int aPageNum = 0, 
       
    68 			const int aItemsPerPage = 10) = 0;
       
    69 	
       
    70 	/**
       
    71 	 * Method to get the playlist of a particular user
       
    72 	 * @param aUser The user whose playlists need to be fetched
       
    73 	 * @param aRequest [out] The request data to be sent to network
       
    74 	 * @param aPageNum The page to be extracted
       
    75 	 * @param aItemsPerPage Number of items per page
       
    76 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    77 	 */
       
    78 	virtual SmfPluginError playlistsOf( const SmfMusicProfile aUser,
       
    79 			SmfPluginRequestData *aRequest,
       
    80 			const int aPageNum = 0, 
       
    81 			const int aItemsPerPage = 10) = 0;
       
    82 	
       
    83 	/**
       
    84 	 * Method to add tracks to a playlist
       
    85 	 * @param aPlaylist The playlist where tracks should be added
       
    86 	 * @param aTracks The tracks to be added to the playlist
       
    87 	 * @param aRequest [out] The request data to be sent to network
       
    88 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    89 	 */
       
    90 	virtual SmfPluginError* addToPlaylist( const SmfPlaylist aPlaylist, 
       
    91 			const QList<SmfTrackInfo> aTracks,
       
    92 			SmfPluginRequestData *aRequest ) = 0;
       
    93 	
       
    94 	/**
       
    95 	 * Method to post the current playing playlist
       
    96 	 * @param aPlaylist The current playing playlist which should be posted
       
    97 	 * @param aRequest [out] The request data to be sent to network
       
    98 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    99 	 */
       
   100 	virtual SmfPluginError* postCurrentPlayingPlaylist( 
       
   101 			const SmfPlaylist aPlaylist,
       
   102 			SmfPluginRequestData *aRequest ) = 0;
       
   103 	
       
   104 	
       
   105 	/**
       
   106 	 * Method to get the result for a network request.
       
   107 	 * @param aTransportResult The result of transport operation
       
   108 	 * @param aReply The QNetworkReply instance for the request
       
   109 	 * @param aResult An output parameter to the plugin manager.If the 
       
   110 	 * return value is SmfSendRequestAgain, QVariant will be of type 
       
   111 	 * SmfPluginRequestData. 
       
   112 	 * If last operation was playlists() or playlistsOf(), aResult will be of 
       
   113 	 * type QList<SmfPlaylist>
       
   114 	 * If last operation was addToPlaylist() or postCurrentPlayingPlaylist(), 
       
   115 	 * aResult will be of type bool
       
   116 	 * @return SmfPluginRetType
       
   117 	 */
       
   118 	/**
       
   119 	 * Method to get the result for a network request.
       
   120 	 * @param aTransportResult The result of transport operation
       
   121 	 * @param aReply The QNetworkReply instance for the request
       
   122 	 * @param aResult [out] An output parameter to the plugin manager.If the 
       
   123 	 * return value is SmfSendRequestAgain, QVariant will be of type 
       
   124 	 * SmfPluginRequestData. 
       
   125 	 * If last operation was playlists() or playlistsOf(), aResult will be of 
       
   126 	 * type QList<SmfPlaylist>
       
   127 	 * If last operation was addToPlaylist() or postCurrentPlayingPlaylist(), 
       
   128 	 * aResult will be of type bool
       
   129 	 * @param aRetType [out] SmfPluginRetType
       
   130 	 * @param aIsLastPage [out] true if this the last page, else false
       
   131 	 * @return SmfPluginError 
       
   132 	 */
       
   133 	virtual SmfPluginError responseAvailable( 
       
   134 			const SmfTransportResult aTransportResult, 
       
   135 			QNetworkReply *aReply, 
       
   136 			QVariant* aResult, 
       
   137 			SmfPluginRetType aRetType,
       
   138 			bool aIsLastPage) = 0;
       
   139 	
       
   140 	};
       
   141 
       
   142 Q_DECLARE_INTERFACE( SmfPlaylistServicePlugin, "org.symbian.smf.plugin.music.playlist/v1.0" );
       
   143 
       
   144 #endif /* SMFPLAYLISTSERVICEPLUGIN_H_ */