author | cgandhi |
Thu, 23 Sep 2010 17:15:03 +0530 | |
changeset 23 | 574948b60dab |
child 26 | 83d6a149c755 |
permissions | -rw-r--r-- |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
1 |
/* |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
2 |
* lastfmmusiceventplugin.h |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
3 |
* |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
4 |
* Created on: Jun 21, 2010 |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
5 |
* Author: ankitg |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
6 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
7 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
8 |
#ifndef LASTFMMUSICEVENTPLUGIN_H_ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
9 |
#define LASTFMMUSICEVENTPLUGIN_H_ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
10 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
11 |
// Include files |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
12 |
#include "smfeventsfetcherplugin.h" |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
13 |
#include "smfpluginutil.h" |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
14 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
15 |
#include <parser.h> |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
16 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
17 |
// Forward declarations |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
18 |
class MusicProviderBase; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
19 |
class QVariant; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
20 |
class QNetworkReply; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
21 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
22 |
// Class declaration |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
23 |
class MusicEventPlugin : public QObject, public SmfEventsFetcherPlugin |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
24 |
{ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
25 |
Q_OBJECT |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
26 |
Q_INTERFACES( SmfEventsFetcherPlugin SmfPluginBase ) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
27 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
28 |
public: |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
29 |
virtual ~MusicEventPlugin(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
30 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
31 |
public: // From SmfMusicEventsPlugin |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
32 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
33 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
34 |
* Method to get the events based on location |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
35 |
* @param aRequest [out] The request data to be sent to network |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
36 |
* @param aLocation Location of the event |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
37 |
* @param aPageNum The page to be extracted |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
38 |
* @param aItemsPerPage Number of items per page |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
39 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
40 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
41 |
/*SmfPluginError events( SmfPluginRequestData &aRequest, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
42 |
const QGeoPositionInfo &aLocation, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
43 |
const int aPageNum = SMF_FIRST_PAGE, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
44 |
const int aItemsPerPage = SMF_ITEMS_PER_PAGE ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
45 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
46 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
47 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
48 |
* Method to get the venues based on location |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
49 |
* @param aRequest [out] The request data to be sent to network |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
50 |
* @param aLocation Location of the venue |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
51 |
* @param aPageNum The page to be extracted |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
52 |
* @param aItemsPerPage Number of items per page |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
53 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
54 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
55 |
void fetchKeys( QString &aApiKey, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
56 |
QString &aApiSecret, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
57 |
QString &aSessionKey, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
58 |
QString &aSessionSecret ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
59 |
SmfPluginError venues( SmfPluginRequestData &aRequest, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
60 |
const SmfLocation &aLocation, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
61 |
const int aPageNum = SMF_FIRST_PAGE, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
62 |
const int aItemsPerPage = SMF_ITEMS_PER_PAGE ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
63 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
64 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
65 |
* Method to get the events based on venues |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
66 |
* @param aRequest [out] The request data to be sent to network |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
67 |
* @param aVenue Venue of the event |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
68 |
* @param aPageNum The page to be extracted |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
69 |
* @param aItemsPerPage Number of items per page |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
70 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
71 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
72 |
SmfPluginError events( SmfPluginRequestData &aRequest, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
73 |
const SmfLocation &aVenue, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
74 |
const int aPageNum = SMF_FIRST_PAGE, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
75 |
const int aItemsPerPage = SMF_ITEMS_PER_PAGE ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
76 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
77 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
78 |
* Method to post events |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
79 |
* @param aRequest [out] The request data to be sent to network |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
80 |
* @param aEventList The list of events to be posted |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
81 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
82 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
83 |
SmfPluginError postEvents( SmfPluginRequestData &aRequest, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
84 |
const QList<SmfEvent> &aEventList ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
85 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
86 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
87 |
/*** Method to get the list of attendees for a musical event |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
88 |
* @param aRequest [out] The request data to be sent to network |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
89 |
* @param aEvent The event for which attendees should be fetched |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
90 |
* @param aPageNum The page to be extracted |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
91 |
* @param aItemsPerPage Number of items per page |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
92 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
93 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
94 |
SmfPluginError attendees( SmfPluginRequestData &aRequest, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
95 |
const SmfEvent &aEvent, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
96 |
const int aPageNum = SMF_FIRST_PAGE, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
97 |
const int aItemsPerPage = SMF_ITEMS_PER_PAGE ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
98 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
99 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
100 |
* Customised method for SmfMusicEventsPlugin interface |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
101 |
* @param aRequest [out] The request data to be sent to network |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
102 |
* @param aOperation The operation type (should be known between |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
103 |
* the client interface and the plugin) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
104 |
* @param aData The data required to form the request (The type |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
105 |
* of data should be known between client and the plugin) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
106 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
107 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
108 |
SmfPluginError customRequest( SmfPluginRequestData &aRequest, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
109 |
const int &aOperation, QByteArray *aData ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
110 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
111 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
112 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
113 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
114 |
public: // From SmfPluginBase |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
115 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
116 |
* The first method to be called in the plugin that implements this interface. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
117 |
* If this method is not called, plugin may not behave as expected. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
118 |
* Plugins are expected to save the aUtil handle and use and when required. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
119 |
* @param aUtil The instance of SmfPluginUtil |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
120 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
121 |
void initialize(/*SmfPluginUtil *aUtil*/); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
122 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
123 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
124 |
* Method to get the provider information |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
125 |
* @return Instance of SmfProviderBase |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
126 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
127 |
SmfProviderBase* getProviderInfo( ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
128 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
129 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
130 |
* Method to get the result for a network request. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
131 |
* @param aTransportResult The result of transport operation |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
132 |
* @param aReply The QNetworkReply instance for the request |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
133 |
* @param aResult [out] An output parameter to the plugin manager.If the |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
134 |
* return value is SmfSendRequestAgain, QVariant will be of type |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
135 |
* SmfPluginRequestData. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
136 |
* For SmfGalleryPlugin: If last operation was pictures(), aResult will |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
137 |
* be of type QList<SmfPicture>. If last operation was description(), |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
138 |
* aResult will be of type QString. If last operation was upload() or |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
139 |
* postComment(), aResult will be of type bool. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
140 |
* @param aRetType [out] SmfPluginRetType |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
141 |
* @param aPageResult [out] The SmfResultPage structure variable |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
142 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
143 |
/* SmfPluginError responseAvailable( |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
144 |
const SmfTransportResult &aTransportResult, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
145 |
QNetworkReply *aReply, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
146 |
QVariant* aResult, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
147 |
SmfPluginRetType &aRetType, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
148 |
SmfResultPage &aPageResult );*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
149 |
SmfPluginError responseAvailable( |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
150 |
const SmfRequestTypeID aOperation, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
151 |
const SmfTransportResult &aTransportResult, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
152 |
QByteArray *aResponse, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
153 |
QVariant* aResult, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
154 |
SmfPluginRetType &aRetType, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
155 |
SmfResultPage &aPageResult ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
156 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
157 |
void writeLog(QString log) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
158 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
159 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
160 |
private: |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
161 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
162 |
QString generateSignature(const QString aBaseString); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
163 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
164 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
165 |
private slots: |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
166 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
167 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
168 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
169 |
private: |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
170 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
171 |
* Method called by plugins to generate a request data |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
172 |
* @param aRequest [out] The request data to be sent to network |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
173 |
* @param aOperation The type of http operation |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
174 |
* @param aSignatureMethod The signature method to be used |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
175 |
* @param aParams A map of parameters to its values |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
176 |
* @param aMode The mode of creation of the request |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
177 |
* @param aPostData The data to be posted (for HTTP POST |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
178 |
* only, else it will be NULL) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
179 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
180 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
181 |
SmfPluginError createRequest( SmfPluginRequestData &aRequest, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
182 |
const QNetworkAccessManager::Operation aOperation, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
183 |
const SmfSignatureMethod aSignatureMethod, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
184 |
QMultiMap<QByteArray, QByteArray> &aParams, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
185 |
const SmfParsingMode aMode, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
186 |
QBuffer *aPostData ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
187 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
188 |
private: |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
189 |
MusicProviderBase *m_provider; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
190 |
SmfPluginUtil *m_util; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
191 |
}; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
192 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
193 |
// Class declaration |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
194 |
class MusicProviderBase : public QObject, public SmfProviderBase |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
195 |
{ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
196 |
Q_OBJECT |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
197 |
Q_INTERFACES( SmfProviderBase ) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
198 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
199 |
public: |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
200 |
virtual ~MusicProviderBase( ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
201 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
202 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
203 |
* Method to get the Localisable name of the service. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
204 |
* @return The Localisable name of the service. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
205 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
206 |
QString serviceName( ) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
207 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
208 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
209 |
* Method to get the Logo of the service |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
210 |
* @return The Logo of the service |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
211 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
212 |
QImage serviceIcon( ) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
213 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
214 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
215 |
* Method to get the Readable service description |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
216 |
* @return The Readable service description |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
217 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
218 |
QString description( ) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
219 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
220 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
221 |
* Method to get the Website of the service |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
222 |
* @return The Website of the service |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
223 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
224 |
QUrl serviceUrl( ) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
225 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
226 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
227 |
* Method to get the URL of the Application providing this service |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
228 |
* @return The URL of the Application providing this service |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
229 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
230 |
QUrl applicationUrl( ) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
231 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
232 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
233 |
* Method to get the Icon of the application |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
234 |
* @return The Icon of the application |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
235 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
236 |
QImage applicationIcon( ) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
237 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
238 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
239 |
* Method to get the list of interfaces that this provider support |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
240 |
* @return List of supported Interafces |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
241 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
242 |
QList<QString> supportedInterfaces( ) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
243 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
244 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
245 |
* Method to get the list of languages supported by this service provider |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
246 |
* @return a QStringList of languages supported by this service |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
247 |
* provider in 2 letter ISO 639-1 format. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
248 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
249 |
QStringList supportedLanguages( ) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
250 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
251 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
252 |
* Method to get the Plugin specific ID |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
253 |
* @return The Plugin specific ID |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
254 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
255 |
QString pluginId( ) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
256 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
257 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
258 |
* Method to get the ID of the authentication application |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
259 |
* for this service |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
260 |
* @param aProgram The authentication application name |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
261 |
* @param aArguments List of arguments required for authentication app |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
262 |
* @param aMode Strting mode for authentication application |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
263 |
* @return The ID of the authentication application |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
264 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
265 |
QString authenticationApp( QString &aProgram, QStringList & aArguments, |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
266 |
QIODevice::OpenModeFlag aMode = QIODevice::ReadWrite ) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
267 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
268 |
/** |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
269 |
* Method to get the unique registration ID provided by the |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
270 |
* Smf for authorised plugins |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
271 |
* @return The unique registration ID/token provided by the Smf for |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
272 |
* authorised plugins |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
273 |
*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
274 |
QString smfRegistrationId( ) const; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
275 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
276 |
private: |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
277 |
friend class MusicEventPlugin; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
278 |
void initialize(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
279 |
QString m_serviceName; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
280 |
QImage m_serviceIcon; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
281 |
QString m_description; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
282 |
QUrl m_serviceUrl; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
283 |
QUrl m_applicationUrl; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
284 |
QImage m_applicationIcon; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
285 |
QStringList m_serviceType; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
286 |
QStringList m_supportedLanguages; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
287 |
QString m_pluginId; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
288 |
QString m_authAppId; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
289 |
QString m_smfRegToken; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
290 |
QDateTime m_validity; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
291 |
}; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
diff
changeset
|
292 |
#endif /* LASTFMMUSICEVENTPLUGIN_H_ */ |