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 * Interface specification for plugins that implement gallery related services |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef SMFGALLERYPLUGIN_H_ |
|
21 #define SMFGALLERYPLUGIN_H_ |
|
22 |
|
23 #include <smfpluginbase.h> |
|
24 #include <smfpicture.h> |
|
25 #include <smfcomment.h> |
|
26 |
|
27 // Forward declaration |
|
28 class SmfPluginUtil; |
|
29 |
|
30 /** |
|
31 * @ingroup smf_plugin_group |
|
32 * Interface specification for plugins that implement gallery related services |
|
33 * like getting pictures, their description, uploading, posting comments |
|
34 * on pictures etc |
|
35 * |
|
36 * All of the functionality described here should be implemented by a service |
|
37 * specific plug-in. |
|
38 * |
|
39 * A sample call flow between SmfPluginMgr and SmfGalleryPlugin is shown here |
|
40 * |
|
41 * @msc |
|
42 hscale = "2"; |
|
43 SmfServer,SmfTransportMgr,SmfPluginMgr,SmfGalleryPlugin; |
|
44 ...; |
|
45 SmfPluginMgr=>SmfTransportMgr [ label = "connect(SIGNAL(finished()), SLOT(replyFinished()))" ] ; |
|
46 ...; |
|
47 SmfServer=> SmfPluginMgr[ label = "loadAndCheckPlugin()" ] ; |
|
48 SmfPluginMgr=>SmfPluginMgr [ label = "SmfGalleryPlugin smfglpl= load()" ] ; |
|
49 SmfPluginMgr=>SmfGalleryPlugin [ label = "QNetworkRequest req = smfglpl.pictures()" ] ; |
|
50 SmfPluginMgr=>SmfTransportMgr [ label = "nwmgr.get( req )" ] ; |
|
51 ...; |
|
52 SmfTransportMgr=>SmfPluginMgr [ label = "replyFinished( reply )" ] ; |
|
53 SmfPluginMgr=>SmfGalleryPlugin [ label = "status = responseAvailable( reply, &data )" ] ; |
|
54 SmfPluginMgr=>SmfServer [ label = "if(status ==complete) dataStream << data;" ] ; |
|
55 @endmsc |
|
56 * |
|
57 */ |
|
58 class SmfGalleryPlugin : public SmfPluginBase |
|
59 { |
|
60 public: |
|
61 /** |
|
62 * Constructor with default argument |
|
63 * @param aUtil The SmfPluginUtil instance. The plugins can |
|
64 * call the method getAuthKeys() of this class, with its pluginID to |
|
65 * get the OAuth keys, keys are returned only if this plugin is |
|
66 * authorised by Smf franework |
|
67 */ |
|
68 SmfGalleryPlugin( SmfPluginUtil *aUtil ); |
|
69 |
|
70 /** |
|
71 * Destructor |
|
72 */ |
|
73 ~SmfGalleryPlugin( ); |
|
74 |
|
75 /** |
|
76 * Method to get a list of pictures |
|
77 * @param aRequest [out] The request data to be sent to network |
|
78 * @param aPageNum The page to be extracted |
|
79 * @param aItemsPerPage Number of items per page |
|
80 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
81 */ |
|
82 virtual SmfPluginError pictures( SmfPluginRequestData &aRequest, |
|
83 const int aPageNum = SMF_FIRST_PAGE, |
|
84 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
|
85 |
|
86 /** |
|
87 * Method to get a description |
|
88 * @param aRequest [out] The request data to be sent to network |
|
89 * @param aImage The image abot which the description is required |
|
90 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
91 */ |
|
92 virtual SmfPluginError description( SmfPluginRequestData &aRequest, |
|
93 const SmfPicture &aImage ) = 0; |
|
94 |
|
95 /** |
|
96 * Method to upload a picture |
|
97 * @param aRequest [out] The request data to be sent to network |
|
98 * @param aImage The image to be uploaded |
|
99 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
100 */ |
|
101 virtual SmfPluginError upload( SmfPluginRequestData &aRequest, |
|
102 const SmfPicture &aImage ) = 0; |
|
103 |
|
104 /** |
|
105 * Method to upload a list of pictures |
|
106 * @param aRequest [out] The request data to be sent to network |
|
107 * @param aImages The list of images to be uploaded |
|
108 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
109 */ |
|
110 virtual SmfPluginError upload( SmfPluginRequestData &aRequest, |
|
111 const QList<SmfPicture> &aImages ) = 0; |
|
112 |
|
113 /** |
|
114 * Method to post comment on a picture is available |
|
115 * @param aRequest [out] The request data to be sent to network |
|
116 * @param aImage The image on which comment is to be posted |
|
117 * @param aComment The comment to be posted |
|
118 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
119 */ |
|
120 virtual SmfPluginError postComment( SmfPluginRequestData &aRequest, |
|
121 const SmfPicture &aImage, |
|
122 const SmfComment &aComment ) = 0; |
|
123 |
|
124 }; |
|
125 |
|
126 Q_DECLARE_INTERFACE( SmfGalleryPlugin, "org.symbian.smf.plugin.gallery/v1.0" ); |
|
127 |
|
128 #endif /* SMFGALLERYPLUGIN_H_ */ |
|