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 music search services |
17 * Interface specification for music search services |
18 */ |
18 */ |
19 |
19 |
20 #ifndef SMFMUSICSEARCHPLUGIN_H_ |
20 #ifndef SMFMUSICSEARCHPLUGIN_H_ |
21 #define SMFMUSICSEARCHPLUGIN_H_ |
21 #define SMFMUSICSEARCHPLUGIN_H_ |
22 |
22 |
23 #include <smfproviderbase.h> |
23 #include <smfpluginbase.h> |
24 #include <QList> |
24 #include <QList> |
25 #include <smfmusicfingerprint.h> |
25 #include <smfmusicfingerprint.h> |
26 #include <smftrackinfo.h> |
26 #include <smftrackinfo.h> |
27 |
27 |
28 /** |
28 /** |
|
29 * @ingroup smf_plugin_group |
29 * Interface specification for music search services. This class |
30 * Interface specification for music search services. This class |
30 * provides basic functionality to allow applications to search for |
31 * provides basic functionality to allow applications to search for |
31 * tracks, get recommented tracks etc |
32 * tracks, get recommented tracks etc |
32 * |
33 * |
33 * All of the functionality described here should be implemented by a service |
34 * All of the functionality described here should be implemented by a service |
34 * specific plug-in. |
35 * specific plug-in. |
35 */ |
36 */ |
36 class SmfMusicSearchPlugin : public QObject |
37 class SmfMusicSearchPlugin : public SmfPluginBase |
37 { |
38 { |
38 Q_OBJECT |
39 Q_OBJECT |
39 public: |
40 public: |
40 /** |
41 /** |
41 * Constructor with default argument |
42 * Constructor with default argument |
47 * Destructor |
48 * Destructor |
48 */ |
49 */ |
49 ~SmfMusicSearchPlugin( ); |
50 ~SmfMusicSearchPlugin( ); |
50 |
51 |
51 /** |
52 /** |
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 |
53 * Method to get recommended tracks |
|
54 * @param aRequest [out] The request data to be sent to network |
59 * @param aTrack The track for which similar recommendations |
55 * @param aTrack The track for which similar recommendations |
60 * need to be fetched. |
56 * need to be fetched. |
61 * @param aRequest [out] The request data to be sent to network |
|
62 * @param aPageNum The page to be extracted |
57 * @param aPageNum The page to be extracted |
63 * @param aItemsPerPage Number of items per page |
58 * @param aItemsPerPage Number of items per page |
64 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
59 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
65 */ |
60 */ |
66 virtual SmfPluginError recommendations( const SmfTrackInfo aTrack, |
61 virtual SmfPluginError recommendations( SmfPluginRequestData *aRequest, |
67 SmfPluginRequestData *aRequest, |
62 const SmfTrackInfo aTrack, |
68 const int aPageNum = 0, |
63 const int aPageNum = SMF_FIRST_PAGE, |
69 const int aItemsPerPage = 10 ) = 0; |
64 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
70 |
65 |
71 /** |
66 /** |
72 * Method to get similar tracks |
67 * Method to get similar tracks |
|
68 * @param aRequest [out] The request data to be sent to network |
73 * @param aTrack The track for which similar tracks |
69 * @param aTrack The track for which similar tracks |
74 * need to be fetched. |
70 * need to be fetched. |
75 * @param aRequest [out] The request data to be sent to network |
|
76 * @param aPageNum The page to be extracted |
71 * @param aPageNum The page to be extracted |
77 * @param aItemsPerPage Number of items per page |
72 * @param aItemsPerPage Number of items per page |
78 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
73 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
79 */ |
74 */ |
80 virtual SmfPluginError tracks( const SmfTrackInfo aTrack, |
75 virtual SmfPluginError tracks( SmfPluginRequestData *aRequest, |
81 SmfPluginRequestData *aRequest, |
76 const SmfTrackInfo aTrack, |
82 const int aPageNum = 0, |
77 const int aPageNum = SMF_FIRST_PAGE, |
83 const int aItemsPerPage = 10) = 0; |
78 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
84 |
79 |
85 /** |
80 /** |
86 * Method to get tracks having a similar finger print |
81 * Method to get tracks having a similar finger print |
|
82 * @param aRequest [out] The request data to be sent to network |
87 * @param aSignature The finger print to be searched for need to be |
83 * @param aSignature The finger print to be searched for need to be |
88 * fetched. |
84 * fetched. |
89 * @param aRequest [out] The request data to be sent to network |
|
90 * @param aPageNum The page to be extracted |
85 * @param aPageNum The page to be extracted |
91 * @param aItemsPerPage Number of items per page |
86 * @param aItemsPerPage Number of items per page |
92 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
87 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
93 */ |
88 */ |
94 virtual SmfPluginError trackInfo( const SmfMusicFingerPrint aSignature, |
89 virtual SmfPluginError trackInfo( SmfPluginRequestData *aRequest, |
95 SmfPluginRequestData *aRequest, |
90 const SmfMusicFingerPrint aSignature, |
96 const int aPageNum = 0, |
91 const int aPageNum = SMF_FIRST_PAGE, |
97 const int aItemsPerPage = 10 ) = 0; |
92 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
98 |
93 |
99 /** |
94 /** |
100 * Method to search information about where to buy this song from |
95 * Method to search information about where to buy this song from |
|
96 * @param aRequest [out] The request data to be sent to network |
101 * @param aTrack The track for which stores need to be searched |
97 * @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 |
98 * @param aPageNum The page to be extracted |
104 * @param aItemsPerPage Number of items per page |
99 * @param aItemsPerPage Number of items per page |
105 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
100 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
106 */ |
101 */ |
107 virtual SmfPluginError stores( const SmfTrackInfo aTrack, |
102 virtual SmfPluginError stores( SmfPluginRequestData *aRequest, |
108 SmfPluginRequestData *aRequest, |
103 const SmfTrackInfo aTrack, |
109 const int aPageNum = 0, |
104 const int aPageNum = SMF_FIRST_PAGE, |
110 const int aItemsPerPage = 10 ) = 0; |
105 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
111 |
106 |
112 /** |
107 /** |
113 * Method to post the currently playing track |
108 * Method to post the currently playing track |
|
109 * @param aRequest [out] The request data to be sent to network |
114 * @param aTrack The current playing track, that should be posted |
110 * @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 |
111 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
117 */ |
112 */ |
118 virtual SmfPluginError postCurrentPlaying( const SmfTrackInfo aTrack, |
113 virtual SmfPluginError postCurrentPlaying( |
119 SmfPluginRequestData *aRequest ) = 0; |
114 SmfPluginRequestData *aRequest, |
120 |
115 const SmfTrackInfo aTrack ) = 0; |
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 |
116 |
143 }; |
117 }; |
144 |
118 |
145 Q_DECLARE_INTERFACE( SmfMusicSearchPlugin, "org.symbian.smf.plugin.music.search/v1.0" ); |
119 Q_DECLARE_INTERFACE( SmfMusicSearchPlugin, "org.symbian.smf.plugin.music.search/v1.0" ); |
146 |
120 |