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