example/clientapi/smf/inc/smfplugins/smfcontacts/smfcontactfetcherplugin.h
changeset 1 4b1e636e8a71
child 2 86af6c333601
equal deleted inserted replaced
0:5d2360e70d9f 1:4b1e636e8a71
       
     1 /**
       
     2  * @file	smfcontactfetcherplugin.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 fetching contacts
       
    18  */
       
    19 
       
    20 #ifndef SMFCONTACTFETCHERPLUGIN_H_
       
    21 #define SMFCONTACTFETCHERPLUGIN_H_
       
    22 
       
    23 #include <smfproviderbase.h>
       
    24 #include <smfcontact.h>
       
    25 #include <smfgroup.h>
       
    26 
       
    27 /**
       
    28  * Interface specification for fetching contacts. This class provides 
       
    29  * basic functionality to allow applications to obtain list of
       
    30  * friends, followers, groups of a user in a social networking service.
       
    31  *
       
    32  * All of the functionality described here should be implemented by a service
       
    33  * specific plug-in.
       
    34  */
       
    35 class SmfContactFetcherPlugin : public QObject
       
    36 	{
       
    37 	Q_OBJECT
       
    38 public:
       
    39 	/**
       
    40 	 * Constructor with default argument
       
    41 	 * @param aParent The parent object
       
    42 	 */
       
    43 	SmfContactFetcherPlugin( QObject* aParent = 0 );
       
    44 	
       
    45 	/**
       
    46 	 * Destructor
       
    47 	 */
       
    48 	~SmfContactFetcherPlugin( );
       
    49 	
       
    50 	/**
       
    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
       
    58 	 * @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
       
    62 	 * @param aItemsPerPage Number of items per page
       
    63 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    64 	 */
       
    65 	virtual SmfPluginError friends( SmfPluginRequestData *aRequest,
       
    66 			const SmfContact aContact = 0,
       
    67 			const int aPageNum = 0, 
       
    68 			const int aItemsPerPage = 10 ) = 0;
       
    69 	
       
    70 	/**
       
    71 	 * Method to get the list of followers
       
    72 	 * @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
       
    76 	 * @param aItemsPerPage Number of items per page
       
    77 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    78 	 */
       
    79 	virtual SmfPluginError followers( SmfPluginRequestData *aRequest,
       
    80 			const SmfContact aContact = 0, 
       
    81 			const int aPageNum = 0, 
       
    82 			const int aItemsPerPage = 10 ) = 0;
       
    83 	
       
    84 	/**
       
    85 	 * Method to search for a contact
       
    86 	 * @param aContact contact to be searched
       
    87 	 * @param aRequest [out] The request data to be sent to network
       
    88 	 * @param aPageNum The page to be extracted
       
    89 	 * @param aItemsPerPage Number of items per page
       
    90 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    91 	 */
       
    92 	virtual SmfPluginError search( const SmfContact &aContact,
       
    93 			SmfPluginRequestData *aRequest,
       
    94 			const int aPageNum = 0, 
       
    95 			const int aItemsPerPage = 10) = 0;
       
    96 	
       
    97 	/**
       
    98 	 * Method to get the list of groups
       
    99 	 * @param aRequest [out] The request data to be sent to network
       
   100 	 * @param aContact to search for groups of a friend, for self 
       
   101 	 * group this parameter need not be included
       
   102 	 * @param aPageNum The page to be extracted
       
   103 	 * @param aItemsPerPage Number of items per page
       
   104 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
   105 	 */
       
   106 	virtual SmfPluginError groups( SmfPluginRequestData *aRequest,
       
   107 			const SmfContact aContact = 0, 
       
   108 			const int aPageNum = 0, 
       
   109 			const int aItemsPerPage = 10 ) = 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 	
       
   146 	};
       
   147 
       
   148 Q_DECLARE_INTERFACE( SmfContactFetcherPlugin, "org.symbian.smf.plugin.contact.fetcher/v1.0" );
       
   149 
       
   150 #endif /* SMFCONTACTFETCHERPLUGIN_H_ */