|
1 /** |
|
2 * @file smflyricsserviceplugin.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 track lyrics |
|
18 */ |
|
19 |
|
20 #ifndef SMFLYRICSSERVICEPLUGIN_H_ |
|
21 #define SMFLYRICSSERVICEPLUGIN_H_ |
|
22 |
|
23 #include <smfproviderbase.h> |
|
24 #include <smftrackinfo.h> |
|
25 #include <QString> |
|
26 #include <smfsubtitle.h> |
|
27 #include <smflyrics.h> |
|
28 #include <smfsubtitlesearchfilter.h> |
|
29 |
|
30 /** |
|
31 * Interface specification for music track lyrics |
|
32 * |
|
33 * All of the functionality described here should be implemented by a service |
|
34 * specific plug-in. |
|
35 */ |
|
36 class SmfLyricsServicePlugin : public QObject |
|
37 { |
|
38 Q_OBJECT |
|
39 public: |
|
40 /** |
|
41 * Constructor with default argument |
|
42 * @param aParent The parent object |
|
43 */ |
|
44 SmfLyricsServicePlugin( QObject* aParent = 0 ); |
|
45 |
|
46 /** |
|
47 * Destructor |
|
48 */ |
|
49 ~SmfLyricsServicePlugin( ); |
|
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 the lyrics |
|
59 * @param aTrack The track whose lyrics need to be fetched |
|
60 * @param aRequest [out] The request data to be sent to network |
|
61 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
62 */ |
|
63 virtual SmfPluginError lyrics( const SmfTrackInfo aTrack, |
|
64 SmfPluginRequestData *aRequest ) = 0; |
|
65 |
|
66 /** |
|
67 * Method to get the subtitle |
|
68 * @param aTrack The track whose subtitle need to be fetched |
|
69 * @param aRequest [out] The request data to be sent to network |
|
70 * @param aFilter The subtitle search filter if any |
|
71 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
72 */ |
|
73 virtual SmfPluginError subtitles( const SmfTrackInfo aTrack, |
|
74 SmfPluginRequestData *aRequest, |
|
75 const SmfSubtitleSearchFilter aFilter = 0 ) = 0; |
|
76 |
|
77 /** |
|
78 * Method to get the result for a network request. |
|
79 * @param aTransportResult The result of transport operation |
|
80 * @param aReply The QNetworkReply instance for the request |
|
81 * @param aResult [out] An output parameter to the plugin manager.If the |
|
82 * return value is SmfSendRequestAgain, QVariant will be of type |
|
83 * SmfPluginRequestData. |
|
84 * If last operation was lyrics(), aResult will be of type SmfLyrics |
|
85 * If last operation was subtitles(), aResult will be of type SmfSubtitle |
|
86 * @param aRetType [out] SmfPluginRetType |
|
87 * @param aIsLastPage [out] true if this the last page, else false |
|
88 * @return SmfPluginError |
|
89 */ |
|
90 virtual SmfPluginError responseAvailable( |
|
91 const SmfTransportResult aTransportResult, |
|
92 QNetworkReply *aReply, |
|
93 QVariant* aResult, |
|
94 SmfPluginRetType aRetType, |
|
95 bool aIsLastPage) = 0; |
|
96 |
|
97 }; |
|
98 |
|
99 Q_DECLARE_INTERFACE( SmfLyricsServicePlugin, "org.symbian.smf.plugin.music.lyrics/v1.0" ); |
|
100 |
|
101 #endif /* SMFLYRICSSERVICEPLUGIN_H_ */ |