example/clientapi/smf/inc/smfplugins/smfmusic/smfmusicsearchplugin.h
changeset 1 4b1e636e8a71
child 2 86af6c333601
equal deleted inserted replaced
0:5d2360e70d9f 1:4b1e636e8a71
       
     1 /**
       
     2  * @file	smfmusicsearchplugin.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 music search services
       
    18  */
       
    19 
       
    20 #ifndef SMFMUSICSEARCHPLUGIN_H_
       
    21 #define SMFMUSICSEARCHPLUGIN_H_
       
    22 
       
    23 #include <smfproviderbase.h>
       
    24 #include <QList>
       
    25 #include <smfmusicfingerprint.h>
       
    26 #include <smftrackinfo.h>
       
    27 
       
    28 /**
       
    29  * Interface specification for music search services. This class
       
    30  * provides basic functionality to allow applications to search for 
       
    31  * tracks, get recommented tracks etc
       
    32  *
       
    33  * All of the functionality described here should be implemented by a service
       
    34  * specific plug-in.
       
    35  */
       
    36 class SmfMusicSearchPlugin : public QObject
       
    37 	{
       
    38 	Q_OBJECT
       
    39 public:
       
    40 	/**
       
    41 	 * Constructor with default argument
       
    42 	 * @param aParent The parent object
       
    43 	 */
       
    44 	SmfMusicSearchPlugin( QObject *aParent = 0 );
       
    45 	
       
    46 	/**
       
    47 	 * Destructor
       
    48 	 */
       
    49 	~SmfMusicSearchPlugin( );
       
    50 	
       
    51 	/**
       
    52 	 * Method to get the provider information
       
    53 	 * @return Instance of SmfProviderBase
       
    54 	 */
       
    55 	virtual SmfProviderBase* getProviderInfo( ) = 0;
       
    56 	
       
    57 	/**
       
    58 	 * Method to get recommended tracks
       
    59 	 * @param aTrack The track for which similar recommendations 
       
    60 	 * need to be fetched.
       
    61 	 * @param aRequest [out] The request data to be sent to network
       
    62 	 * @param aPageNum The page to be extracted
       
    63 	 * @param aItemsPerPage Number of items per page
       
    64 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    65 	 */
       
    66 	virtual SmfPluginError recommendations( const SmfTrackInfo aTrack,
       
    67 			SmfPluginRequestData *aRequest,
       
    68 			const int aPageNum = 0, 
       
    69 			const int aItemsPerPage = 10 ) = 0;
       
    70 	
       
    71 	/**
       
    72 	 * Method to get similar tracks
       
    73 	 * @param aTrack The track for which similar tracks 
       
    74 	 * need to be fetched.
       
    75 	 * @param aRequest [out] The request data to be sent to network
       
    76 	 * @param aPageNum The page to be extracted
       
    77 	 * @param aItemsPerPage Number of items per page
       
    78 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    79 	 */
       
    80 	virtual SmfPluginError tracks( const SmfTrackInfo aTrack, 
       
    81 			SmfPluginRequestData *aRequest,
       
    82 			const int aPageNum = 0, 
       
    83 			const int aItemsPerPage = 10) = 0;
       
    84 	
       
    85 	/**
       
    86 	 * Method to get tracks having a similar finger print
       
    87 	 * @param aSignature The finger print to be searched for need to be 
       
    88 	 * fetched.
       
    89 	 * @param aRequest [out] The request data to be sent to network
       
    90 	 * @param aPageNum The page to be extracted
       
    91 	 * @param aItemsPerPage Number of items per page
       
    92 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    93 	 */
       
    94 	virtual SmfPluginError trackInfo( const SmfMusicFingerPrint aSignature, 
       
    95 			SmfPluginRequestData *aRequest,
       
    96 			const int aPageNum = 0, 
       
    97 			const int aItemsPerPage = 10 ) = 0;
       
    98 	
       
    99 	/**
       
   100 	 * Method to search information about where to buy this song from
       
   101 	 * @param aTrack The track for which stores need to be searched
       
   102 	 * @param aRequest [out] The request data to be sent to network
       
   103 	 * @param aPageNum The page to be extracted
       
   104 	 * @param aItemsPerPage Number of items per page
       
   105 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
   106 	 */
       
   107 	virtual SmfPluginError stores( const SmfTrackInfo aTrack, 
       
   108 			SmfPluginRequestData *aRequest,
       
   109 			const int aPageNum = 0, 
       
   110 			const int aItemsPerPage = 10 ) = 0;
       
   111 	
       
   112 	/**
       
   113 	 * Method to post the currently playing track
       
   114 	 * @param aTrack The current playing track, that should be posted
       
   115 	 * @param aRequest [out] The request data to be sent to network
       
   116 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
   117 	 */
       
   118 	virtual SmfPluginError postCurrentPlaying( const SmfTrackInfo aTrack,
       
   119 			SmfPluginRequestData *aRequest ) = 0;
       
   120 	
       
   121 
       
   122 	/**
       
   123 	 * Method to get the result for a network request.
       
   124 	 * @param aTransportResult The result of transport operation
       
   125 	 * @param aReply The QNetworkReply instance for the request
       
   126 	 * @param aResult [out] An output parameter to the plugin manager.If the 
       
   127 	 * return value is SmfSendRequestAgain, QVariant will be of type 
       
   128 	 * SmfPluginRequestData. 
       
   129 	 * If last operation was recommendations()or tracks() or trackInfo(), 
       
   130 	 * aResult will be of type QList<SmfTrackInfo>
       
   131 	 * If last operation was postCurrentPlaying(), aResult will be of type bool
       
   132 	 * @param aRetType [out] SmfPluginRetType
       
   133 	 * @param aIsLastPage [out] true if this the last page, else false
       
   134 	 * @return SmfPluginError 
       
   135 	 */
       
   136 	virtual SmfPluginError responseAvailable( 
       
   137 			const SmfTransportResult aTransportResult, 
       
   138 			QNetworkReply *aReply, 
       
   139 			QVariant* aResult, 
       
   140 			SmfPluginRetType aRetType,
       
   141 			bool aIsLastPage) = 0;
       
   142 	
       
   143 	};
       
   144 
       
   145 Q_DECLARE_INTERFACE( SmfMusicSearchPlugin, "org.symbian.smf.plugin.music.search/v1.0" );
       
   146 
       
   147 #endif /* SMFMUSICSEARCHPLUGIN_H_ */