Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/example/clientapi/example_usage.cpp Tue Mar 02 16:24:32 2010 +0530
@@ -0,0 +1,175 @@
+#include <smf/smfprovider.h>
+#include <smf/smfgallery.h>
+#include <smf/smfcontact.h>
+#include <smf/smfpostprovider.h>
+#include <smf/smffcontactfetcher.h>
+#include <smf/smfmusic.h>
+
+/** 1. Display a gallery on the screen for some remote service.
+ * assume m_view is some gallery view object in the application.*/
+void MyApplication::displayGallery()
+{
+ // Some common interface for finding implementations.
+ QList<SmfGallery> galleries = Smf::GetServices("org.symbian.smf.gallery");
+
+ // We will use the first one now
+ SmfGallery myGallery = galleries[0];
+
+ // Adjust our view to show where these pictures came from
+ m_view.setIcon(myGallery.serviceIcon());
+ m_view.setProvder(myGallery.serviceName());
+ m_view.setDescription(myGallery.description());
+
+ QList<SmfPicture> pics = myGallery.pictures();
+ foreach(SmfPicture pic, pics) {
+ m_view.add(pic); // do something with the picture in this gallery
+ }
+}
+
+/** 2. Upload a picture captured by the user to some selection of galeries.*/
+void MyApplication::uploadPicture(QImage picture, QList<SmfGallery> galleries)
+{
+ // The list could be from a selection of galleries chosen by the user,
+ // think multiple TweetDeck accounts?
+ foreach(SmfGallery gallery, galleries) {
+ gallery.upload(picture);
+ }
+}
+
+
+/**
+ * 3. This is an example of displaying the friends profile image in a view from one or more
+ * service provider. Note that this service can be provided by any kind of service provider,
+ * e.g. last.fm music service where users maintain profiles and friends.
+ */
+void MyApplication::displayFriends()
+{
+ // Some common interface for finding implementations.
+ QList<SmfContactFetcher> contactFetcherList = Smf::GetServices("org.symbian.smf.contact.fetcher");
+
+ //let us show list of friends from first one
+ showlist(contactFetcherList [ 0 ]);
+
+ //now from the second provider
+ showlist(contactFetcherList [ 1 ]);
+
+ //user now matches one contact from list 1 to another contact in list 2 -
+ SmfRelationMgr mgr = Smf::GetRelationMgr();
+ SmfRelationId id = mgr.create(contactFetcherList [ 0 ], selectedContact1);
+ mgr.associate(id,contactFetcherList [ 1 ], selectedContact2);
+
+ //now show user all the relations he has made so far
+ QList<SmfRelationId> relations = mgr.getAll();
+ foreach(SmfRelationId id, relations) {
+ QList<SmfRelationItem> items = mgr.get(id);
+ foreach(SmfRelationItem item,items) {
+ SmfProvider provider* = item.getProvider();
+ m_view.setIcon(provider.serviceIcon());
+ m_view.setTitle(item.value("Name"));
+ }
+ }
+}
+
+void MyApplication::showlist(SmfContactFetcher fetcher)
+{
+ //get users friend list
+ QList<SmfContact> friendsList = fetcher.friends();
+
+ // Adjust our view to show where these pictures came from
+ //display service name description and the logo
+ m_view.setIcon( myFetcher.serviceIcon() );
+ m_view.setProvider( myFetcher.serviceName() );
+ m_view.setDescription( myFetcher.description() );
+
+ //now display the images
+ foreach(SmfContact contact, friendsList) {
+ QImage pic = contact.value("Avatar");
+ m_view.setPicture(pic);
+ m_view.setTitle(contact.value("Name"));
+ }
+}
+/**
+ * 4. This is an example of posting and reading user updates to social netowrking sites
+ */
+void MyApplication::postUpdate()
+{
+ // Some common interface for finding implementations.
+ QList<SmfPostProvider> postServices = Smf::GetServices("org.symbian.smf.contact.posts");
+
+ //let us use the first one
+ SmfPostProvider myPostServer = postServices[ 0 ];
+
+ //Adjust our view to show where these posts came from (e.g. tweets from twitter)
+ //display service name description and the logo
+ m_view.setIcon( myPostServer.serviceIcon() );
+ m_view.setProvider( myPostServer.serviceName() );
+ m_view.setDescription( myPostServer.description() );
+
+ SmfPost reply = new SmfPost(sampleString,samplmage, sampleUrl);
+ //post my udpate to be visible to all
+ myPostServer.updatePost(reply);
+
+ //get all posts to me in my profle (e.g. twits from all friends)
+ QList <SmfPost> posts = postServices.getPosts();
+
+ //read the first post
+ SmfPost firstPost = posts.at(0);
+ SmfContact currentContact = firstPost.contact();
+
+ //reply only to the sender - can check availability this service before sending
+ myPostServer.postDirected(currentContact,reply);
+ //presentation layout to be decided
+
+ //now display the latest post
+ qSort(posts.begin(),posts.end(),caseCompareTimeMoreThan);
+ m_view.setPostData(posts.at(0));
+
+}
+
+/**
+ * 5. This is an example of getting song recommendations from a social netowrking sites
+ */
+void MyApplication::getMusic()
+{
+ // Some common interface for finding implementations.
+ QList<SmfMusicSearch> musicServices = Smf::GetServices("org.symbian.smf.music");
+
+ //let us use the first one
+ SmfMusicSearch mServer = musicServices.at(0);
+
+ //search songs similar to currently playing
+ QList<SmfTrackInfo> songs = mServer.recommendations(currTrack);
+
+ //display to the user
+ m_view.setIcon( mServer.serviceIcon() );
+ m_view.setProvider( mServer.serviceName() );
+ m_view.setDescription( mServer.description() );
+ foreach(SmfTrackInfo track, songs) {
+ m_view.add(track);
+ }
+
+ //allow user to select a track and get purchase links
+ QList<SmfProvider> stores = mServer.stores(selectedTrack);
+
+}
+
+void MyApplication::updateCurrentPlaying(QList<SmfMusicSearch> musicServices, SmfTrackInfo currTrack)
+{
+ //after purchasing and downloading is over, user plays the track
+ //now post the current platying track to all service providers
+ foreach(SmfMusicSearch provider, musicServices) {
+ provider.postCurrentPlaying(currTrack);
+ }
+ //postCurrentPlaying is also a slot funtion, may be application can use connect
+}
+
+void MyApplication::displayLyrics(SmfTrackInfo currTrack)
+{
+ // Some common interface for finding implementations.
+ SmfLyricsService lyricsService = Smf::GetServices("org.symbian.smf.music.lyrics","lyricsfly.com");
+
+ QList<SmfLyrics> list = lyricsService.lyrics(currTrack);
+ //now display the latest edited lyrics
+ qSort(list.begin(),list.end(),caseCompareTimeMoreThan);
+ m_view.setLyricsData(list.at(0));
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/example/clientapi/smf/smfcontact.h Tue Mar 02 16:24:32 2010 +0530
@@ -0,0 +1,77 @@
+/**************************************************************************************************
+* 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 profile of a contact in a social networking site
+*
+/*************************************************************************************************/
+
+#ifndef SMFPROFILE_H
+#define SMFPROFILE_H
+
+#include <QContactDetail>
+
+class SmfProvider;
+
+/**
+ * Interface for a contact from a service provider. This class
+ * provides basic functionality to allow applications to obtain details of a
+ * contact (self or friends) in a social networking service.
+ *
+ * All of the functionality described here should be implemented by a service
+ * specific plug-in object.
+ */
+class SmfContact : public QObject
+{
+ Q_OBJECT;
+
+public:
+ // Seeing as this is a plug-in implementation, these will realistically
+ // be generated by SMF factory of some kind
+ SmfContact(QObject* parent = 0);
+ ~SmfContact();
+
+
+private:
+ /*
+ QContactAddress Address;
+ QContactAnniversary Anniversary;
+ QContactAvatar Avatar;
+ QContactBirthday Birthday;
+ QContactEmailAddress EmailAddress;
+ QContactGender Gender;
+ QContactGeolocation Geolocation;
+ QContactGuid Guid;
+ QContactName Name;
+ QContactNickname Nickname;
+ QContactNote Note;
+ QContactOnlineAccount OnlineAccount;
+ QContactOrganization Organization;
+ QContactPhoneNumber PhoneNumber;
+ QContactTimestamp Timestamp;
+ QContactType Type;
+ QContactUrl Url;
+ */
+ QVariantMap details;
+
+public:
+ virtual QStringList subTypes() const;
+
+slots:
+ virtual void value(const QString& subType,const QVariant& info); //for any contact
+ virtual bool setValue( const QString & key, const QVariant & value );//for self contact only
+
+signals:
+ virtual void detailsUpdated(const QString& key); //for setvalue on self contact
+};
+#endif // SMFPROFILE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/example/clientapi/smf/smffcontactfetcher.h Tue Mar 02 16:24:32 2010 +0530
@@ -0,0 +1,72 @@
+/*
+* 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 list of contacts from a site
+*
+*/
+
+#ifndef SMFCONTACTHETCHER_H
+#define SMFCONTACTHETCHER_H
+
+class SmfProvider; //base-class for service provider
+class SmfContact; //class for Contact in a social network
+class SmfGroup; //class for a group 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 SmfContactFetcher : public SmfProvider
+{
+ Q_OBJECT;
+
+public:
+ // Seeing as this is a plug-in implementation, these will realistically
+ // be generated by SMF factory of some kind
+ SmfContactFetcher(QObject* parent = 0);
+ ~SmfContactFetcher();
+
+public:
+ // Get the friend listing - might be made asynchrnous later
+ virtual QList<SmfContact> friends() = 0; // list of contact objects
+ virtual QList<SmfContact> followers() = 0; // list of contact objects
+ virtual QList<SmfContact> search(SmfContact) = 0; // list of contact objects
+ virtual QList<SmfGroup> groups() = 0; // list of group objects
+ virtual QList<SmfContact> searchInGroup(SmfGroup) = 0; // list of contact objects
+
+ virtual SmfContactModel model() = 0; // maybe we can make a QItemModel-derived model?
+
+
+slots:
+
+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 // SMFCONTACTHETCHER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/example/clientapi/smf/smfgallery.h Tue Mar 02 16:24:32 2010 +0530
@@ -0,0 +1,68 @@
+/*
+* 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 a remote picture gallery
+*
+*/
+
+#ifndef SMFGALLERY_H
+#define SMFGALLERY_H
+
+class SmfProvider;
+class SmfPicture;
+class SmfGalleryModel;
+class SmfComment; //user id, string, and url
+
+/**
+ * Interface to a remote gallery service. This class
+ * provides some basic gallery functionality to allow applications
+ * to interact with a picture gallery in a social network.
+ *
+ * Note that branding information for the particular service implementation
+ * is available from base-class functions. See also:
+ * SmfProvider::serviceName(), SmfProvider::serviceIcon()
+ *
+ * All of the functionality described here should be implemented by a service
+ * specific plug-in object.
+ */
+class SmfGallery : public SmfProvider
+{
+ Q_OBJECT;
+
+public:
+ // Seeing as this is a plug-in implementation, these will realistically
+ // be generated by SMF factory of some kind
+ SmfGallery(QObject* parent = 0);
+ ~SmfGallery();
+
+public:
+ // Get the picture listing
+ virtual QList<SmfPicture> pictures() = 0; // basic list of picture objects
+ virtual SmfGalleryModel model() = 0; // maybe we can make a QItemModel-derived model?
+ virtual QString description() = 0; // A user title or caption, maybe?
+
+slots:
+ // Upload an image, note these can be slots to connect to UI controls more easily
+ virtual int upload(SmfPicture image) = 0;
+ virtual int upload(QList<SmfPicture> images) = 0;
+ virtual int postComment(SmfPicture image, SmfComment comment) = 0;
+
+signals:
+ // Notification of remote changes to the gallery,
+ // probably should be done through model
+ virtual void galleryUpdated() = 0;
+};
+
+#endif // SMFGALLERY_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/example/clientapi/smf/smfmusic.h Tue Mar 02 16:24:32 2010 +0530
@@ -0,0 +1,189 @@
+/*
+* 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 music related services
+*
+*/
+
+#ifndef SMFMUSIC_H
+#define SMFMUSIC_H
+
+class SmfProvider; //basic Smf service Provider info
+class SmfMusicRating;//rating value from 0..31 - services would map accordingly
+class SmfMusicProfile; //user profile containing music usage and interest info, extends SmfContact
+class SmfTracknfo; //id, title, album, artist, genre, tag, director,release year, rating, comment info
+class SmfMusicFingerPrint; //generation is not in scope of smf
+
+class SmfMusicModel;
+
+/**
+ * basic music service ("org.symbian.smf.music.service")
+ */
+class SmfMusicService : public SmfProvider
+{
+ Q_OBJECT;
+
+public:
+ // Seeing as this is a plug-in implementation, these will realistically
+ // be generated by SMF factory of some kind
+ SmfMusicService(QObject* parent = 0);
+ ~SmfMusicService();
+
+public:
+ virtual SmfMusicProfile userinfo() = 0; // get self profile information
+ virtual QList<SmfMusicProfile> searchUser(SmfVenue venue) = 0; // search information about other service users
+ virtual SmfMusicModel model() = 0; // maybe we can make a QItemModel-derived model?
+
+slots:
+
+
+signals:
+
+};
+
+/**
+* provides service ("org.symbian.smf.music.search")
+*/
+class SmfMusicSearch : public SmfProvider
+{
+ Q_OBJECT;
+
+public:
+ // Seeing as this is a plug-in implementation, these will realistically
+ // be generated by SMF factory of some kind
+ SmfMusicSearch(QObject* parent = 0);
+ ~SmfMusicSearch();
+
+public:
+ // Get the track listing - might be made asynchrnous later
+ virtual QList<SmfTrackInfo> recommendations(SmfTrackInfo track) = 0; // basic list of track objects
+ virtual QList<SmfTrackInfo> tracks(SmfTrackInfo track) = 0; // basic list of track objects
+ virtual QList<SmfTrackInfo> trackInfo(SmfMusicFingerPrint signature) = 0; // search by fingerprint object
+ virtual QList<SmfProvider> stores(SmfTrackInfo track) = 0; // search information about where to buy this song from
+
+slots:
+ virtual int postCurrentPlaying(SmfTrackInfo track) = 0;
+ //virtual int postRating(SmfTrackInfo track, SmfMusicRating rate) = 0;
+ //virtual int postComments(SmfTrackInfo track, SmfComment comment) = 0;
+
+signal:
+
+}
+
+class SmfPlaylist;//remote playlist
+/**
+ * provides service ("org.symbian.smf.music.playlist")
+ *
+ * Interface to a remote playlist service. This class
+ * provides some basic functionality to allow applications
+ * to interact with playlists in some music related service provider (e.g. last.fm).
+ *
+ * Note that branding information for the particular service implementation
+ * is available from base-class functions. See also:
+ * SmfProvider::serviceName(), SmfProvider::serviceIcon()
+ *
+ * All of the functionality described here should be implemented by a service
+ * specific plug-in object.
+ *
+ */
+class SmfPlaylistService : public SmfProvider
+{
+ Q_OBJECT;
+
+public:
+ // Seeing as this is a plug-in implementation, these will realistically
+ // be generated by SMF factory of some kind
+ SmfPlaylistService(QObject* parent = 0);
+ ~SmfPlaylistService();
+
+public:
+ // Get the playist listing - might be made asynchrnous later
+ virtual QList<SmfPlaylist> playlists() = 0; // basic list of playlist objects for the logged-in user
+ virtual QList<SmfPlaylist> playlistsOf(SmfMusicProfile user) = 0; // basic list of playlist objects for other user
+
+
+slots:
+ // Upload currently playing song, etc - slots can connect to UI controls more easily
+ virtual int addToPlaylist(SmfPlaylist plst, QList<SmfTrackInfo> tracks) = 0;
+ virtual int postCurrentPlayingPlaylist(SmfPlaylist plst) = 0;
+
+
+signals:
+ //signals remote updation of playlist
+ virtual int playlistUpdated(void) = 0;
+};
+
+
+
+class SmfEvent;//musical events
+class SmfVenue;//popular venues
+/**
+* provides service ("org.symbian.smf.music.events")
+*/
+class SmfMusicEvents : public SmfProvider
+{
+ Q_OBJECT;
+
+public:
+ // Seeing as this is a plug-in implementation, these will realistically
+ // be generated by SMF factory of some kind
+ SmfMusicEvents(QObject* parent = 0);
+ ~SmfMusicEvents();
+
+public:
+ virtual QList<SmfEvents> events(QContactGeolocation location) = 0; // basic list of events objects
+ virtual QList<SmfVenue> venues(QContactGeolocation location) = 0; // basic list of venue objects
+ virtual QList<SmfEvents> events(SmfVenue venue) = 0; // basic list of events objects
+
+slot:
+ //update your event
+ virtual void postEvents(QList<SmfEvents> events); //might not be supported by all service provider
+
+signal:
+ virtual void eventsupdated(void);
+};
+
+
+
+
+class SmfSubtitleSearchFilter;//language, frame rate, duration, release year
+/**
+* provides service ("org.symbian.smf.music.lyrics")
+*/
+class SmfLyricsService : public SmfProvider
+{
+ Q_OBJECT;
+
+public:
+ // Seeing as this is a plug-in implementation, these will realistically
+ // be generated by SMF factory of some kind
+ SmfLyricsService(QObject* parent = 0);
+ ~SmfLyricsService();
+
+public:
+ // Get the lyrics listing - might be made asynchrnous later
+ virtual QList<SmfLyrics> lyrics(SmfTrackInfo track) = 0; //texts without time information
+ virtual QList<SmfSubtitle> subtitles(SmfTrackInfo track, SmfSubtitleSearchFilter filter) = 0; // texts with time information
+
+
+slots:
+
+
+signals:
+
+};
+
+
+#endif // SMFMUSIC_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/example/clientapi/smf/smfpostprovider.h Tue Mar 02 16:24:32 2010 +0530
@@ -0,0 +1,67 @@
+/*
+* 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/example/clientapi/smf/smfprovider.h Tue Mar 02 16:24:32 2010 +0530
@@ -0,0 +1,56 @@
+/**
+* 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 sfm service provider
+*
+*/
+
+#ifndef SMFPROVIDER_H
+#define SMFPROVIDER_H
+
+class SmfContact;
+
+/**
+ * Interface for a base service provider. Other service provider classes o derive from
+ * this base class so that each has access to service provider information
+ *
+ * All of the functionality described here should be implemented by a service
+ * specific plug-in object.
+ */
+class SmfProvider : public QObject
+{
+ Q_OBJECT;
+
+public:
+ // Seeing as this is a plug-in implementation, these will realistically
+ // be generated by SMF factory of some kind
+ SmfProvider(QObject* parent = 0);
+ ~SmfProvider();
+
+public:
+ virtual QString serviceName() = 0; // licalizable name of the service
+ virtual QImage serviceIcon() = 0; // Logo of the service
+ virtual QString description() = 0; // readable service description
+ virtual QUrl serviceUrl() = 0; // website of the service
+ virtual QUrl applicationUrl() = 0; // application providing this service
+ virtual SmfContact selfContact()=0;//provides profile of the accound holder
+
+slots:
+ //None at the moment
+
+signals:
+ //None at the moment
+};
+
+#endif // SMFPROVIDER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/example/clientapi/smf/smfrelationmgr.h Tue Mar 02 16:24:32 2010 +0530
@@ -0,0 +1,71 @@
+/**
+* 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 managing associations between various social contacts
+*
+*/
+
+#ifndef SMFRELATIONMGR_H
+#define SMFRELATIONMGR_H
+
+class SmfProvider;
+class SmfContact;
+class SmfRelationId; //persistent Id of a relation
+
+class SmfRelationItem : public SmfContact
+{
+ private:
+ //SmfProvider* provider;
+
+ public:
+ virtual SmfProvider* provider getProvider()=0;
+ virtual SmfProvider* provider setProvider(SmfProvider* provider)=0;
+};
+
+/**
+ * Interface for a base service provider. Other service provider classes o derive from
+ * this base class so that each has access to service provider information
+ *
+ * All of the functionality described here should be implemented by a service
+ * specific plug-in object.
+ */
+class SmfRelationMgr : public QObject
+{
+ Q_OBJECT;
+
+public:
+ // Seeing as this is a plug-in implementation, these will realistically
+ // be generated by SMF factory of some kind
+ SmfRelationMgr(QObject* parent = 0);
+ ~SmfRelationMgr();
+
+public:
+ //create a relation with first contact (id optional)
+ virtual SmfRelationId create(SmfProvider provider, SmfContact conact, uint id) = 0;
+ // assign contact to a relation
+ virtual bool associate(SmfRelationId relation, SmfProvider provider, SmfContact conact) = 0;
+ //returns first contact in the relation when exists
+ virtual SmfContact searchById(SmfRelationId relation)=0;
+ //number of contacts in a relation
+ virtual uint count(SmfRelationId relation) = 0;
+
+slots:
+ virtual QList<SmfRelationItem> get(SmfRelationId relation)=0;//list of contacts and their provider
+ virtual QList<SmfRelationId> getAll()=0;//list of all relations
+
+signals:
+ //None at the moment
+};
+
+#endif // SMFRELATIONMGR_H