|
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 * @section DESCRIPTION |
|
16 * |
|
17 * Interface specification for getting/posting updates to a social site |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef SMFPOSTPROVIDERPLUGIN_H_ |
|
23 #define SMFPOSTPROVIDERPLUGIN_H_ |
|
24 |
|
25 #include <smfpluginbase.h> |
|
26 #include <smfcontact.h> |
|
27 #include <smfpost.h> |
|
28 #include <smfplace.h> |
|
29 |
|
30 // Forward declaration |
|
31 class SmfPluginManagerUtil; |
|
32 |
|
33 /** |
|
34 * SmfPresenceInfo. |
|
35 * Indicates the presence information of user like Online, Offline, Busy, |
|
36 * Do no disturb, Appear Offline etc. |
|
37 */ |
|
38 enum SmfPresenceInfo |
|
39 { |
|
40 ENotSupported, |
|
41 EOnline, |
|
42 EOffline, |
|
43 EBusy, |
|
44 EDoNotDisturb, |
|
45 EAppearOffline, |
|
46 EOther |
|
47 }; |
|
48 |
|
49 /** |
|
50 * @ingroup smf_plugin_group |
|
51 * Interface to get/update the posts to a service provider. This class |
|
52 * provides basic functionality to allow applications to obtain list of |
|
53 * posts, updates posts or change the presence information to a social |
|
54 * networking service. |
|
55 * |
|
56 * All of the functionality described here should be implemented by a service |
|
57 * specific plug-in. |
|
58 */ |
|
59 class SmfPostProviderPlugin : public SmfPluginBase |
|
60 { |
|
61 Q_OBJECT |
|
62 public: |
|
63 /** |
|
64 * Constructor with default argument |
|
65 * @param aUtil The SmfPluginManagerUtil instance. The plugins can |
|
66 * call the method getAuthKeys() of this class, with its pluginID to |
|
67 * get the OAuth keys, keys are returned only if this plugin is |
|
68 * authorised by Smf franework |
|
69 */ |
|
70 SmfPostProviderPlugin( SmfPluginManagerUtil* aUtil ); |
|
71 |
|
72 /** |
|
73 * Destructor |
|
74 */ |
|
75 ~SmfPostProviderPlugin( ); |
|
76 |
|
77 /** |
|
78 * Method that returns maximum no of chars (unicode) that service |
|
79 * provider can post without truncation. Negative value means |
|
80 * no limit |
|
81 * @return Max characters that can be posted without truncation |
|
82 */ |
|
83 virtual qint32 maxCharsInPost( ) const = 0; |
|
84 /** |
|
85 * Method that returns maximum no of items that can be returned |
|
86 * in a single query to getPosts. Negative value means feature |
|
87 * not supported. |
|
88 * @return Max items that can be returned in a single query |
|
89 */ |
|
90 virtual qint32 maxItems( ) const = 0; |
|
91 |
|
92 /** |
|
93 * <Method that returns all the formatting of posts that this |
|
94 * service provider supports. May return 0 items to mean |
|
95 * only QString is supported. |
|
96 * @return Supported formats of posts |
|
97 */ |
|
98 virtual QVector<QTextFormat> supportedFormats ( ) const = 0; |
|
99 |
|
100 /** |
|
101 * Method that returns whether this SP supports Appearence |
|
102 * @return Returns true if Appearance is supported, else false. |
|
103 * @see SmfAppearenceInfo |
|
104 */ |
|
105 virtual bool supportsAppearence ( ) const = 0; |
|
106 |
|
107 /** |
|
108 * Method to get the latest posts |
|
109 * @param aRequest [out] The request data to be sent to network |
|
110 * @param aUser The user's contact in this SP, omit for self contact |
|
111 * @param aPageNum The page to be extracted |
|
112 * @param aItemsPerPage Number of items per page |
|
113 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
114 */ |
|
115 virtual SmfPluginError retrieve( SmfPluginRequestData &aRequest, |
|
116 const SmfContact &aUser = 0, |
|
117 const int aPageNum = SMF_FIRST_PAGE, |
|
118 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
|
119 |
|
120 |
|
121 /** |
|
122 * Method to update a post to own area. |
|
123 * @param aRequest [out] The request data to be sent to network |
|
124 * @param aPostData The post data to be posted |
|
125 * @param aLocation The location |
|
126 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
127 */ |
|
128 virtual SmfPluginError post( SmfPluginRequestData &aRequest, |
|
129 const SmfPost &aPostData, |
|
130 const SmfPlace &aLocation ) = 0; |
|
131 |
|
132 /** |
|
133 * Method to update the last post to own area with new data |
|
134 * @param aRequest [out] The request data to be sent to network |
|
135 * @param aPostData The edited/new data to be posted |
|
136 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
137 */ |
|
138 virtual SmfPluginError updatePost( SmfPluginRequestData &aRequest, |
|
139 const SmfPost &aPostData ) = 0; |
|
140 |
|
141 /** |
|
142 * Method to update a post to a particular contact |
|
143 * @param aRequest [out] The request data to be sent to network |
|
144 * @param aPostData The post data to be posted |
|
145 * @param aContact The contact where the data has to be posted |
|
146 * @param aLocation The location |
|
147 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
148 */ |
|
149 virtual SmfPluginError postDirected( SmfPluginRequestData &aRequest, |
|
150 const SmfPost &aPostData, |
|
151 const SmfContact &aContact, |
|
152 const SmfPlace &aLocation = NULL ) = 0; |
|
153 |
|
154 |
|
155 /** |
|
156 * Method to post a comment on a post. |
|
157 * @param aRequest [out] The request data to be sent to network |
|
158 * @param aTarget Post on which comment has to be posted |
|
159 * @param aComment comment to be posted |
|
160 * @param aLocation location data |
|
161 */ |
|
162 virtual SmfPluginError commentOnAPost(SmfPluginRequestData &aRequest, |
|
163 const SmfPost& aTarget, |
|
164 const SmfPost& aComment, |
|
165 const SmfPlace &aLocation = NULL); |
|
166 |
|
167 /** |
|
168 * Method to update the presence information of the user |
|
169 * @param aRequest [out] The request data to be sent to network |
|
170 * @param aAppearence The appearence information |
|
171 * @param aStatus The status string |
|
172 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
173 */ |
|
174 virtual SmfPluginError postAppearence( SmfPluginRequestData &aRequest, |
|
175 const SmfPresenceInfo &aAppearence, |
|
176 const QString &aStatus ) = 0; |
|
177 |
|
178 /** |
|
179 * Share /a contact's post to user's friends and followers |
|
180 * (e.g. retweet in twitter, share on facebook) |
|
181 * @param aRequest [out] The request data to be sent to network |
|
182 * @param aPostData data to be posted |
|
183 * @param aContact contact to which the post belonged |
|
184 * @param aEdited whether user changed items within the post |
|
185 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
186 */ |
|
187 virtual SmfPluginError sharePost( SmfPluginRequestData &aRequest, |
|
188 const SmfPost& aPostData, |
|
189 const SmfContact& aContact, |
|
190 const bool &aEdited); |
|
191 |
|
192 |
|
193 }; |
|
194 |
|
195 Q_DECLARE_INTERFACE( SmfPostProviderPlugin, "org.symbian.smf.plugin.contact.posts/v1.0" ); |
|
196 |
|
197 #endif /* SMFPOSTPROVIDERPLUGIN_H_ */ |