|
1 /** |
|
2 * @file smfpostproviderplugin.h |
|
3 * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution |
|
4 * @version 1.0 |
|
5 * |
|
6 * @section LICENSE |
|
7 * |
|
8 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
|
9 * All rights reserved. |
|
10 * This component and the accompanying materials are made available |
|
11 * under the terms of the "{License}" |
|
12 * which accompanies this distribution, and is available |
|
13 * at the URL "{LicenseUrl}". |
|
14 * |
|
15 * @section DESCRIPTION |
|
16 * |
|
17 * Interface specification for getting/posting updates to a social site |
|
18 */ |
|
19 |
|
20 #ifndef SMFPOSTPROVIDERPLUGIN_H_ |
|
21 #define SMFPOSTPROVIDERPLUGIN_H_ |
|
22 |
|
23 #include <smfproviderbase.h> |
|
24 #include <smfcontact.h> |
|
25 #include <smfpost.h> |
|
26 #include <smfstatusdata.h> |
|
27 |
|
28 |
|
29 /** |
|
30 * SmfPresenceInfo. |
|
31 * Indicates the presence information of user like Online, Offline, Busy, |
|
32 * Do no disturb, Appear Offline etc. |
|
33 */ |
|
34 enum SmfPresenceInfo |
|
35 { |
|
36 ENotSupported, |
|
37 EOnline, |
|
38 EOffline, |
|
39 EBusy, |
|
40 EDoNotDisturb, |
|
41 EAppearOffline, |
|
42 EOther |
|
43 }; |
|
44 |
|
45 /** |
|
46 * Interface to get/update the posts to a service provider. This class |
|
47 * provides basic functionality to allow applications to obtain list of |
|
48 * posts, updates posts or change the presence information to a social |
|
49 * networking service. |
|
50 * |
|
51 * All of the functionality described here should be implemented by a service |
|
52 * specific plug-in. |
|
53 */ |
|
54 class SmfPostProviderPlugin : public QObject |
|
55 { |
|
56 Q_OBJECT |
|
57 public: |
|
58 /** |
|
59 * Constructor with default argument |
|
60 * @param aParent The parent object |
|
61 */ |
|
62 SmfPostProviderPlugin( QObject* aParent = 0 ); |
|
63 |
|
64 /** |
|
65 * Destructor |
|
66 */ |
|
67 ~SmfPostProviderPlugin( ); |
|
68 |
|
69 /** |
|
70 * Method to get the provider information |
|
71 * @return Instance of SmfProviderBase |
|
72 */ |
|
73 virtual SmfProviderBase* getProviderInfo( ) = 0; |
|
74 |
|
75 /** |
|
76 * Method to get the latest posts |
|
77 * @param aStatusData |
|
78 * @param aRequest [out] The request data to be sent to network |
|
79 * @param aPageNum The page to be extracted |
|
80 * @param aItemsPerPage Number of items per page |
|
81 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
82 */ |
|
83 virtual SmfPluginError getPosts( const SmfStatusData aStatusData, |
|
84 SmfPluginRequestData *aRequest, |
|
85 const int aPageNum = 0, |
|
86 const int aItemsPerPage = 10 ) = 0; |
|
87 |
|
88 /** |
|
89 * Method to update a post |
|
90 * @param aPostData The post data to be posted |
|
91 * @param aLocation The location |
|
92 * @param aRequest [out] The request data to be sent to network |
|
93 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
94 */ |
|
95 virtual SmfPluginError updatePost( const SmfPost aPostData, |
|
96 const QtMobility::QContactGeolocation aLocation, |
|
97 SmfPluginRequestData *aRequest ) = 0; |
|
98 |
|
99 /** |
|
100 * Method to update a post to a particular contact |
|
101 * @param aPostData The post data to be posted |
|
102 * @param aContact The contact where the data has to be posted |
|
103 * @param aLocation The location |
|
104 * @param aRequest [out] The request data to be sent to network |
|
105 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
106 */ |
|
107 virtual SmfPluginError updatePostDirected( const SmfPost aPostData, |
|
108 const SmfContact aContact, |
|
109 const QtMobility::QContactGeolocation aLocation, |
|
110 SmfPluginRequestData *aRequest ) = 0; |
|
111 /** |
|
112 * Method to update the presence information of the user |
|
113 * @param aAppearence The appearence information |
|
114 * @param aRequest [out] The request data to be sent to network |
|
115 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
116 */ |
|
117 virtual SmfPluginError postAppearence( const SmfPresenceInfo aAppearence, |
|
118 SmfPluginRequestData *aRequest ) = 0; |
|
119 |
|
120 /** |
|
121 * Method to get the result for a network request. |
|
122 * @param aTransportResult The result of transport operation |
|
123 * @param aReply The QNetworkReply instance for the request |
|
124 * @param aResult [out] An output parameter to the plugin manager.If the |
|
125 * return value is SmfSendRequestAgain, QVariant will be of type |
|
126 * SmfPluginRequestData. |
|
127 * If last operation was getPosts(), aResult will be of type QList<SmfPost> |
|
128 * If last operation was updatePost() or updatePostDirected() or |
|
129 * postAppearence, aResult will be of type bool |
|
130 * @param aRetType [out] SmfPluginRetType |
|
131 * @param aIsLastPage [out] true if this the last page, else false |
|
132 * @return SmfPluginError |
|
133 */ |
|
134 virtual SmfPluginError responseAvailable( |
|
135 const SmfTransportResult aTransportResult, |
|
136 QNetworkReply *aReply, |
|
137 QVariant* aResult, |
|
138 SmfPluginRetType aRetType, |
|
139 bool aIsLastPage) = 0; |
|
140 |
|
141 }; |
|
142 |
|
143 Q_DECLARE_INTERFACE( SmfPostProviderPlugin, "org.symbian.smf.plugin.contact.posts/v1.0" ); |
|
144 |
|
145 #endif /* SMFPOSTPROVIDERPLUGIN_H_ */ |