example/clientapi/smf/smffcontactfetcher.h
changeset 1 4b1e636e8a71
parent 0 5d2360e70d9f
child 2 86af6c333601
equal deleted inserted replaced
0:5d2360e70d9f 1:4b1e636e8a71
     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 "{License}"
       
     6 * which accompanies  this distribution, and is available
       
     7 * at the URL "{LicenseUrl}".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Interface spefication for list of contacts from a site
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef SMFCONTACTHETCHER_H
       
    20 #define SMFCONTACTHETCHER_H
       
    21 
       
    22 class SmfProvider; //base-class for service provider
       
    23 class SmfContact; //class for Contact in a social network
       
    24 class SmfGroup; //class for a group in social network
       
    25 
       
    26 
       
    27 /**
       
    28  * Interface to search for contacts/connections from a service provider. This class
       
    29  * provides basic functionality to allow applications to obtain list of
       
    30  * contacts or friends in a social networking service.
       
    31  *
       
    32  * Note that branding information for the particular service implementation
       
    33  * is available from base-class functions. See also:
       
    34  * SmfProvider::serviceName(), SmfProvider::serviceIcon(), SmfProvider::description()
       
    35  *
       
    36  * All of the functionality described here should be implemented by a service
       
    37  * specific plug-in object.
       
    38  */
       
    39 class SmfContactFetcher : public SmfProvider
       
    40 {
       
    41   Q_OBJECT;
       
    42 
       
    43 public:
       
    44   // Seeing as this is a plug-in implementation, these will realistically
       
    45   // be generated by SMF factory of some kind
       
    46   SmfContactFetcher(QObject* parent = 0);
       
    47   ~SmfContactFetcher();
       
    48 
       
    49 public:
       
    50   // Get the friend listing - might be made asynchrnous later
       
    51   virtual QList<SmfContact> friends() = 0; // list of contact objects
       
    52   virtual QList<SmfContact> followers() = 0; // list of contact objects
       
    53   virtual QList<SmfContact> search(SmfContact) = 0; // list of contact objects
       
    54   virtual QList<SmfGroup>   groups() = 0; // list of group objects
       
    55   virtual QList<SmfContact> searchInGroup(SmfGroup) = 0; // list of contact objects
       
    56 
       
    57   virtual SmfContactModel   model() = 0; // maybe we can make a QItemModel-derived model?
       
    58 
       
    59 
       
    60 slots:
       
    61 
       
    62 signals:
       
    63   // Notification of remote changes to the contactlist,
       
    64   // probably should be done through model
       
    65   virtual void friendsChanged() = 0;
       
    66   virtual void followersChanged() = 0;
       
    67   virtual void groupChanged() = 0;
       
    68 };
       
    69 
       
    70 
       
    71 
       
    72 #endif // SMFCONTACTHETCHER_H