6 * @section LICENSE |
6 * @section LICENSE |
7 * |
7 * |
8 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
8 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
9 * All rights reserved. |
9 * All rights reserved. |
10 * This component and the accompanying materials are made available |
10 * This component and the accompanying materials are made available |
11 * under the terms of the "{License}" |
11 * under the terms of the "Eclipse Public License v1.0" |
12 * which accompanies this distribution, and is available |
12 * which accompanies this distribution, and is available |
13 * at the URL "{LicenseUrl}". |
13 * at the URL "http://www.eclipse.org/legal/epl-v10.html" |
14 * |
14 * |
15 * @section DESCRIPTION |
15 * @section DESCRIPTION |
16 * |
16 * |
17 * Interface specification for fetching contacts |
17 * Interface specification for fetching contacts |
18 */ |
18 */ |
19 |
19 |
20 #ifndef SMFCONTACTFETCHERPLUGIN_H_ |
20 #ifndef SMFCONTACTFETCHERPLUGIN_H_ |
21 #define SMFCONTACTFETCHERPLUGIN_H_ |
21 #define SMFCONTACTFETCHERPLUGIN_H_ |
22 |
22 |
23 #include <smfproviderbase.h> |
23 #include <smfpluginbase.h> |
24 #include <smfcontact.h> |
24 #include <smfcontact.h> |
25 #include <smfgroup.h> |
25 #include <smfgroup.h> |
|
26 #include <smfplace.h> |
26 |
27 |
27 /** |
28 /** |
|
29 * @ingroup smf_plugin_group |
28 * Interface specification for fetching contacts. This class provides |
30 * Interface specification for fetching contacts. This class provides |
29 * basic functionality to allow applications to obtain list of |
31 * basic functionality to allow applications to obtain list of |
30 * friends, followers, groups of a user in a social networking service. |
32 * friends, followers, groups of a user in a social networking service. |
31 * |
33 * |
32 * All of the functionality described here should be implemented by a service |
34 * All of the functionality described here should be implemented by a service |
33 * specific plug-in. |
35 * specific plug-in. |
34 */ |
36 */ |
35 class SmfContactFetcherPlugin : public QObject |
37 class SmfContactFetcherPlugin : public SmfPluginBase |
36 { |
38 { |
37 Q_OBJECT |
39 Q_OBJECT |
38 public: |
40 public: |
39 /** |
41 /** |
40 * Constructor with default argument |
42 * Constructor with default argument |
46 * Destructor |
48 * Destructor |
47 */ |
49 */ |
48 ~SmfContactFetcherPlugin( ); |
50 ~SmfContactFetcherPlugin( ); |
49 |
51 |
50 /** |
52 /** |
51 * Method to get the provider information |
|
52 * @return Instance of SmfProviderBase |
|
53 */ |
|
54 virtual SmfProviderBase* getProviderInfo( ) = 0; |
|
55 |
|
56 /** |
|
57 * Method to get the list of friends |
53 * Method to get the list of friends |
58 * @param aRequest [out] The request data to be sent to network |
54 * @param aRequest [out] The request data to be sent to network |
59 * @param aContact to search for friend of a friend, |
|
60 * for self friend this parameter need not be included |
|
61 * @param aPageNum The page to be extracted |
55 * @param aPageNum The page to be extracted |
62 * @param aItemsPerPage Number of items per page |
56 * @param aItemsPerPage Number of items per page |
63 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
57 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
64 */ |
58 */ |
65 virtual SmfPluginError friends( SmfPluginRequestData *aRequest, |
59 virtual SmfPluginError friends( SmfPluginRequestData *aRequest, |
66 const SmfContact aContact = 0, |
60 const int aPageNum = SMF_FIRST_PAGE, |
67 const int aPageNum = 0, |
61 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
68 const int aItemsPerPage = 10 ) = 0; |
|
69 |
62 |
70 /** |
63 /** |
71 * Method to get the list of followers |
64 * Method to get the list of followers |
72 * @param aRequest [out] The request data to be sent to network |
65 * @param aRequest [out] The request data to be sent to network |
73 * @param aContact to search for follower of a friend, for self |
|
74 * followers this parameter need not be included |
|
75 * @param aPageNum The page to be extracted |
66 * @param aPageNum The page to be extracted |
76 * @param aItemsPerPage Number of items per page |
67 * @param aItemsPerPage Number of items per page |
77 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
68 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
78 */ |
69 */ |
79 virtual SmfPluginError followers( SmfPluginRequestData *aRequest, |
70 virtual SmfPluginError followers( SmfPluginRequestData *aRequest, |
80 const SmfContact aContact = 0, |
71 const int aPageNum = SMF_FIRST_PAGE, |
81 const int aPageNum = 0, |
72 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
82 const int aItemsPerPage = 10 ) = 0; |
|
83 |
73 |
84 /** |
74 /** |
85 * Method to search for a contact |
75 * Method to search for a contact |
|
76 * @param aRequest [out] The request data to be sent to network |
86 * @param aContact contact to be searched |
77 * @param aContact contact to be searched |
|
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 search( SmfPluginRequestData *aRequest, |
|
83 const SmfContact *aContact, |
|
84 const int aPageNum = SMF_FIRST_PAGE, |
|
85 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
|
86 |
|
87 /** |
|
88 * Method to search for contacts (friends) who are near the user. |
|
89 * Proximity defines accuracy level |
|
90 * @param aRequest [out] The request data to be sent to network |
|
91 * @param aLocation The location search criteria |
|
92 * @param aProximity location search boundary |
|
93 * @param aPageNum The page to be extracted |
|
94 * @param aItemsPerPage Number of items per page |
|
95 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
96 */ |
|
97 virtual SmfPluginError searchNear( SmfPluginRequestData *aRequest, |
|
98 const SmfPlace* aLocation, |
|
99 const SmfLocationSearchBoundary aProximity, |
|
100 const int aPageNum = SMF_FIRST_PAGE, |
|
101 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
|
102 |
|
103 /** |
|
104 * Method to get the list of groups |
87 * @param aRequest [out] The request data to be sent to network |
105 * @param aRequest [out] The request data to be sent to network |
88 * @param aPageNum The page to be extracted |
106 * @param aPageNum The page to be extracted |
89 * @param aItemsPerPage Number of items per page |
107 * @param aItemsPerPage Number of items per page |
90 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
108 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
91 */ |
109 */ |
92 virtual SmfPluginError search( const SmfContact &aContact, |
110 virtual SmfPluginError groups( SmfPluginRequestData *aRequest, |
93 SmfPluginRequestData *aRequest, |
111 const int aPageNum = SMF_FIRST_PAGE, |
94 const int aPageNum = 0, |
112 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
95 const int aItemsPerPage = 10) = 0; |
|
96 |
113 |
97 /** |
114 /** |
98 * Method to get the list of groups |
115 * Method to search for a contact in a group |
99 * @param aRequest [out] The request data to be sent to network |
116 * @param aRequest [out] The request data to be sent to network |
100 * @param aContact to search for groups of a friend, for self |
117 * @param aGroup the group in which to search |
101 * group this parameter need not be included |
|
102 * @param aPageNum The page to be extracted |
118 * @param aPageNum The page to be extracted |
103 * @param aItemsPerPage Number of items per page |
119 * @param aItemsPerPage Number of items per page |
104 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
120 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
105 */ |
121 */ |
106 virtual SmfPluginError groups( SmfPluginRequestData *aRequest, |
122 virtual SmfPluginError searchInGroup( SmfPluginRequestData *aRequest, |
107 const SmfContact aContact = 0, |
123 const SmfGroup &aGroup, |
108 const int aPageNum = 0, |
124 const int aPageNum = SMF_FIRST_PAGE, |
109 const int aItemsPerPage = 10 ) = 0; |
125 const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; |
110 |
|
111 /** |
|
112 * Method to search for a contact in a group |
|
113 * @param aGroup the group in which to search |
|
114 * @param aRequest [out] The request data to be sent to network |
|
115 * @param aPageNum The page to be extracted |
|
116 * @param aItemsPerPage Number of items per page |
|
117 * @param aRequest [out] The request data to be sent to network |
|
118 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
|
119 */ |
|
120 virtual SmfPluginError searchInGroup( const SmfGroup &aGroup, |
|
121 SmfPluginRequestData *aRequest, |
|
122 const int aPageNum = 0, |
|
123 const int aItemsPerPage = 10 ) = 0; |
|
124 |
|
125 /** |
|
126 * Method to get the result for a network request. |
|
127 * @param aTransportResult The result of transport operation |
|
128 * @param aReply The QNetworkReply instance for the request |
|
129 * @param aResult [out] An output parameter to the plugin manager.If the |
|
130 * return value is SmfSendRequestAgain, QVariant will be of type |
|
131 * SmfPluginRequestData. |
|
132 * If last operation was friends() or followers() or search() or |
|
133 * searchInGroup(), aResult will be of type QList<SmfContact> |
|
134 * If last operation was groups(), aResult will be of type QList<SmfGroup> |
|
135 * @param aRetType [out] SmfPluginRetType |
|
136 * @param aIsLastPage [out] true if this the last page, else false |
|
137 * @return SmfPluginError |
|
138 */ |
|
139 virtual SmfPluginError responseAvailable( |
|
140 const SmfTransportResult aTransportResult, |
|
141 QNetworkReply *aReply, |
|
142 QVariant* aResult, |
|
143 SmfPluginRetType aRetType, |
|
144 bool aIsLastPage) = 0; |
|
145 |
126 |
146 }; |
127 }; |
147 |
128 |
148 Q_DECLARE_INTERFACE( SmfContactFetcherPlugin, "org.symbian.smf.plugin.contact.fetcher/v1.0" ); |
129 Q_DECLARE_INTERFACE( SmfContactFetcherPlugin, "org.symbian.smf.plugin.contact.fetcher/v1.0" ); |
149 |
130 |