diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/smfcontacts/smfcontactfetcherplugin.h --- a/example/clientapi/smf/inc/smfplugins/smfcontacts/smfcontactfetcherplugin.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfplugins/smfcontacts/smfcontactfetcherplugin.h Tue Apr 06 16:35:37 2010 +0530 @@ -8,9 +8,9 @@ * Copyright (c) 2010 Sasken Communication Technologies Ltd. * All rights reserved. * This component and the accompanying materials are made available - * under the terms of the "{License}" + * under the terms of the "Eclipse Public License v1.0" * which accompanies this distribution, and is available - * at the URL "{LicenseUrl}". + * at the URL "http://www.eclipse.org/legal/epl-v10.html" * * @section DESCRIPTION * @@ -20,11 +20,13 @@ #ifndef SMFCONTACTFETCHERPLUGIN_H_ #define SMFCONTACTFETCHERPLUGIN_H_ -#include +#include #include #include +#include /** + * @ingroup smf_plugin_group * Interface specification for fetching contacts. This class provides * basic functionality to allow applications to obtain list of * friends, followers, groups of a user in a social networking service. @@ -32,7 +34,7 @@ * All of the functionality described here should be implemented by a service * specific plug-in. */ -class SmfContactFetcherPlugin : public QObject +class SmfContactFetcherPlugin : public SmfPluginBase { Q_OBJECT public: @@ -48,100 +50,79 @@ ~SmfContactFetcherPlugin( ); /** - * Method to get the provider information - * @return Instance of SmfProviderBase - */ - virtual SmfProviderBase* getProviderInfo( ) = 0; - - /** * Method to get the list of friends * @param aRequest [out] The request data to be sent to network - * @param aContact to search for friend of a friend, - * for self friend this parameter need not be included * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ virtual SmfPluginError friends( SmfPluginRequestData *aRequest, - const SmfContact aContact = 0, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to get the list of followers * @param aRequest [out] The request data to be sent to network - * @param aContact to search for follower of a friend, for self - * followers this parameter need not be included - * @param aPageNum The page to be extracted - * @param aItemsPerPage Number of items per page - * @return SmfPluginError Plugin error if any, else SmfPluginErrNone - */ - virtual SmfPluginError followers( SmfPluginRequestData *aRequest, - const SmfContact aContact = 0, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; - - /** - * Method to search for a contact - * @param aContact contact to be searched - * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError search( const SmfContact &aContact, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10) = 0; + virtual SmfPluginError followers( SmfPluginRequestData *aRequest, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; + + /** + * Method to search for a contact + * @param aRequest [out] The request data to be sent to network + * @param aContact contact to be searched + * @param aPageNum The page to be extracted + * @param aItemsPerPage Number of items per page + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + virtual SmfPluginError search( SmfPluginRequestData *aRequest, + const SmfContact *aContact, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; + + /** + * Method to search for contacts (friends) who are near the user. + * Proximity defines accuracy level + * @param aRequest [out] The request data to be sent to network + * @param aLocation The location search criteria + * @param aProximity location search boundary + * @param aPageNum The page to be extracted + * @param aItemsPerPage Number of items per page + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + virtual SmfPluginError searchNear( SmfPluginRequestData *aRequest, + const SmfPlace* aLocation, + const SmfLocationSearchBoundary aProximity, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to get the list of groups * @param aRequest [out] The request data to be sent to network - * @param aContact to search for groups of a friend, for self - * group this parameter need not be included * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ virtual SmfPluginError groups( SmfPluginRequestData *aRequest, - const SmfContact aContact = 0, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to search for a contact in a group + * @param aRequest [out] The request data to be sent to network * @param aGroup the group in which to search - * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError searchInGroup( const SmfGroup &aGroup, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; - - /** - * Method to get the result for a network request. - * @param aTransportResult The result of transport operation - * @param aReply The QNetworkReply instance for the request - * @param aResult [out] An output parameter to the plugin manager.If the - * return value is SmfSendRequestAgain, QVariant will be of type - * SmfPluginRequestData. - * If last operation was friends() or followers() or search() or - * searchInGroup(), aResult will be of type QList - * If last operation was groups(), aResult will be of type QList - * @param aRetType [out] SmfPluginRetType - * @param aIsLastPage [out] true if this the last page, else false - * @return SmfPluginError - */ - virtual SmfPluginError responseAvailable( - const SmfTransportResult aTransportResult, - QNetworkReply *aReply, - QVariant* aResult, - SmfPluginRetType aRetType, - bool aIsLastPage) = 0; + virtual SmfPluginError searchInGroup( SmfPluginRequestData *aRequest, + const SmfGroup &aGroup, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; };