1 /** |
|
2 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html" |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * Manasij Roy, Nalina Hariharan |
|
14 * |
|
15 * Description: |
|
16 * The SmfPluginBase class is the base class for all plugins. |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef SMFPLUGINBASE_H_ |
|
21 #define SMFPLUGINBASE_H_ |
|
22 |
|
23 #include <smfproviderbase.h> |
|
24 #include <smfglobal.h> |
|
25 |
|
26 class SmfPluginUtil; |
|
27 |
|
28 /** |
|
29 * @ingroup smf_plugin_group |
|
30 * The SmfPluginBase class is the base class for all plugins |
|
31 */ |
|
32 class SmfPluginBase |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Destructor |
|
37 */ |
|
38 virtual ~SmfPluginBase( ) {} |
|
39 |
|
40 /** |
|
41 * The first method to be called in the plugin that implements this interface. |
|
42 * If this method is not called, plugin may not behave as expected. |
|
43 * Plugins are expected to save the aUtil handle and use as and when required. |
|
44 * @param aUtil The instance of SmfPluginUtil |
|
45 */ |
|
46 virtual void initialize( SmfPluginUtil *aUtil ) = 0; |
|
47 |
|
48 /** |
|
49 * Method to get the provider information |
|
50 * @return Instance of SmfProviderBase |
|
51 */ |
|
52 virtual SmfProviderBase* getProviderInfo( ) = 0; |
|
53 |
|
54 /** |
|
55 * Method to get the result for a network request. |
|
56 * @param aTransportResult The result of transport operation |
|
57 * @param aReply The QByteArray instance containing the network response. |
|
58 * The plugins should delete this instance once they have read the |
|
59 * data from it. |
|
60 * @param aResult [out] An output parameter to the plugin manager.If the |
|
61 * return value is SmfSendRequestAgain, QVariant will be of type |
|
62 * SmfPluginRequestData. |
|
63 * |
|
64 * For SmfContactFetcherPlugin: If last operation was friends() or followers() |
|
65 * or search() or searchInGroup() or searchNear(), aResult will be of type |
|
66 * QList<SmfContact>. If last operation was groups(), aResult will be of |
|
67 * type QList<SmfGroup> |
|
68 * For SmfPostProviderPlugin: If last operation was retrieve(), aResult will be |
|
69 * of type QList<SmfPost>. If last operation was post() or updatePost() or |
|
70 * postDirected() or commentOnAPost() or postAppearence() or sharePost(), |
|
71 * aResult will be of type bool |
|
72 * For SmfLyricsServicePlugin: If last operation was lyrics(), aResult will |
|
73 * be of type QList<SmfLyrics>. If last operation was subtitles(), aResult will |
|
74 * be of type QList<SmfSubtitle>. |
|
75 * For SmfMusicEventsPlugin: If last operation was events(), aResult will |
|
76 * be of type QList<SmfEvent>. If last operation was venues(), aResult |
|
77 * will be of type QList<SmfLocation>. If last operation was postEvents(), |
|
78 * aResult will be of type bool |
|
79 * For SmfMusicSearchPlugin: If last operation was recommendations() or |
|
80 * tracks() or trackInfo(), aResult will be of type QList<SmfTrackInfo>. |
|
81 * If last operation was stores(), aResult will be of type |
|
82 * QList<SmfProvider>. If last operation was postCurrentPlaying(), |
|
83 * aResult will be of type bool. |
|
84 * For SmfMusicServicePlugin: If last operation was userInfo(), aResult |
|
85 * will be of type SmfMusicProfile. If last operation was searchUser(), |
|
86 * aResult will be of type QList<SmfMusicProfile>. |
|
87 * For SmfPlaylistServicePlugin: If last operation was playlists() or |
|
88 * playlistsOf(), aResult will be of type QList<SmfPlaylist>. If last |
|
89 * operation was addToPlaylist() or postCurrentPlayingPlaylist(), |
|
90 * aResult will be of type bool. |
|
91 * For SmfGalleryPlugin: If last operation was pictures(), aResult will |
|
92 * be of type QList<SmfPicture>. If last operation was description(), |
|
93 * aResult will be of type QString. If last operation was upload() or |
|
94 * postComment(), aResult will be of type bool. |
|
95 * |
|
96 * @param aRetType [out] SmfPluginRetType |
|
97 * @param aPageResult [out] The SmfResultPage structure variable |
|
98 */ |
|
99 virtual SmfPluginError responseAvailable( |
|
100 const SmfTransportResult &aTransportResult, |
|
101 QByteArray *aReply, |
|
102 QVariant* aResult, |
|
103 SmfPluginRetType &aRetType, |
|
104 SmfResultPage &aPageResult ) = 0; |
|
105 |
|
106 }; |
|
107 |
|
108 Q_DECLARE_INTERFACE( SmfPluginBase, "org.symbian.smf.plugin.smfpluginbase/v1.0" ); |
|
109 |
|
110 #endif /* SMFPLUGINBASE_H_ */ |
|