--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/smf/smfservermodule/smfclient/client/smfactivityfetcher.h Thu May 20 16:20:37 2010 +0530
@@ -0,0 +1,81 @@
+/**
+ * Copyright (c) 2010 Sasken Communication Technologies Ltd.
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html"
+ *
+ * Initial Contributors:
+ * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
+ *
+ * Description:
+ * Represents activity in terms similar to standard activity stream http://activitystrea.ms/
+ */
+
+#ifndef SMFACTIVITYFETCHER_H_
+#define SMFACTIVITYFETCHER_H_
+
+#include <QObject>
+#include <QList>
+#include <qmobilityglobal.h>
+
+#include "smfglobal.h"
+#include "smfprovider.h"
+#include "smfcontact.h"
+#include "smfevent.h"
+#include "smfactions.h"
+
+typedef QList<SmfActivityEntry> SmfActivityEntryList;
+
+/**
+ * @ingroup smf_client_group
+ * Basic activity service ("org.symbian.smf.client.activity.fetcher")
+ */
+class SMFCLIENT_EXPORT SmfActivityFetcher : public QObject
+ {
+ Q_OBJECT
+
+public:
+
+ /**
+ * Constructs SmfActivity.
+ * @param baseProvider The base provider info
+ */
+ SmfActivityFetcher(SmfProvider* baseprovider = 0);
+
+ ~SmfActivityFetcher();
+
+public slots:
+ /**
+ * Emits signal resultsAvailable() when list of activities for the user is available
+ */
+ void selfActivities(int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE);
+
+ /**
+ * Emits signal resultsAvailable() when list of activities for other contact is available
+ */
+ void friendsActivities(const SmfContact& aFriend,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE);
+
+ /**
+ * returns only those activities (self) which are from @arg filters
+ */
+ void filtered(QList<SmfActivityObjectType> filters,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE);
+
+ /**
+ * Gets the base provider info
+ */
+ SmfProvider* getProvider() ;
+
+signals:
+
+ /**
+ * Signals availability of the result of the previous query
+ */
+ void resultsAvailable(SmfActivityEntryList* entries, QString error, SmfResultPage resultPage);
+
+ };
+
+SMF_SERVICE_NAME(SmfGallery, "org.symbian.smf.client.activity.fetcher\0.2")
+
+#endif /* SMFACTIVITYFETCHER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/smf/smfservermodule/smfclient/client/smfmusic.h Thu May 20 16:20:37 2010 +0530
@@ -0,0 +1,526 @@
+/**
+ * Copyright (c) 2010 Sasken Communication Technologies Ltd.
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html"
+ *
+ * Initial Contributors:
+ * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
+ *
+ * Contributors:
+ * Manasij Roy, Nalina Hariharan
+ *
+ * Description:
+ * The SmfEvent class represents an event
+ *
+ */
+
+#ifndef SMFMUSIC_H
+#define SMMUSIC_H
+
+#include <QObject>
+
+#include <qmobilityglobal.h>
+#include <qgeopositioninfo.h>
+
+#include "smfglobal.h"
+#include "smfprovider.h"
+#include "smfcontact.h"
+#include "smfevent.h"
+
+class SmfProvider; //basic Smf service Provider info
+class SmfContact; // Smf contact
+class SmfMusicRating;//rating value from 0..31 - services would map accordingly
+class SmfMusicProfile; //user profile containing music usage and interest info, extends SmfContact
+class SmfTrackInfo; //id, title, album, artist, genre, tag, director,release year, rating, comment info
+class SmfMusicFingerPrint; //generation is not in scope of smf
+class SmfVenue;
+class SmfEvent;
+class SmfPlaylist;
+class SmfLyricsService;
+class SmfLyrics;
+class SmfSubtitle;
+class SmfSubtitleSearchFilter;
+
+typedef QList<SmfMusicProfile> SmfMusicProfileList;
+typedef QList<SmfTrackInfo> SmfTrackInfoList;
+typedef QList<SmfEvent> SmfEventsList;
+typedef QList<SmfProvider> SmfProviderList;
+typedef QList<SmfPlaylist> SmfPlaylistList;
+typedef QList<SmfVenue> SmfVenueList;
+typedef QList<SmfLyrics> SmfLyricsList;
+typedef QList<SmfSubtitle> SmfSubtitleList;
+/**
+ * @ingroup smf_client_group
+ * Basic music service ("org.symbian.smf.client.music.service")
+ */
+class SMFCLIENT_EXPORT SmfMusicService : public QObject
+{
+ Q_OBJECT
+
+public:
+ /**
+ * Constructs SmfMusicService.
+ * @param baseProvider The base provider info
+ * Seeing as this is a plug-in implementation, these will realistically
+ * be generated by SMF factory of some kind
+ */
+ SmfMusicService(SmfProvider* baseProvider = 0);
+ ~SmfMusicService();
+
+public:
+
+ /**
+ * Gets self profile information asynchronously.
+ * userInfoAvailable() signal is emitted with SmfMusicProfile when the info is arrived
+ */
+ void userinfo() ;
+
+ /**
+ * Asynchronously searches information about other service users for a particular venue
+ * searchInfoAvailable() signal is emitted with SmfMusicProfileList when the info is arrived.
+ * When the list is big user can specify the page number and per page item data.
+ * If not supplied by the user default values are used.
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void searchUser(SmfVenue venue,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ;
+
+ /**
+ * Gets the base provider info
+ */
+ SmfProvider* getProvider() ;
+
+
+signals:
+ /**
+ * Notification on arrival of the self profile as result of userinfo().
+ * @param profile The self profile
+ */
+ void userInfoAvailable(SmfMusicProfile* profile, QString error);
+
+ void searchInfoAvailable(SmfMusicProfileList& profileList, QString error,SmfResultPage resultPage);
+private:
+ SmfProvider* m_baseProvider;
+};
+SMF_SERVICE_NAME(SmfMusicService, "org.symbian.smf.client.music.service\0.2")
+
+
+/**
+* Provides service ("org.symbian.smf.client.music.search") for music search
+*/
+class SMFCLIENT_EXPORT SmfMusicSearch : public QObject
+{
+ Q_OBJECT
+
+public:
+ /**
+ * Constructs SmfMusicSearch with base provider as arguement.
+ * Seeing as this is a plug-in implementation, these will realistically
+ * be generated by SMF factory of some kind
+ */
+
+ SmfMusicSearch(SmfProvider* baseProvider = 0);
+ ~SmfMusicSearch();
+
+public:
+ // Get the track listing - might be made asynchrnous later
+
+ /**
+ * Searches for music recommendations similar to a particulartrack asynchronously.
+ * The signal trackSearchAvailable() is emitted with SmfTrackInfoList
+ * once its arrived.
+ * When the list is big user can specify the page number and per page item data.
+ * If not supplied by the user default values are used.
+ * @param track The track for which similar recommendations need to be fetched.
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void recommendations(SmfTrackInfo track,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // basic list of track objects
+
+ /**
+ * Searches for tracks similar to a given track asynchronously.
+ * The signal trackSearchAvailable() is emitted with SmfTrackInfoList
+ * once its arrived.
+ * When the list is big user can specify the page number and per page item data.
+ * If not supplied by the user default values are used.
+ * @param track The search criteria, similar tracks are searched
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void tracks(SmfTrackInfo track,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // basic list of track objects
+
+ /**
+ * Searches for a track having similar finger print asynchronously.
+ * The signal trackSearchAvailable() is emitted with SmfTrackInfoList
+ * once its arrived.
+ * @param signature The search criteria,signature to be searched for
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void trackInfo(SmfMusicFingerPrint signature,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // search by fingerprint object
+
+ /**
+ * Search information about where to buy this song from asynchronously.
+ * The signal storeSearchAvailable() is emitted with SmfProviderList once its arrived.
+ * @param track The search criteria for stores
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void stores(SmfTrackInfo track,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ;
+
+ //APIs to get/set base provider info (SmfProvider)
+
+ /**
+ * Gets the base provider info
+ */
+ SmfProvider* getProvider() ;
+
+
+public slots:
+
+ /**
+ * Posts currently playing track.
+ * Success can be checked by checking the signal postFinished()
+ * @param track Track to post
+ */
+ void postCurrentPlaying(SmfTrackInfo track) ;
+ //int postRating(SmfTrackInfo track, SmfMusicRating rate) ;
+ //int postComments(SmfTrackInfo track, SmfComment comment) ;
+
+signals:
+ /**
+ * Emitted when the search result for a track is available.
+ * Note if number of tacks in the search is large, then it can download the list page by page.
+ * In that case this signal is emitted multiple times.
+ * @param resultPage Page number info
+ */
+ void trackSearchAvailable(SmfTrackInfoList* result, QString error,SmfResultPage resultPage);
+
+ /**
+ * Emitted when the search result for a store is available.
+ * Note if number of tacks in the search is large, then it can download the list page by page.
+ * In that case this signal is emitted multiple times.
+ * @param resultPage Page number info
+ */
+ void storeSearchAvailable(SmfProviderList* result, QString error, SmfResultPage resultPage);
+private:
+ SmfProvider* m_baseProvider;
+};
+SMF_SERVICE_NAME(SmfMusicSearch, "org.symbian.smf.client.music.search\0.2")
+
+
+/**
+ * Remote playlist
+ */
+class SMFCLIENT_EXPORT SmfPlaylist : public QObject
+ {
+ Q_OBJECT
+
+public:
+ SmfPlaylist();
+ ~SmfPlaylist();
+
+ /**
+ * Gets tracks in the playlist
+ */
+ SmfTrackInfoList* getTrackList();
+
+ /**
+ * Gets playlist title
+ */
+ QString getPlayListTitle();
+
+ /**
+ * Gets the creation date
+ */
+ QDateTime getCreationDate();
+
+ /**
+ * Sets tracks in the playlist
+ */
+ void setTrackList(SmfTrackInfoList* trackList);
+
+ /**
+ * Sets playlist title
+ */
+ void setPlayListTitle(QString title);
+
+ /**
+ * Sets creation date
+ */
+ void setCreationDate(QDateTime time);
+
+private:
+ SmfTrackInfoList* m_trackList;
+ QString m_title;
+ QDateTime m_creationDate;
+ };
+
+
+/**
+ * provides service ("org.symbian.smf.client.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 getProvider() API. See also:
+ * SmfProvider::serviceName(), SmfProvider::serviceIcon()
+ *
+ * All of the functionality described here should be implemented by a service
+ * specific plug-in object.
+ *
+ */
+class SMFCLIENT_EXPORT SmfPlaylistService : public QObject
+{
+ Q_OBJECT
+
+public:
+ /**
+ * Constructs SmfPlaylistService with base provider info
+ * Seeing as this is a plug-in implementation, these will realistically
+ * be generated by SMF factory of some kind
+ */
+ SmfPlaylistService(SmfProvider* baseProvider = 0);
+ ~SmfPlaylistService();
+
+public:
+
+ /**
+ * Gets the list playlists for the logged-in user asynchronously.
+ * The signal playlistsListAvailable() signal is emitted with
+ * SmfPlaylistList once its arrived .
+ * When the list is big user can specify the page number and per page item data.
+ * If not supplied by the user default values are used.
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void playlists(int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // basic list of playlist objects
+
+ /**
+ * Gets the list playlists for the given user asynchronously.
+ * The signal playlistsListAvailable() signal is emitted with
+ * SmfPlaylistList once its arrived.
+ * When the list is big user can specify the page number and per page item data.
+ * If not supplied by the user default values are used.
+ * @param user User for which to get the playlists
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void playlistsOf(SmfMusicProfile* user,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ;
+
+ //APIs to get/set base provider info (SmfProvider)
+
+ /**
+ * Gets the base provider info
+ */
+ SmfProvider* getProvider() ;
+
+
+public slots:
+
+ /**
+ * Upload currently playing track to a playlist. Signal
+ * playlistUpdated() can be checked for success value
+ * @param plst The playlist to be added in
+ * @param tracks The list of tracks to uploaded
+ */
+ int addToPlaylist(SmfPlaylist plst, SmfTrackInfoList* tracks) ;
+
+ /**
+ * Upload currently playing playlist . Signal
+ * playlistUpdated() can be checked for success value
+ * @param plst The playlist to be uploaded
+ */
+ int postCurrentPlayingPlaylist(SmfPlaylist plst) ;
+
+
+signals:
+ /**
+ * Notification of availability of list of playlists requested.
+ * Note if number of list is large, then it can download the list page by page.
+ * In that case this signal is emitted multiple times.
+ * @param resultPage Page number info
+ */
+ void playlistsListAvailable(SmfPlaylistList*, QString error, SmfResultPage resultPage);
+ /**
+ * Signals remote updation of playlist with success value
+ */
+ int playlistUpdated(bool success) ;
+private:
+ SmfProvider* m_baseProvider;
+};
+SMF_SERVICE_NAME(SmfPlaylistService, "org.symbian.smf.client.music.playlist\0.2")
+
+
+/**
+* provides service ("org.symbian.smf.client.music.events")
+*/
+class SMFCLIENT_EXPORT SmfMusicEvents : public QObject
+{
+ Q_OBJECT
+
+public:
+ /**
+ * Constructs SmfMusicEvents with base provider info
+ * Seeing as this is a plug-in implementation, these will realistically
+ * be generated by SMF factory of some kind
+ */
+ SmfMusicEvents(SmfProvider* baseProvider = 0);
+ ~SmfMusicEvents();
+
+public:
+
+ /**
+ * Gets list of events in a particular location asynchronously.
+ * eventsAvailable() signal is emitted with SmfEventsList once its arrived.
+ * When the list is big user can specify the page number and per page item data.
+ * If not supplied by the user default values are used.
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void events(QtMobility::QContactGeolocation location,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ;
+
+ /**
+ * Gets list of venues of a particular location asynchronously.
+ * venuesAvailable() signal is emitted with SmfVenueList once its arrived.
+ * When the list is big user can specify the page number and per page item data.
+ * If not supplied by the user default values are used.
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void venues(QtMobility::QContactGeolocation location,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // basic list of venue objects
+
+ /**
+ * Gets list of events in a particular venue asynchronously.
+ * eventsAvailable() signal is emitted with SmfEventsList once its arrived.
+ * When the list is big user can specify the page number and per page item data.
+ * If not supplied by the user default values are used.
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void events(SmfVenue venue,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // basic list of events objects
+
+
+ //APIs to get/set base provider info (SmfProvider)
+
+ /**
+ * Gets the base provider info
+ */
+ SmfProvider* getProvider() ;
+
+
+public slots:
+
+ /**
+ * Updates events. Might not be supported by all service provider.
+ * eventsUpdated() signal can be checked for success value.
+ * @param SmfEventsList List of events to be posted
+ */
+ void postEvents(SmfEventsList events);
+
+signals:
+
+ /**
+ * Notification of the success of request to post an event
+ */
+ void eventsUpdated(bool success);
+
+ /**
+ * Notification on arrival of event lists
+ * Note if number of list is large, then it can download the list page by page.
+ * In that case this signal is emitted multiple times.
+ * @param resultPage Page number info
+ */
+ void eventsAvailable(SmfEventsList* list, QString error, SmfResultPage resultPage);
+
+ /**
+ * Notification on arrival of venues lists
+ * Note if number of list is large, then it can download the list page by page.
+ * In that case this signal is emitted multiple times.
+ * @param resultPage Page number info
+ */
+ void venuesAvailable(SmfVenueList* list, QString error, SmfResultPage resultPage);
+private:
+ SmfProvider* m_baseProvider;
+};
+SMF_SERVICE_NAME(SmfMusicEvents, "org.symbian.smf.client.music.events\0.2")
+
+
+/**
+* provides service ("org.symbian.smf.client.music.lyrics")
+*/
+class SMFCLIENT_EXPORT SmfLyricsService : public QObject
+{
+ Q_OBJECT
+
+public:
+ /**
+ * Constructs SmfLyricsService with base provider info.
+ * Seeing as this is a plug-in implementation, these will realistically
+ * be generated by SMF factory of some kind
+ */
+
+ SmfLyricsService(SmfProvider* baseProvider = 0);
+ ~SmfLyricsService();
+
+public:
+
+ /**
+ * Get the lyrics lists asynchrnously, it fetches texts without time info.
+ * lyricsAvailable() notification comes SmfLyricsList with when the data is available
+ * @param track Track for which lyrics needs to be fetched.
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void lyrics(SmfTrackInfo track,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ;
+
+ /**
+ * Get the lyrics lists asynchrnously, it fetches texts with time info.
+ * Subtitle search filter can be applied
+ * subtitleAvailable() notification comes SmfSubtitleList with when the data is available
+ * @param track Track for which subtitle needs to be fetched.
+ * @param filter Subtitle search filter
+ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
+ * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
+ */
+ void subtitles(SmfTrackInfo track, SmfSubtitleSearchFilter filter,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // texts with time information
+ //APIs to get/set base provider info (SmfProvider)
+
+ /**
+ * Gets the base provider info
+ */
+ SmfProvider* getProvider() ;
+
+
+public slots:
+
+
+signals:
+
+ /**
+ * Notification on arrival of lyrics
+ * Note if the list is large, then it can download the list page by page.
+ * In that case this signal is emitted multiple times.
+ * @param resultPage Page number info
+ */
+ void lyricsAvailable(SmfLyricsList* list, QString error, SmfResultPage resultPage);
+
+ /**
+ * Notification on arrival of subtitle based on filter.
+ * Note if the list is large, then it can download the list page by page.
+ * In that case this signal is emitted multiple times.
+ * @param resultPage Page number info
+ */
+ void subtitleAvailable(SmfSubtitleList* list, QString error, SmfResultPage resultPage);
+private:
+ SmfProvider* m_baseProvider;
+};
+SMF_SERVICE_NAME(SmfLyricsService, "org.symbian.smf.client.music.lyrics\0.2")
+
+#endif // SMFMUSIC_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/smf/smfservermodule/smfclient/common/smfactions.h Thu May 20 16:20:37 2010 +0530
@@ -0,0 +1,300 @@
+/**
+ * Copyright (c) 2010 Sasken Communication Technologies Ltd.
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html"
+ *
+ * Initial Contributors:
+ * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
+ *
+ * Description:
+ * Represents activities in terms similar to standard activity stream http://activitystrea.ms/
+ */
+
+#ifndef SMFACTIONS_H_
+#define SMFACTIONS_H_
+
+#include <QList>
+#include <QImage>
+#include <QDateTime>
+#include <QStringList>
+#include <QUrl>
+#include <qdatastream.h>
+#include <QSharedData>
+#include <QMetaType>
+
+#include "smfclientglobal.h"
+
+
+/**
+ * The actions in the activity based on Atom Activity Base Schema
+ * see http://activitystrea.ms/schema/1.0/activity-schema-01.html
+ */
+enum SmfActivityVerb
+ {
+ SmfActivityMarkAsFavorite,
+ SmfActivityStartFollowing,
+ SmfActivityMarkLiked,
+ SmfActivityMakeFriend,
+ SmfActivityJoin,
+ SmfActivityPlay,
+ SmfActivityPost,
+ SmfActivitySave,
+ SmfActivityShare,
+ SmfActivityTag,
+ SmfActivityUpdate,
+ };
+
+/**
+ * The type of the object on which the activity is performed - as per Atom Activity Base Schema
+ * see http://activitystrea.ms/schema/1.0/activity-schema-01.html
+ */
+enum SmfActivityObjectType
+ {
+ SmfActivityObjTypeArticle,
+ SmfActivityObjTypeAudio,
+ SmfActivityObjTypeBookmark,
+ SmfActivityObjTypeComment,
+ SmfActivityObjTypeFile,
+ SmfActivityObjTypeFolder,
+ SmfActivityObjTypeGroup,
+ SmfActivityObjTypeList,
+ SmfActivityObjTypeNote,
+ SmfActivityObjTypePerson,
+ SmfActivityObjTypePhoto,
+ SmfActivityObjTypePhotoAlbum,
+ SmfActivityObjTypePlace,
+ SmfActivityObjTypePlaylist,
+ SmfActivityObjTypeProduct,
+ SmfActivityObjTypeReview,
+ SmfActivityObjTypeService,
+ SmfActivityObjTypeStatus,
+ SmfActivityObjTypeVideo,
+ SmfActivityObjTypeMusic,
+ SmfActivityObjTypeEvent,
+ SmfActivityObjTypeAdvanced
+ };
+
+enum SmfActivityFor
+ {
+ SmfActivitySelf,
+ SmfActivityFriend,
+ SmfActivityOthers
+ };
+
+class SmfActivityObjectPrivate;
+/**
+ * @ingroup smf_common_group
+ * The object class represents an object in an activity (e.g.a picture or a music track on which somebody commented)
+ */
+class SMFCLIENT_EXPORT SmfActivityObject
+ {
+public:
+ /**
+ * Constructor with default argument
+ */
+ SmfActivityObject();
+
+ /**
+ * Copy Constructor
+ */
+ SmfActivityObject(const SmfActivityObject& aOther);
+
+ /**
+ * Destructor
+ */
+ ~SmfActivityObject();
+
+ /**
+ * retruns service specific Id of this object in the entry
+ */
+ QString id() const;
+
+ /**
+ * returns thumbnail if availabel for this object in the entry
+ */
+ QImage thumbnail() const;
+
+ /**
+ * Captions for this object
+ */
+ QString caption() const;
+
+ /**
+ * retruns the type of this object
+ */
+ SmfActivityObjectType type() const;
+
+ /**
+ * returns data of the object - see type() for casting
+ */
+ QVariant objData() const;
+
+ /**
+ * url of this object, e.g. url of the image on which somebody commented
+ */
+ QString link() const;
+
+ /**
+ * Time of creation of this object
+ */
+ QDateTime time() const;
+
+ /**
+ * Description of the content of this object
+ */
+ QString content() const;
+
+ /**
+ * sets service specific id for this object
+ */
+ void setId(const QString& aId);
+
+ /**
+ * sets thumbnail for this object , not mandatory
+ */
+ void setThumbnail(const QImage& aIcon);
+
+ /**
+ * sets caption for this object
+ */
+ void setCaption(const QString& aCap);
+
+ /**
+ * sets type of this object - ObjData should be set next accordingly
+ */
+ void setType(const SmfActivityObjectType& aObjType);
+
+ /**
+ * sets object data e,g, SmfImage, SmfComment, SmfMusic, SmfEvent etc
+ * setType() with suitable type should have been called before
+ */
+ void setObjData( const QVariant& aData);
+ /**
+ * sets the url for the object
+ */
+ void setLink( const QString& aLink);
+ /**
+ * sets the time of creation/last modification of the object
+ */
+ void setTime( const QDateTime& aTime);
+
+ /**
+ * sets the description of the content of this object
+ */
+ void setContent( const QString& aText) ;
+
+private:
+ QSharedDataPointer<SmfActivityObjectPrivate> d;
+
+ friend QDataStream& operator >> ( QDataStream &aOut, const SmfActivityObject& aData);
+ friend QDataStream& operator << ( QDataStream &aIn, const SmfActivityObject& aData);
+ };
+// Make the class SmfActivityObject known to QMetaType, so that as to register it.
+Q_DECLARE_METATYPE(SmfActivityObject)
+
+
+
+
+
+class SmfActivityEntryPrivate;
+/**
+ * @ingroup smf_common_group
+ * The object class represents an entry in the list of activities
+ */
+class SMFCLIENT_EXPORT SmfActivityEntry
+ {
+
+public:
+
+ SmfActivityEntry();
+ SmfActivityEntry(const SmfActivityEntry& aOther);
+ ~SmfActivityEntry();
+
+ /**
+ * Returns service specific id of the of entry
+ */
+ QString id() const;
+ /**
+ * returns the title of the entry - mostly be a string
+ */
+ SmfPost title() const;
+
+ /**
+ * returns detail descriptiopn of this entry in the activity list. might be absent if title is sufficient
+ */
+ SmfPost details() const;
+
+ /**
+ * returns the author of the activity - the name and the uri field are most commonly used
+ * Other information fields might be empty
+ */
+ SmfContact author() const;
+
+ /**
+ * returns the verb of the activity ,e.g. Robin "marked" Joseph as a friend
+ */
+ SmfActivityVerb actionName() const;
+
+ /**
+ * There can be multiple objects in a single activity entry, though this may be rare - only for few verbs.
+ * @return list of activity objects (mostly one object)
+ */
+ QList<SmfActivityObject> activities() const;
+
+ /**
+ * returns information about the target of the activity, for verbs that support a target.
+ * For example, a target is a photo album to which photos were added
+ */
+ SmfActivityObject targetObj() const;
+
+ /**
+ * sets service specific id of the of entry
+ */
+ bool setId( const QString& aId);
+
+ /**
+ * sets the title of the entry - mostly be a string
+ */
+ bool setTitle(const SmfPost& aTitle);
+
+ /**
+ * sets detail descriptiopn of this entry in the activity list. might be absent if title is sufficient
+ */
+ bool setDetails(const SmfPost& aDetails);
+
+ /**
+ * sets the author of the activity - the name and the uri field are most commonly used
+ * Other information fields might be empty
+ */
+ bool setAuthor(const SmfContact& aContact);
+
+ /**
+ * sets the verb of the activity ,e.g. Robin "marked" Joseph as a friend
+ */
+ void setActionName(SmfActivityVerb aVerb);
+
+ /**
+ * sets single or multiple objects in a single activity entry, though multiple may be rare - only for few verbs.
+ * @param list of activity objects (mostly one object)
+ */
+ bool setActivities(QList<SmfActivityObject>& aList);
+
+ /**
+ * returns information about the target of the activity, for verbs that support a target.
+ * For example, a target is a photo album to which photos were added
+ */
+ bool setTargetObj(const SmfActivityObject& aTarget);
+
+private:
+ QSharedDataPointer<SmfActivityEntryPrivate> d;
+
+ friend QDataStream& operator >> ( QDataStream &aOut, const SmfActivityEntry& aData);
+ friend QDataStream& operator << ( QDataStream &aIn, const SmfActivityEntry& aData);
+ };
+// Make the class SmfActivityEntry known to QMetaType, so that as to register it.
+Q_DECLARE_METATYPE(SmfActivityEntry)
+
+#endif /* SMFACTIONS_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/smf/smfservermodule/smfclient/common/smfactions_p.h Thu May 20 16:20:37 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 "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html"
+ *
+ * Initial Contributors:
+ * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
+ *
+ * Description:
+ * Contains private implementation of the smfactions
+ */
+
+#ifndef SMFACTIONS_P_H_
+#define SMFACTIONS_P_H_
+
+#include <QDateTime>
+#include <QSharedData>
+#include <QList>
+#include <QImage>
+#include <QDateTime>
+#include <QStringList>
+#include <QUrl>
+#include <qdatastream.h>
+#include <QSharedData>
+#include <QMetaType>
+
+#include "smfactions.h"
+
+class SmfActivityObjectPrivate: public QSharedData
+ {
+public:
+ SmfActivityObjectPrivate();
+ SmfActivityObjectPrivate(const SmfActivityObjectPrivate& aOther);
+ ~SmfActivityObjectPrivate();
+
+ /**
+ * Data members
+ */
+ QString m_id;
+ QImage m_thumbnail;
+ QString m_caption;
+ SmfActivityObjectType m_type;
+ QVariant m_objData;
+ QString m_link;
+ QDateTime m_time;
+ QString m_content;
+ };
+
+class SmfActivityEntryPrivate: public QSharedData
+ {
+public:
+ SmfActivityEntryPrivate();
+ SmfActivityEntryPrivate(const SmfActivityEntryPrivate& aOther);
+ ~SmfActivityEntryPrivate();
+
+ QString m_id;
+ SmfPost m_title;
+ SmfPost m_details;
+ SmfContact m_author;
+ SmfActivityVerb m_actionName;
+ QList<SmfActivityObject> m_activities;
+ SmfActivityObject m_targetObj;
+ };
+
+#endif /* SMFACTIONS_P_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/smf/smfservermodule/smfserver/smfplugins/smfactivityfetcherplugin.h Thu May 20 16:20:37 2010 +0530
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2010 Sasken Communication Technologies Ltd.
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html"
+ *
+ * Initial Contributors:
+ * Chandradeep Gandhi, Sasken Communication Technologies Ltd -
+ *
+ * Description:
+ * Interface specification for plugins that implements social activity related services
+ *
+ */
+#ifndef SMFACTIVITYFETCHERPLUGIN_H_
+#define SMFACTIVITYFETCHERPLUGIN_H_
+
+#include <smfpluginbase.h>
+#include <smfactivity.h>
+
+// Forward declaration
+class SmfPluginManagerUtil;
+
+/**
+ * @ingroup smf_plugin_group
+ * Interface specification for fetching social activity list for a user.
+ * This class provides basic functionality to allow applications to obtain list of
+ * activities like "marked as favourite", "commented on a picture" etc in a
+ * social networking service.
+ *
+ * All of the functionality described here should be implemented by a service
+ * specific plug-in.
+ */
+class SmfActivityFetcherPlugin : public SmfPluginBase
+ {
+public:
+ /**
+ * Constructor
+ * @param aUtil The SmfPluginManagerUtil instance. The plugins can
+ * call the method getAuthKeys() of this class, with its pluginID to
+ * get the OAuth keys, keys are returned only if this plugin is
+ * authorised by Smf franework
+ *
+ */
+ SmfActivityFetcherPlugin( SmfPluginManagerUtil* aUtil);
+
+ /**
+ * Destructor
+ */
+ ~SmfActivityFetcherPlugin();
+
+ /**
+ * Method to get the list of self activities, e.g. shown in own wall
+ * @param aRequest [out] The request data plugin generated (to be sent to network)
+ * @param aPageNum[in] The page to be extracted
+ * @param aItemsPerPage[in] Number of items per page
+ * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
+ */
+ virtual SmfPluginError selfActivities( SmfPluginRequestData &aRequest,
+ const int aPageNum = SMF_FIRST_PAGE,
+ const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0;
+
+ /**
+ * Method to get the list of activities for other, e.g. shown in a friends wall
+ * @param aRequest [out] The request data plugin generated (to be sent to network)
+ * @param aContact [in] The contact containing the URI, name or id of the user
+ * @param aPageNum[in] The page to be extracted
+ * @param aItemsPerPage[in] Number of items per page
+ * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
+ */
+ virtual SmfPluginError friendsActivities( SmfPluginRequestData &aRequest,
+ const SmfContact &aContact,
+ const int aPageNum = SMF_FIRST_PAGE,
+ const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0;
+
+ /**
+ * Method to get list of self activities filtered by activity type, e.g. only photo updates in own wall
+ * @param aRequest [out] The request data plugin generated (to be sent to network)
+ * @param aFilters [in] The list of activity types to be included in result
+ * @param aPageNum[in] The page to be extracted
+ * @param aItemsPerPage[in] Number of items per page
+ * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
+ */
+ virtual SmfPluginError filtered( SmfPluginRequestData &aRequest,
+ QList<SmfActivityObjectType> &aFilters,
+ const int aPageNum = SMF_FIRST_PAGE,
+ const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0;
+
+ };
+
+Q_DECLARE_INTERFACE( SmfActivityFetcherPlugin, "org.symbian.smf.plugin.activity.fetcher/v0.2" );
+
+#endif /* SMFACTIVITYFETCHERPLUGIN_H_ */