example/clientapi/smf/inc/smfplugins/smfmusic/smfplaylistserviceplugin.h
changeset 2 86af6c333601
parent 1 4b1e636e8a71
equal deleted inserted replaced
1:4b1e636e8a71 2:86af6c333601
     6  * @section LICENSE
     6  * @section LICENSE
     7  *
     7  *
     8  * Copyright (c) 2010 Sasken Communication Technologies Ltd. 
     8  * Copyright (c) 2010 Sasken Communication Technologies Ltd. 
     9  * All rights reserved.
     9  * All rights reserved.
    10  * This component and the accompanying materials are made available 
    10  * This component and the accompanying materials are made available 
    11  * under the terms of the "{License}" 
    11  * under the terms of the "Eclipse Public License v1.0"
    12  * which accompanies  this distribution, and is available 
    12  * which accompanies  this distribution, and is available 
    13  * at the URL "{LicenseUrl}".
    13  * at the URL "http://www.eclipse.org/legal/epl-v10.html"
    14  * 
    14  * 
    15  * @section DESCRIPTION
    15  * @section DESCRIPTION
    16  *
    16  *
    17  * Interface specification for playlists service
    17  * Interface specification for playlists service
    18  */
    18  */
    19 
    19 
    20 #ifndef SMFPLAYLISTSERVICEPLUGIN_H_
    20 #ifndef SMFPLAYLISTSERVICEPLUGIN_H_
    21 #define SMFPLAYLISTSERVICEPLUGIN_H_
    21 #define SMFPLAYLISTSERVICEPLUGIN_H_
    22 
    22 
    23 #include <smfproviderbase.h>
    23 #include <smfpluginbase.h>
    24 #include <smfplaylist.h>
    24 #include <smfplaylist.h>
    25 #include <smfmusicprofile.h>
    25 #include <smfmusicprofile.h>
    26 #include <smftrackinfo.h>
    26 #include <smftrackinfo.h>
    27 
    27 
    28 /**
    28 /**
       
    29  * @ingroup smf_plugin_group
    29  * Interface specification for playlists service. This class provides 
    30  * Interface specification for playlists service. This class provides 
    30  * basic functionality to allow applications to get playlists of a user, 
    31  * basic functionality to allow applications to get playlists of a user, 
    31  * add some track to an existing playlist, post the current playing 
    32  * add some track to an existing playlist, post the current playing 
    32  * playlists etc.
    33  * playlists etc.
    33  *
    34  *
    34  * All of the functionality described here should be implemented by a service
    35  * All of the functionality described here should be implemented by a service
    35  * specific plug-in.
    36  * specific plug-in.
    36  */
    37  */
    37 class SmfPlaylistServicePlugin : public QObject
    38 class SmfPlaylistServicePlugin : public SmfPluginBase
    38 	{
    39 	{
    39 	Q_OBJECT
    40 	Q_OBJECT
    40 public:
    41 public:
    41 	/**
    42 	/**
    42 	 * Constructor with default argument
    43 	 * Constructor with default argument
    48 	 * Destructor
    49 	 * Destructor
    49 	 */
    50 	 */
    50 	~SmfPlaylistServicePlugin( );
    51 	~SmfPlaylistServicePlugin( );
    51 	
    52 	
    52 	/**
    53 	/**
    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
    54 	 * Method to get the playlist
    60 	 * @param aRequest [out] The request data to be sent to network
    55 	 * @param aRequest [out] The request data to be sent to network
    61 	 * @param aPageNum The page to be extracted
    56 	 * @param aPageNum The page to be extracted
    62 	 * @param aItemsPerPage Number of items per page
    57 	 * @param aItemsPerPage Number of items per page
    63 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
    58 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
    64 	 */
    59 	 */
    65 	virtual SmfPluginError playlists( 
    60 	virtual SmfPluginError playlists( SmfPluginRequestData *aRequest,
    66 			SmfPluginRequestData *aRequest,
    61 			const int aPageNum = SMF_FIRST_PAGE, 
    67 			const int aPageNum = 0, 
    62 			const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0;
    68 			const int aItemsPerPage = 10) = 0;
       
    69 	
    63 	
    70 	/**
    64 	/**
    71 	 * Method to get the playlist of a particular user
    65 	 * Method to get the playlist of a particular user
       
    66 	 * @param aRequest [out] The request data to be sent to network
    72 	 * @param aUser The user whose playlists need to be fetched
    67 	 * @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
    68 	 * @param aPageNum The page to be extracted
    75 	 * @param aItemsPerPage Number of items per page
    69 	 * @param aItemsPerPage Number of items per page
    76 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
    70 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
    77 	 */
    71 	 */
    78 	virtual SmfPluginError playlistsOf( const SmfMusicProfile aUser,
    72 	virtual SmfPluginError playlistsOf( SmfPluginRequestData *aRequest,
    79 			SmfPluginRequestData *aRequest,
    73 			const SmfMusicProfile aUser,
    80 			const int aPageNum = 0, 
    74 			const int aPageNum = SMF_FIRST_PAGE, 
    81 			const int aItemsPerPage = 10) = 0;
    75 			const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0;
    82 	
    76 	
    83 	/**
    77 	/**
    84 	 * Method to add tracks to a playlist
    78 	 * Method to add tracks to a playlist
       
    79 	 * @param aRequest [out] The request data to be sent to network
    85 	 * @param aPlaylist The playlist where tracks should be added
    80 	 * @param aPlaylist The playlist where tracks should be added
    86 	 * @param aTracks The tracks to be added to the playlist
    81 	 * @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
    82 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
    89 	 */
    83 	 */
    90 	virtual SmfPluginError* addToPlaylist( const SmfPlaylist aPlaylist, 
    84 	virtual SmfPluginError addToPlaylist( SmfPluginRequestData *aRequest,
    91 			const QList<SmfTrackInfo> aTracks,
    85 			const SmfPlaylist aPlaylist, 
    92 			SmfPluginRequestData *aRequest ) = 0;
    86 			const QList<SmfTrackInfo> aTracks ) = 0;
    93 	
    87 	
    94 	/**
    88 	/**
    95 	 * Method to post the current playing playlist
    89 	 * Method to post the current playing playlist
       
    90 	 * @param aRequest [out] The request data to be sent to network
    96 	 * @param aPlaylist The current playing playlist which should be posted
    91 	 * @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
    92 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
    99 	 */
    93 	 */
   100 	virtual SmfPluginError* postCurrentPlayingPlaylist( 
    94 	virtual SmfPluginError postCurrentPlayingPlaylist(
   101 			const SmfPlaylist aPlaylist,
    95 			SmfPluginRequestData *aRequest, 
   102 			SmfPluginRequestData *aRequest ) = 0;
    96 			const SmfPlaylist aPlaylist ) = 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 	
    97 	
   140 	};
    98 	};
   141 
    99 
   142 Q_DECLARE_INTERFACE( SmfPlaylistServicePlugin, "org.symbian.smf.plugin.music.playlist/v1.0" );
   100 Q_DECLARE_INTERFACE( SmfPlaylistServicePlugin, "org.symbian.smf.plugin.music.playlist/v1.0" );
   143 
   101