example/clientapi/smf/smfpostprovider.h
author cgandhi <chandradeep.gandhi@sasken.com>
Tue, 02 Mar 2010 16:24:32 +0530
changeset 0 5d2360e70d9f
permissions -rw-r--r--
Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp

/*
* 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}"
* which accompanies  this distribution, and is available
* at the URL "{LicenseUrl}".
*
* Initial Contributors:
* Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
*
* Contributors:
*
* Description:
* Interface spefication for posting updates to a social site
*
*/
#ifndef SMFPOSTPROVIDER_H
#define SMFPOSTPROVIDER_H

class SmfProvider; //base-class for service provider
class SmfContact; //class for Contact in a social network
class SmfLocationInfo; //class for geo location
class SmfPost; //class for information (text, image and url) contained in post in social network

/**
 * Interface to search for contacts/connections from a service provider. This class
 * provides basic functionality to allow applications to obtain list of
 * contacts or friends in a social networking service.
 *
 * Note that branding information for the particular service implementation
 * is available from base-class functions. See also:
 * SmfProvider::serviceName(), SmfProvider::serviceIcon(), SmfProvider::description()
 *
 * All of the functionality described here should be implemented by a service
 * specific plug-in object.
 */
class SmfPostProvider : public SmfProvider
{
  Q_OBJECT;

public:
  // Seeing as this is a plug-in implementation, these will realistically
  // be generated by SMF factory of some kind
  SmfPostProvider(QObject* parent = 0);
  ~SmfPostProvider();

public:
  // Get the friend listing - might be made asynchrnous later
  virtual QList<SmfPost> getPosts(SmfStatusData statusData) = 0; // list of contact objects
  virtual SmfContactModel   model() = 0; // maybe we can make a QItemModel-derived model?


slots:
  virtual void updatePost(SmfPost postData,SmfLocationInfo location) = 0; // list of contact objects
  virtual void updatePostDirected(SmfPost postData,SmfContact contact,SmfLocationInfo location) = 0; // list of contact objects
  virtual QList<SmfContact> postAppearence(SmfPresenceInfo appearence) = 0; // appear offline, busy, do-not-disturb

signals:
  // Notification of remote changes to the contactlist,
  // probably should be done through model
  virtual void friendsChanged() = 0;
  virtual void followersChanged() = 0;
  virtual void groupChanged() = 0;
};

#endif // SMFPOSTPROVIDER_H