# HG changeset patch # User cgandhi # Date 1270551937 -19800 # Node ID 86af6c33360175dd730a76f5e4fb06b3535b28b3 # Parent 4b1e636e8a710ded02cefc8e5a954e9020e88f34 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts. Fixed following bugs 2381 and 2382. Added documentation Doxyfile. Modified example_usage.h to show similar usage. diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/Doxyfile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/Doxyfile Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,279 @@ +# Doxyfile 1.5.5 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = SMF +PROJECT_NUMBER = +OUTPUT_DIRECTORY = doc +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +TYPEDEF_HIDES_STRUCT = NO +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = NO +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = smf example_usage.cpp +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.vhd \ + *.vhdl +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = YES +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +HTML_DYNAMIC_SECTIONS = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = YES +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = YES +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/example_usage.cpp --- a/example/clientapi/example_usage.cpp Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/example_usage.cpp Tue Apr 06 16:35:37 2010 +0530 @@ -1,57 +1,127 @@ -#include -#include -#include -#include -#include -#include +#include "smfglobal.h" +#include "smfclient.h" +#include "smfprovider.h" +#include "smfgallery.h" +#include "smfcontact.h" +#include "smfpostprovider.h" +#include "smfcontactfetcher.h" +#include "smfmusic.h" +#include "smfpicture.h" +#include "smftrackinfo.h" +#include "smfmusicprofile.h" +#include "smflyrics.h" +#include +#include "qtcontacts.h" +#include +#include +#include + +using namespace QtMobility; +class MyAppView //: public QAbstractItemView + { +public: + void add(QImage pic); + void add(SmfTrackInfo trackInfo); + void add(QContact qc); + void setPicture(QImage image); + void setTitle(QString cap); + void setIcon(QImage image); + void setDescription(QString desc); + void setProvider(SmfProvider p); + void setLyricsData(SmfLyrics l); + }; + + +class MyApplication :public QObject + { + Q_OBJECT + +public slots: + void displayGallery(); + void showPicsSlot(SmfPictureList* pics, QString err); + void uploadPicture(QImage* picture, QList galleries); + void uploaded(bool success); + + void displayFriends(); + void showlist(SmfContactList* friendsList); + void postUpdate(); + void showPosts(SmfPostList* posts, QString err); + + void getMusic(SmfTrackInfo currTrack); + void showTrackSearch(SmfTrackInfoList* songs); + void showStore(SmfProviderList* stores); + void updateCurrentPlaying(QList musicServices, SmfTrackInfo currTrack); + void displayLyrics(SmfTrackInfo currTrack); + void showLyrics(SmfLyricsList* list); + +private: + MyAppView* m_view; + SmfGallery* m_smfgl; + SmfContactFetcher* m_smfcf; + SmfMusicService* m_smfms; + QList m_myfrndz; + }; /** 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 galleries = Smf::GetServices("org.symbian.smf.gallery\0.2"); + QList* galleries = SmfClient::GetServices("org.symbian.smf.gallery\0.2"); // We will use the first one now - SmfGallery myGallery = galleries[0]; + SmfProvider smfp = galleries->value(0); + SmfGallery* myGallery = new SmfGallery(&smfp); // 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()); + QImage imge = smfp.serviceIcon(); + QString desc = smfp.description(); + QString name = smfp.serviceName(); + m_view->setIcon(imge); + m_view->setProvider(smfp); + m_view->setDescription(desc); /** * Asynchrnous request to fetch the pictures. * The picturesAvailable() signal is emitted * with SmfPictureList once the pictures have arrived. */ - myGallery.pictures(); - QObject::connect(myGallery,SIGNAL(picturesAvailable(SmfPictureList*, QString, int)),this,SLOT(showPicsSlot(SmfPictureList*, QString))); + myGallery->pictures(); + connect(myGallery,SIGNAL(picturesAvailable(SmfPictureList*, QString, SmfResultPage )), + SLOT(showPicsSlot(SmfPictureList*, QString))); + + m_smfgl = myGallery; } -} + void MyApplication::showPicsSlot(SmfPictureList* pics, QString err) { //check err string if there is any error - + if(err.compare("Err")) return; //if no error - foreach(SmfPicture* pic, pics) { - m_view.add(pic); // do something with the picture in this gallery + foreach(SmfPicture pic, *pics) { + m_view->add(pic.picture() ); // 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 galleries) +void MyApplication::uploadPicture(QImage* picture, QList galleries) { /** * When uploading is finished we can check the success of the uploading */ - QObject::connect(myGallery,SIGNAL(uploadFinished(bool)),this,SLOT(uploaded(bool))); + QObject::connect(m_smfcf,SIGNAL(uploadFinished(bool)),SLOT(uploaded(bool))); + SmfPicture* smfPic = new SmfPicture(*picture); // The list could be from a selection of galleries chosen by the user, // think multiple TweetDeck accounts? - foreach(SmfGallery gallery, galleries) { - gallery.upload(picture); + foreach(SmfGallery gallery, galleries) + { + gallery.upload(smfPic); + } } - } + +/** + * Slot to catch the uploading finished event + */ void MyApplication::uploaded(bool success) { if(!success) @@ -68,13 +138,17 @@ void MyApplication::displayFriends() { // Some common interface for finding implementations. - QList contactFetcherList = Smf::GetServices("org.symbian.smf.contact.fetcher\0.2"); - //Request friend list, - //The friendsListAvailable() signal + QList* contactFetcherList = SmfClient::GetServices("org.symbian.smf.contact.fetcher\0.2"); + SmfProvider smfp = contactFetcherList->value(0); + SmfContactFetcher* smfcf = new SmfContactFetcher(&smfp); + + //Request friend list, the friendsListAvailable() signal //is emitted with SmfContactList once data is arrived. - QObject::Connect(contactFetcherList[0],SIGNAL(friendsListAvailable(SmfContactList*, QString, int)), - this,SLOT(showlist(SmfContactList*)); - fetcher.friends(); + QObject::connect(smfcf,SIGNAL(friendsListAvailable(SmfContactList*, QString, SmfResultPage )), + SLOT(showlist(SmfContactList*))); + smfcf->friends(); + + m_smfcf = smfcf; } void MyApplication::showlist(SmfContactList* friendsList) @@ -82,15 +156,17 @@ // 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() ); + m_view->setIcon( (m_smfcf->getProvider())->serviceIcon() ); + m_view->setDescription( (m_smfcf->getProvider())->description() ); //now display the images - foreach(SmfContact* contact, friendsList) { - QImage pic = contact.value("Avatar"); - m_view.setPicture(pic); - m_view.setTitle(contact.value("Name")); + foreach(SmfContact contact, *friendsList) { + QVariant data = contact.value("Avatar"); + QImage pic = data.value(); + QContact qc; + contact.convert(qc); + m_view->add(qc); + m_myfrndz.append(contact); } } /** @@ -99,66 +175,76 @@ void MyApplication::postUpdate() { // Some common interface for finding implementations. - QList postServices = Smf::GetServices("org.symbian.smf.contact.posts\0.2"); + QList* postServices = SmfClient::GetServices("org.symbian.smf.contact.posts\0.2"); //let us use the first one - SmfPostProvider myPostServer = postServices[ 0 ]; + QString servName = postServices->value(0).serviceName(); + if(!servName.compare("Facebook.com")) return; + SmfProvider smfp = postServices->value(0); + SmfPostProvider* myPostServer = new SmfPostProvider(&smfp); //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() ); + m_view->setIcon((myPostServer->getProvider())->serviceIcon() ); + m_view->setProvider(myPostServer->getProvider()); + m_view->setDescription((myPostServer->getProvider())->description() ); - SmfPost reply = new SmfPost(sampleString,samplmage, sampleUrl); + SmfPost reply("this is a text post", this); //post my udpate to be visible to all, connect to updatePostFinished() // signal of SmfPostProvider to track the success - myPostServer.updatePost(reply); + SmfContact frnd(m_myfrndz.value(0)); + myPostServer->postDirected(reply,frnd); //Asynchronously get all posts to me in my profle (e.g. twits from all friends) //connect to postsAvailable to show the post - postServices.getPosts(); + myPostServer->posts(); - QObject::Connect(myPostServer,SIGNAL(postsAvailable(SmfPostList*, QString, int)),this,SLOT(showPosts(SmfPostList*, QString))); + QObject::connect(myPostServer, + SIGNAL(postsAvailable(SmfPostList*, QString, SmfResultPage )), + SLOT(showPosts(SmfPostList*, QString))); } -void MyApplication::showPosts(SmfPostList* posts, QString err) +void MyApplication::showPosts(SmfPostList* posts, QString /*err*/) { //Show the first post - m_view.setPostData(posts->at(0)); + SmfPost post = posts->at(0); + m_view->setDescription( post.toPlainText() ); } /** * 5. This is an example of getting song recommendations from a social netowrking sites */ -void MyApplication::getMusic() +void MyApplication::getMusic(SmfTrackInfo currTrack) { // Some common interface for finding implementations. - QList musicServices = Smf::GetServices("org.symbian.smf.music\0.2"); + QList* smfProList = SmfClient::GetServices("org.symbian.smf.music\0.2"); + SmfProvider smfp = smfProList->value(0); + SmfMusicSearch* mServer = new SmfMusicSearch(&smfp); - //let us use the first one - SmfMusicSearch mServer = musicServices.at(0); - QObject::Connect(mServer,SIGNAL(trackSearchAvailable(SmfTrackInfoList*, QString,int)),this,SLOT(showTrackSearch(SmfTrackInfoList*))); - QObject::Connect(mServer,SIGNAL(storeSearchAvailable(SmfProviderList*, QString,int)),this,SLOT(showStoreSearch(SmfProviderList*))); + QObject::connect(mServer,SIGNAL(trackSearchAvailable(SmfTrackInfoList*, QString,SmfResultPage )),this,SLOT(showTrackSearch(SmfTrackInfoList*))); + QObject::connect(mServer,SIGNAL(storeSearchAvailable(SmfProviderList*, QString,SmfResultPage )),this,SLOT(showStoreSearch(SmfProviderList*))); //search songs similar to currently playing, //connect to trackSearchAvailable signal to get the result - mServer.recommendations(currTrack); + mServer->recommendations(currTrack); //display to the user - m_view.setIcon( mServer.serviceIcon() ); - m_view.setProvider( mServer.serviceName() ); - m_view.setDescription( mServer.description() ); + m_view->setIcon( mServer->getProvider()->serviceIcon() ); + m_view->setProvider( mServer->getProvider()); + m_view->setDescription( mServer->getProvider()->description() ); } void MyApplication::showTrackSearch(SmfTrackInfoList* songs) { - foreach(SmfTrackInfo* track, songs){ - m_view.add(track); + foreach(SmfTrackInfo track, *songs){ + m_view->add(track); } + QList* smfProList = SmfClient::GetServices("org.symbian.smf.client.music.search\0.2"); + SmfProvider smfp = smfProList->value(0); + SmfMusicSearch* mServer = new SmfMusicSearch(&smfp); //allow user to select a track and get purchase links //connect to showStoreSearch signal to display the stores for that track - mServer.stores(selectedTrack); + mServer->stores(songs->value(0)); } -void MyApplication::showStoreSearch(SmfProviderList* stores) +void MyApplication::showStore(SmfProviderList* /*stores*/) { //show stores } @@ -175,18 +261,21 @@ void MyApplication::displayLyrics(SmfTrackInfo currTrack) { + // Some common interface for finding implementations. - SmfLyricsService lyricsService = Smf::GetServices("org.symbian.smf.music.lyrics\0.2","lyricsfly.com"); - QObject::connect(lyricsService,SIGNAL(lyricsAvailable(SmfLyricsList*, QString, int)),this,SLOT(showLyrics(SmfLyricsList*)); + QList* smfProList = SmfClient::GetServices("org.symbian.smf.music.lyrics\0.2","lyricsfly.com"); + SmfProvider smfp = smfProList->value(0); + SmfLyricsService* lyricsService = new SmfLyricsService(&smfp); + QObject::connect(lyricsService,SIGNAL(lyricsAvailable(SmfLyricsList*, QString, SmfResultPage )),this,SLOT(showLyrics(SmfLyricsList*))); //Request to get the lyrics //lyricsAvailable() signal of SmfLyricsService is emitted when lyrics is available - lyricsService.lyrics(currTrack); + lyricsService->lyrics(currTrack); } void MyApplication::showLyrics(SmfLyricsList* list) { //now display the latest edited lyrics - qSort(list->begin(),list->end(),caseCompareTimeMoreThan); - m_view.setLyricsData(list->at(0)); + //qSort(list->begin(),list->end(),caseInsensitiveLessThan); + m_view->setLyricsData(list->at(0)); } diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/SmfClientGlobal.h --- a/example/clientapi/smf/inc/common/SmfClientGlobal.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/SmfClientGlobal.h Tue Apr 06 16:35:37 2010 +0530 @@ -16,18 +16,21 @@ * */ -#ifndef SMFCLIENTDEFS_H_ -#define SMFCLIENTDEFS_H_ +#ifndef SMFCLIENTGLOBAL_H_ +#define SMFCLIENTGLOBAL_H_ - #include +#include + - #ifdef SMFCLIENT_LIBRARY - # define SMFCLIENT_EXPORT Q_DECL_EXPORT - #else - # define SMFCLIENT_EXPORT Q_DECL_IMPORT - #endif +#ifdef SMFCLIENT_LIBRARY +# define SMFCLIENT_EXPORT Q_DECL_EXPORT +#else +# define SMFCLIENT_EXPORT Q_DECL_IMPORT +#endif + /** - * To be designed later - */ +* To be designed later +*/ #define SMF_GETSERVICES(INTERFACE,INTERFACESTRING) ; -#endif /* SMFCLIENTDEFS_H_ */ + +#endif /* SMFCLIENTGLOBAL_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfcomment/smfcomment.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfcomment/smfcomment.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,111 @@ +/** + * 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 comment class represents a comment (on a picture or a music track etc) + * + */ + +#ifndef SMFCOMMENT_H_ +#define SMFCOMMENT_H_ + +#include +#include +#include +#include + +class SmfCommentPrivate; + +/** + * @ingroup smf_common_group + * The comment class represents a comment (on a picture or a music track etc) + */ +class SMFCLIENT_EXPORT SmfComment : public QObject + { + Q_OBJECT +public: + /** + * Constructor with default argument + * @param aParent The parent object + */ + SmfComment( QObject *aParent = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfComment( const SmfComment &aOther ); + + /** + * Destructor + */ + ~SmfComment( ); + + /** + * Method to get the comment text + * @return The comment text + */ + QString text( ) const; + + /** + * Method to get the comment time stamp + * @return The comment time stamp value + */ + QDateTime timeStamp( ) const; + + /** + * Method to get the id of the comment + * @return The ID value + */ + QString id( ) const; + + /** + * Method to set the comment text + * @param aText The comment text to be set + */ + void setText( const QString &aText ); + +private: + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfComment &aComment ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfComment &aComment ); + + }; + + +/** + * Method for Externalization. Writes the SmfComment object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aComment The SmfComment object to be externalized + * @return reference to the written stream + */ +QDataStream &operator<<( QDataStream &aDataStream, + const SmfComment &aComment ); + +/** + * Method for Internalization. Reads a SmfComment object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aComment The SmfComment object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfComment &aComment); + +#endif /* SMFCOMMENT_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfcomment/smfcomment_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfcomment/smfcomment_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,55 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfComment class + * + */ + +#ifndef SMFCOMMENT_P_H_ +#define SMFCOMMENT_P_H_ + +#include +#include + +class SmfCommentPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfCommentPrivate( ) { m_text.clear(); m_commentId.clear(); } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfCommentPrivate( const SmfCommentPrivate &aOther ) : + QSharedData ( aOther ), + m_text ( aOther.m_text ), + m_timeStamp ( aOther.m_timeStamp ), + m_commentId ( aOther.m_commentId ) { } + + /** + * Destructor + */ + ~SmfCommentPrivate( ); + + QString m_text; // comment text + QDateTime m_timeStamp; // comment time stamp + QString m_commentId; + +}; + +#endif /* SMFCOMMENT_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfcontacts/smfcontact.h --- a/example/clientapi/smf/inc/common/smfcontacts/smfcontact.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfcontacts/smfcontact.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,147 +1,135 @@ -/************************************************************************************************** -* 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: -* Manasij Roy -* Description: -* Interface spefication for profile of a contact in a social networking site -* -/*************************************************************************************************/ +/** + * 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 contact class represents a social contact + * Note: This class has dependencies on QtMobility project + * + */ -#ifndef SMFPROFILE_H -#define SMFPROFILE_H +#ifndef SMFCONTACT_H_ +#define SMFCONTACT_H_ -#include - -//From Qt mobility project #include "qtcontacts.h" -#include "../common/SmfClientGlobal.h" -#include "smfprovider.h" +#include +#include +#include + +using namespace QtMobility; + +class SmfContactPrivate; + /** - * 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. + * @ingroup smf_common_group + * The contact class represents a social contact * - * All of the functionality described here should be implemented by a service - * specific plug-in object. - * Note this class has dependencies on QtMobility project + * Note: This class has dependencies on QtMobility project */ class SMFCLIENT_EXPORT SmfContact : public QObject -{ - Q_OBJECT + { + Q_OBJECT public: - /** - * Constructs SmfContact with base provider info - * Seeing as this is a plug-in implementation, these will realistically - * be generated by SMF factory of some kind - */ - SmfContact(SmfProvider* baseProvider = 0); - ~SmfContact(); + /** + * Constructor with default argument + * @param aParent The parent object + */ + SmfContact( QObject *aParent = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfContact( const SmfContact &aOther ); + + /** + * Destructor + */ + ~SmfContact( ); + +public slots: + /** + * Method to get the available sub fields for contacts. + * The following are the available sub types of a contact + * QtMobility::QContactAddress Address; + * QtMobility::QContactAnniversary Anniversary; + * QtMobility::QContactAvatar Avatar; + * QtMobility::QContactBirthday Birthday; + * QtMobility::QContactId ContactId; + * QtMobility::QContactEmailAddress EmailAddress; + * QtMobility::QContactGender Gender; + * QtMobility::QContactGeolocation Geolocation; + * QtMobility::QContactGuid Guid; + * QtMobility::QContactName Name; + * QtMobility::QContactNickname Nickname; + * QtMobility::QContactNote Note; + * QtMobility::QContactOnlineAccount OnlineAccount; + * QtMobility::QContactOrganization Organization; + * QtMobility::QContactPhoneNumber PhoneNumber; + * QtMobility::QContactTimestamp Timestamp; + * QtMobility::QContactType Type; + * QtMobility::QContactUrl Url; + * @return The Available sub fields for this contact + */ + QStringList subTypes( ) const; + + /** + * Method to convert an SmfContact to a QContact + * Changes made to the returned QContact will not be reflected + * in its parent SmfContact object + * @param aContact QContact corresponding to SmfContact + */ + void convert( QContact &aContact ) const; + + /** + * Method to get the value of a sub field for this contact + * @param aSubType The sub field type + * @return The value of the sub field subType + * @see subTypes() + */ + QVariant value( const QString& aSubType ) const; + +private: + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfContact &aContact ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfContact &aContact ); + + }; - /** - * Returns the available sub fields for contacts. - * The following subtypes are available,- - * QString userIdInProvider; - * QtMobility::QContactAddress Adress; - * QtMobility::QContactAnniversary Anniversary; - * QtMobility::QContactAvatar Avatar; - * QtMobility::QContactBirthday Birthday; - * QtMobility::QContactEmailAddress EmailAddress; - * QtMobility::QContactGender Gender; - * QtMobility::QContactGeolocation Geolocation; - * QtMobility::QContactGuid Guid; - * QtMobility::QContactName Name; - * QtMobility::QContactNickname Nickname; - * QtMobility::QContactNote Note; - * QtMobility::QContactOnlineAccount OnlineAccount; - * QtMobility::QContactOrganization Organization; - * QtMobility::QContactPhoneNumber PhoneNumber; - * QtMobility::QContactTimestamp Timestamp; - * QtMobility::QContactType Type; - * QtMobility::QContactUrl Url; - */ - virtual QStringList subTypes() const; - - //APIs to get base provider info (SmfProvider) - - /** - * Gets the base provider info, note setting the provider is not permitted here - */ - virtual SmfProvider* getProvider() = 0; - -public slots: +/** + * Method for Externalization. Writes the SmfContact object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aContact The SmfContact object to be externalized + * @return reference to the written stream + */ +QDataStream &operator<<( QDataStream &aDataStream, + const SmfContact &aContact ); /** - * Gets value of the sub field for any contact. - * @param subType sub field type - * @param info value of the sub field subType - * @see subTypes() - * The following subtypes are available,- - * QString userIdInProvider; - * QtMobility::QContactAddress Adress; - * QtMobility::QContactAnniversary Anniversary; - * QtMobility::QContactAvatar Avatar; - * QtMobility::QContactBirthday Birthday; - * QtMobility::QContactEmailAddress EmailAddress; - * QtMobility::QContactGender Gender; - * QtMobility::QContactGeolocation Geolocation; - * QtMobility::QContactGuid Guid; - * QtMobility::QContactName Name; - * QtMobility::QContactNickname Nickname; - * QtMobility::QContactNote Note; - * QtMobility::QContactOnlineAccount OnlineAccount; - * QtMobility::QContactOrganization Organization; - * QtMobility::QContactPhoneNumber PhoneNumber; - * QtMobility::QContactTimestamp Timestamp; - * QtMobility::QContactType Type; - * QtMobility::QContactUrl Url; + * Method for Internalization. Reads a SmfContact object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aContact The SmfContact object to be internalized + * @return reference to the stream */ - virtual void value(const QString& subType,const QVariant& info); //for any contact - - /** - * Sets the value of the sub field for self contact - * @param key sub field type - * @param value value to be set for sub field key - * @return success of the set - * @see subTypes() - */ - virtual bool setValue( const QString & key, const QVariant & value );//for self contact only - - -signals: -/** - * Emitted when value of self contact changes. - * @param key the key which is changed - */ - void detailsUpdated(const QString& key); //for setvalue on self contact - -private: - /** - * Conatact details - */ - QVariantMap m_details; - QString m_caption; - /** - * Externalization - */ -}; - /** - * Externalization - */ - QDataStream &operator<<(QDataStream &, const SmfContact&); - /** - * Internalization - */ -QDataStream &operator>>(QDataStream &, SmfContact&); -SMF_GETSERVICES(SmfContact, "org.symbian.smf.client.contact") -#endif // SMFPROFILE_H +QDataStream &operator>>( QDataStream &aDataStream, + SmfContact &aContact ); + +#endif /* SMFCONTACT_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfcontacts/smfcontact_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfcontacts/smfcontact_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,52 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfContact class + * + */ + +#ifndef SMFCONTACT_P_H_ +#define SMFCONTACT_P_H_ + +#include + +using namespace QtMobility; + +class SmfContactPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfContactPrivate( ) { m_details.clear(); } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfContactPrivate( const SmfContactPrivate &aOther ) : + QSharedData ( aOther ), + m_details ( aOther.m_details ) { } + + /** + * Destructor + */ + ~SmfContactPrivate( ); + + QVariantMap m_details;// contact details + +}; + +#endif /* SMFCONTACT_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfcontacts/smfgroup.h --- a/example/clientapi/smf/inc/common/smfcontacts/smfgroup.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfcontacts/smfgroup.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,63 +1,107 @@ /** -* 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: -* Manasij Roy -* Description: -* Interface spefication for smf service provider -* -*/ + * 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 group class represents an instance of a group as per SN site terminolgy + * + */ #ifndef SMFGROUP_H_ #define SMFGROUP_H_ -#include "SmfClientGlobal.h" -class SmfContact; -//List of SmfContacts -typedef QList SmfContactList; +#include +#include +#include +#include + +class SmfGroupPrivate; + + /** - * class for a group in social network + * @ingroup smf_common_group + * The group class represents an instance of a group as per SN site terminolgy */ class SMFCLIENT_EXPORT SmfGroup : public QObject { Q_OBJECT public: + /** + * Constructor with default argument + * @param list The list of members in the group + */ + SmfGroup( QList* list = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfGroup( const SmfGroup &aOther ); /** - * Constructs a group with list of contacts + * Destructor */ - SmfGroup(SmfContactList* list=0); + ~SmfGroup( ); + +public slots: /** - *Returns list of members in the group - *@return list of members + * Method to get the list of members in the group + * @return The list of members in the group */ - SmfContactList* members() - { - return m_members; - } + QList members( ) const; + + /** + * Method to get the name of the group + * @return The name of the group + */ + QString name( ) const; /** - * Sets the group members - * @param members list of members to be added to the group + * Method to get the id of the group + * @return The ID value */ - void setMembers(SmfContactList& members); + QString id( ) const; + private: - SmfContactList* m_members; + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfGroup &aGroup ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfGroup &aGroup ); + }; + + /** - * Externalization + * Method for Externalization. Writes the SmfGroup object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aGroup The SmfGroup object to be externalized + * @return reference to the written stream */ -QDataStream &operator<<(QDataStream &, const SmfGroup &); +QDataStream &operator<<( QDataStream &aDataStream, + const SmfGroup &aGroup ); + /** - * Internalization + * Method for Internalization. Reads a SmfGroup object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aGroup The SmfGroup object to be internalized + * @return reference to the stream */ -QDataStream &operator>>(QDataStream &, SmfGroup &); +QDataStream &operator>>( QDataStream &aDataStream, + SmfGroup &aGroup); + #endif /* SMFGROUP_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfcontacts/smfgroup_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfcontacts/smfgroup_p.h Tue Apr 06 16:35:37 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 "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: + * Private class implemented for implicit sharing of SmfGroup class + * + */ + +#ifndef SMFGROUP_P_H_ +#define SMFGROUP_P_H_ + +#include +#include + +class SmfGroupPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfGroupPrivate( ) { m_members = NULL; m_groupName.clear(); m_groupId.clear(); } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfGroupPrivate( const SmfGroupPrivate &aOther ) : + QSharedData ( aOther ), + m_members ( aOther.m_members ), + m_groupName ( aOther.m_groupName ), + m_groupId ( aOther.m_groupId ) { } + + /** + * Destructor + */ + ~SmfGroupPrivate( ); + + QList *m_members; // members in the group + QString m_groupName; + QString m_groupId; + // Other details to be added +}; + + +#endif /* SMFGROUP_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfcontacts/smfpost.h --- a/example/clientapi/smf/inc/common/smfcontacts/smfpost.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfcontacts/smfpost.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,75 +1,153 @@ /** -* 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: -* Manasij Roy -* Description: -* Interface spefication for sfm service provider -* -*/ + * 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 post class represents an instance of a post to a SN site + * + */ #ifndef SMFPOST_H_ #define SMFPOST_H_ -#include "SmfClientGlobal.h" + +#include +#include +#include +#include +#include +#include + +class SmfPostPrivate; + + /** - * class for post, later may be we need to add media. - * Post consists of a title and description + * @ingroup smf_common_group + * The post class represents an instance of a post to a SN site */ - -class SMFCLIENT_EXPORT SmfPost : public QObject +class SMFCLIENT_EXPORT SmfPost : public QTextDocument { Q_OBJECT public: /** - * Constructs a post + * Constructor with default argument + * @param text Text + * @param aParent The parent object + */ + SmfPost( QString text,QObject *aParent = 0 ); + + /** + * Constructor + * @param aText The post's text + * @param aImage The post's image + * @param aUrl The post's url */ - SmfPost(QObject* provider=0); + SmfPost( QString aTitle, QString aDesc, QImage aImage, QUrl aUrl ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfPost( const SmfPost &aOther ); + + /** + * Destructor + */ + ~SmfPost( ); /** - * Constructs a post with text,image and url + * Method to get the title of the post + * @return The post's title */ - SmfPost(QString text,QPixmap image, QString url); - ~SmfPost(); + QString title( ) const; + + /** + * Method to get the description of the post + * @return The post's description + */ + QString description( ) const; /** - * Gets post title + * Method to get the image of the post + * @return The post's image */ - QString* getTitle(); + QImage image( ) const; /** - * Gets post text + * Method to get the url of the post + * @return The post's url */ - QString* getDescription(); + QUrl url( ) const; + + /** + * Method to get the id of the post + * @return The ID value + */ + QString id( ) const; /** - * Sets post title + * Method to set the title of the post + * @param aTitle The post's new title */ - void setTitle(QString* title); + void setTitle( const QString &aTitle ); + + /** + * Method to set the description of the post + * @param aDesc The post's new description + */ + void setDescription( const QString &aDesc ); + + /** + * Method to set the image of the post + * @param aPic The post's image + */ + void setImage( const QImage& aPic ); /** - * Sets post text + * Method to set the url of the post + * @param aUrl The post's url */ - void setDescription(QString* desc); + void setUrl( QUrl& aUrl ); + +private: + QSharedDataPointer d; -private: - QString m_text; - QPixmap m_image; - QString m_url; + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfPost &aPost ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfPost &aPost ); + }; -/** -* Externalization -*/ -QDataStream &operator<<(QDataStream &, const SmfPost&); + + /** - * Internalization + * Method for Externalization. Writes the SmfPost object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aPost The SmfPost object to be externalized + * @return reference to the written stream */ -QDataStream &operator>>(QDataStream &, SmfPost&); +QDataStream &operator<<( QDataStream &aDataStream, + const SmfPost &aPost ); + +/** + * Method for Internalization. Reads a SmfPost object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aPost The SmfPost object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfPost &aPost); + #endif /* SMFPOST_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfcontacts/smfpost_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfcontacts/smfpost_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,70 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfPost class + * + */ + +#ifndef SMFPOST_P_H_ +#define SMFPOST_P_H_ + +#include + +class SmfPostPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfPostPrivate( ) { m_title.clear(); m_desc.clear(); m_url.clear(); m_postId.clear(); } + + /** + * Constructor + */ + SmfPostPrivate( QString aTitle, QString aDesc, QImage aImage, QUrl aUrl ) + { + m_title = aTitle; + m_desc = aDesc; + m_image = aImage; + m_url = aUrl; + m_postId.clear(); + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfPostPrivate( const SmfPostPrivate &aOther ) : + QSharedData ( aOther ), + m_title ( aOther.m_title ), + m_desc ( aOther.m_desc ), + m_image ( aOther.m_image ), + m_url ( aOther.m_url ), + m_postId ( aOther.m_postId ) { } + + /** + * Destructor + */ + ~SmfPostPrivate( ); + + QString m_title; // title + QString m_desc; // description + QImage m_image; // image + QUrl m_url; // url + QString m_postId; // post's unique Id + +}; + +#endif /* SMFPOST_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfdes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfdes.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,66 @@ +/** + * 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: + * Intro Page + * + * @ref smf_high_level_design + */ + +/** + * @mainpage SMF (Social Mobile Framework Interfaces) + * @defgroup smf_high_level_design SMF high level design + * + * Social Mobile Framework is a application level framework which allows Qt Applications + * use the common web APIs to perform social web activities. + * + * Product name is "SMF" + * + * For details please refer to http://developer.symbian.org/wiki/index.php/Social_Mobile_Framework + * + * @section smf_interfaces SMF Interfaces + * + * There are two sets of interfaces - + * @subsection smf_client_interfaces Client Interfaces + * - Client Applications (e.g. Media Player, Contacts, Game) uses these APIs to access SMF. see @ref smf_client_group + * + * @subsection smf_plugin_interfaces Plugin Interfaces + * - Service Providers (e.g. Facebook, Flickr, last.fm) implements these APIs to provide service to SMF - see @ref smf_plugin_group + * + * Currently, @ref smf_client_interfaces and @ref smf_plugin_interfaces are defined for remote contacts, remote + * image gallery and remote music services. There are common classes defined for holding data accross clients + * and plugins, present in inc\common, see - @ref smf_common_group + * + * + * @section smf_client_usage Client Usage Example + * - This shows how to use the SMF client APIs in applications, e.g. Client can define suitable Models using lists returned by these APIs + * - how to fetch a list of contacts from a remote server e.g. Facebook, see @ref MyApplication::displayFriends() + * - how to get a @ref QContact from a SmfContacts see @ref MyApplication::showlist() + * - how to get a list of images from a remote gallery e.g. Flickr.com, see @ref MyApplication::displayGallery() + * - how to post privately to a contact see @ref MyApplication::postUpdate() + * - how to tell others about the music you are currently listen to, see @ref MyApplication::updateCurrentPlaying() + * + * + * @section smf_dependency Dependency + * SMF uses QtMobility for mainly contacts information, see QtMobility project. + */ +/** + * @defgroup smf_common_group Common Data Classes + */ +/** + * @defgroup smf_client_group Client Classes + */ +/** + * @defgroup smf_plugin_group Plugin Classes + */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfevent/smfevent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfevent/smfevent.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,169 @@ +/** + * 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 SMFEVENT_H_ +#define SMFEVENT_H_ + +#include +#include +#include +#include +#include +#include + +class SmfEventPrivate; + +/** + * @ingroup smf_common_group + * The event class represents an event + */ +class SMFCLIENT_EXPORT SmfEvent : public QObject + { + Q_OBJECT +public: + /** + * Constructor with default argument + * @param aParent The parent object + */ + SmfEvent( QObject *aParent = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfEvent( const SmfEvent &aOther ); + + /** + * Destructor + */ + ~SmfEvent( ); + + /** + * Method to get the event name + * @return The event name + */ + QString title( ) const; + + /** + * Method to get the event date and time + * @return The date and time of the event + */ + QDateTime eventDateTime( ) const; + + /** + * Method to get the event duration + * @return The duration of the event + */ + QTime duration( ) const; + + /** + * Method to get the artist names + * @return The list of artists in the event + */ + SmfArtists artists( ) const; + + /** + * Method to get the venue of the event + * @return The venue of the event + */ + SmfPlace venue( ) const; + + /** + * Method to get the URL for getting tickets for the event + * @return The Url for getting ticket for the event + */ + QUrl ticketUrl( ) const; + + /** + * Method to get the id of the event + * @return The ID value + */ + QString id( ) const; + + /** + * Method to set the event name + * @param aName The new event name + */ + void setTitle( const QString &aName ); + + /** + * Method to set the event date and time + * @param aDateTime The new date and time of the event + * + */ + void setEventDateTime( const QDateTime &aDateTime ); + + /** + * Method to set the event duration + * @param aDuration The new duration of the event + * + */ + void setDuration( const QTime &aDuration ); + + /** + * Method to set the artist + * @param aArtists The new artists in the event + */ + void setArtists( const SmfArtists &aArtists ); + + /** + * Method to set the venue name + * @param aVenue The new venue of the event + */ + void setVenue( const SmfPlace &aVenue ); + + /** + * Method to set the URL for getting tickets for the event + * @param aUrl The new Url for getting ticket for the event + */ + void setTicketUrl( const QUrl &aUrl ); + +private: + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfEvent &aEvent ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfEvent &aEvent ); + + }; + + +/** + * Method for Externalization. Writes the SmfEvent object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aEvent The SmfEvent object to be externalized + * @return reference to the written stream + */ +QDataStream &operator<<( QDataStream &aDataStream, + const SmfEvent &aEvent ); + +/** + * Method for Internalization. Reads a SmfEvent object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aEvent The SmfEvent object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfEvent &aEvent); + +#endif /* SMFEVENT_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfevent/smfevent_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfevent/smfevent_p.h Tue Apr 06 16:35:37 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 "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: + * Private class implemented for implicit sharing of SmfEvent class + * + */ + +#ifndef SMFEVENT_P_H_ +#define SMFEVENT_P_H_ + + +#include +#include +#include +#include + +class SmfEventPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfEventPrivate( ) { + m_name.clear(); + m_url.clear(); + m_eventId.clear(); + + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfEventPrivate( const SmfEventPrivate &aOther ) : + QSharedData ( aOther ), + m_name ( aOther.m_name ), + m_dateTime ( aOther.m_dateTime ), + m_duration ( aOther.m_duration ), + m_artists ( aOther.m_artists ), + m_venue ( aOther.m_venue ), + m_url ( aOther.m_url ), + m_eventId ( aOther.m_eventId ) { } + + /** + * Destructor + */ + ~SmfEventPrivate( ); + + QString m_name; // event name + QDateTime m_dateTime; // event date and time + QTime m_duration; // event duration + SmfArtists m_artists; // event artist names + SmfPlace m_venue; // venue of the event + QUrl m_url; // ticket url + QString m_eventId; + +}; + +#endif /* SMFEVENT_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfglobal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfglobal.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,275 @@ +/** + * 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 smfglobal.h files contains all global data common to Smf framework + * + */ + +#ifndef SMFGLOBAL_H_ +#define SMFGLOBAL_H_ + +#include +#include +#include + +/** + * Exact definition to be decided later + */ +#define SMF_SERVICE_NAME(INTERFACE,INTERFACENAME) + +/** + * Indicates first page for a web query + */ +const int SMF_FIRST_PAGE=0; + +/** + * Default value for per page item for web queries + */ +const int SMF_ITEMS_PER_PAGE=10; + + +/** + * Enum declaration for Network status information + */ +enum SmfNetworkStatus + { + SmfNetworkConnectedHome = 0, + SmfNetworkConnectedRoaming, // value = 1 + SmfNetworkStateNotKnown, // value = 2 + SmfNetworkConnected, // value = 3 + SmfNetworkNotConnected // value = 4 + }; + +/** + * Enum declaration for result of transport initialize operation + */ +enum SmfTransportInitializeResult + { + SmfTransportInitNetworkNotAvailable = 0, + SmfTransportInitRoamingNetworkUsageNotEnabled, // value = 1 + SmfTransportInitNoError // value = 2 + }; + +/** + * The enumeration used to indicate result of transport to the plugins + */ +enum SmfTransportResult + { + SmfTransportOpNoError = 0, + SmfTransportOpConnectionRefusedError, + SmfTransportOpRemoteHostClosedError, + SmfTransportOpHostNotFoundError, + SmfTransportOpTimeoutError, + SmfTransportOpOperationCanceledError, + SmfTransportOpSslHandshakeFailedError, + SmfTransportOpProxyConnectionRefusedError, + SmfTransportOpProxyConnectionClosedError, + SmfTransportOpProxyNotFoundError, + SmfTransportOpProxyTimeoutError, + SmfTransportOpProxyAuthenticationRequiredError, + SmfTransportOpContentAccessDenied, + SmfTransportOpContentOperationNotPermittedError, + SmfTransportOpContentNotFoundError, + SmfTransportOpAuthenticationRequiredError, + SmfTransportOpContentReSendError, + SmfTransportOpProtocolUnknownError, + SmfTransportOpProtocolInvalidOperationError, + SmfTransportOpUnknownNetworkError, + SmfTransportOpUnknownProxyError, + SmfTransportOpUnknownContentError, + SmfTransportOpProtocolFailure, + SmfTransportOpUnknownError, + SmfTransportOpIAPChanged, + SmfTransportOpCancelled + }; + +/** + * The enumeration used to indicate result of plugin manager operations + */ +enum SmfPluginManagerResult + { + SmfPluginNoError = 0, + SmfPluginNotFound, + SmfPluginNotLoaded, + SmfPluginLoaded, + SmfPluginLoadError, + SmfPluginAuthorised, + SmfPluginNotAuthorised, + SmfPluginUnknownService, + SmfPluginRequestSendingFailed, + SmfPluginSOPCheckFailed, + SmfPluginServiceError, + SmfPluginUnknownError + }; + + +/** + * The enumeration used to denote errors reported by plugin + * Smf can't continue without handling these errors + */ +enum SmfPluginError + { + SmfPluginErrNone = 0, + SmfPluginErrTooManyRequest, + SmfPluginErrRequestQuotaExceeded, + SmfPluginErrInvalidRequest, + SmfPluginErrUserNotLoggedIn, + SmfPluginErrAuthenticationExpired, + SmfPluginErrPermissionDenied, + SmfPluginErrInvalidApplication, + SmfPluginErrServiceUnavailable, + SmfPluginErrServiceTemporaryUnavailable, + SmfPluginErrFormatNotSupported, + SmfPluginErrDataSizeExceeded + }; + +/** + * The enumeration used to track the plugin methods return type + */ +enum SmfPluginRetType + { + SmfSendRequestAgain = 0, + SmfRequestComplete, + SmfRequestError + }; + + +/** + * The enumeration used to indicate the type of network operation done + */ +enum SmfRequestOperation + { + SmfContactGetFriends = 0, + SmfContactGetFollowers, + SmfContactSearch, + SmfContactGerGroups, + SmfContactSearchInGroup, + SmfContactGetPosts, + SmfContactUpdatePost, + SmfContactUpdatePostDirected, + SmfContactPostAppearence, + SmfMusicGetLyrics, + SmfMusicGetSubtitle, + SmfMusicGetEventsOnLoc, + SmfMusicGetVenueOnLoc, + SmfMusicGetEventsOnVenue, + SmfMusicPostEvents, + SmfMusicGetRecommendations, + SmfMusicGetTracks, + SmfMusicGetTrackInfo, + SmfMusicGetStores, + SmfMusicPostCurrentPlaying, + SmfMusicGetUserInfo, + SmfMusicSearchUser, + SmfMusicGetPlaylists, + SmfMusicGetPlaylistsOfUser, + SmfMusicAddToPlaylist, + SmfMusicPostCurrentPlayingPlaylist, + SmfPictureGetPictures, + SmfPictureDescription, + SmfPictureUpload, + SmfPictureMultiUpload, + SmfPicturePostComment + + }; + + +/** + * The structure used to hold the request created by the plugins + */ +struct SmfPluginRequestData + { + /** + * Indicates the type of operation performed, like getting Friends + * list, upload image etc + */ + SmfRequestOperation iRequestType; + + /** + * The QNetworkRequest that has to be filled up by the plugins + */ + QNetworkRequest iNetworkRequest; + + /** + * The data to be posted in case of HTTP POST operation + */ + QBuffer *iPostData; + + /** + * The type of HTTP transaction, like GET, POST etc + */ + QNetworkAccessManager::Operation iHttpOperationType; + + }; + +/** + * The structure used to hold the request created by the plugins + */ +struct SmfResultPage + { + /** + * The total number of items + */ + uint iTotalItems; + + /** + * The number of items per page + */ + uint iItemsPerPage; + + /** + * The total number of pages + */ + uint iTotalPages; + + /** + * The current fetched page number + */ + uint iPageNum; + }; + +/** + * The structure used to track the data usage of each plugins + */ +struct SmfPluginDataUsage + { + /** + * Application that called the plugin + */ + QString iAppName; + + /** + * Interface implemented by the plugin + */ + QString iInterfaceName; + + /** + * The service provider + */ + QString iServiceProviderName; + + /** + * number of bytes sent for this plugin + */ + uint iBytesSent; + + /** + * number of bytes received for this plugin + */ + uint iBytesReceived; + + }; + +#endif /* SMFGLOBAL_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfalbum.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfmusic/smfalbum.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,112 @@ +/** + * 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 SmfAlbum class represents a music album + * + */ +#ifndef SMFALBUM_H_ +#define SMFALBUM_H_ + +#include +#include +#include +#include + +class SmfAlbumPrivate; +class SmfArtists; + +/** + * @ingroup smf_common_group + * The SmfAlbum class represents a music album + */ +class SMFCLIENT_EXPORT SmfAlbum : public QObject + { + Q_OBJECT +public: + /** + * Constructor with default argument + * @param aParent The parent object + */ + SmfAlbum( QObject *aParent = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfAlbum( const SmfAlbum &aOther ); + + /** + * Destructor + */ + ~SmfAlbum( ); + + /** + * Method to get the album name + * @return The album name + */ + QString name( ) const; + + /** + * Method to get the album's image + * @return The album's image + */ + QImage image( ) const; + + /** + * Method to get the artist names + * @return The list of artists in the album + */ + SmfArtists artists( ) const; + + /** + * Method to get the id of the album + * @return The ID value + */ + QString id( ) const; + +private: + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfAlbum &aAlbum ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfAlbum &aAlbum ); + + }; + + +/** + * Method for Externalization. Writes the SmfAlbum object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aAlbum The SmfAlbum object to be externalized + * @return reference to the written stream + */ +QDataStream &operator<<( QDataStream &aDataStream, + const SmfAlbum &aAlbum ); + +/** + * Method for Internalization. Reads a SmfAlbum object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aAlbum The SmfAlbum object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfAlbum &aAlbum); + + +#endif /* SMFALBUM_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfalbum_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfmusic/smfalbum_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,62 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfAlbum class + * + */ + +#ifndef SMFALBUM_P_H_ +#define SMFALBUM_P_H_ + +#include +#include +#include + +class SmfAlbumPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfAlbumPrivate( ) { + m_name.clear(); + m_albumId.clear(); + + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfAlbumPrivate( const SmfAlbumPrivate &aOther ) : + QSharedData ( aOther ), + m_name ( aOther.m_name ), + m_image ( aOther.m_image ), + m_artists ( aOther.m_artists ), + m_albumId ( m_albumId.m_eventId ) { } + + /** + * Destructor + */ + ~SmfAlbumPrivate( ); + + QString m_name; // album name + QImage m_image; // album image + SmfArtists m_artists; // album's artists + QString m_albumId; + +}; + +#endif /* SMFALBUM_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfartists.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfmusic/smfartists.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,107 @@ +/** + * 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 SmfArtists class represents the artists in a track or an album + * + */ + +#ifndef SMFARTISTS_H_ +#define SMFARTISTS_H_ + +#include +#include +#include +#include +#include + +class SmfArtistsPrivate; + +/** + * @ingroup smf_common_group + * The SmfArtists class represents the artists in a track or an album + */ +class SMFCLIENT_EXPORT SmfArtists : public QObject + { + Q_OBJECT +public: + /** + * Constructor with default argument + * @param aParent The parent object + */ + SmfArtists( QObject *aParent = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfArtists( const SmfArtists &aOther ); + + /** + * Destructor + */ + ~SmfArtists( ); + + /** + * Method to get the artists names + * @return The list of artists + */ + QStringList names( ) const; + + /** + * Method to get the image of the artists + * @return The image of te artists + */ + QImage image( ) const; + + /** + * Method to get the url of the artists + * @return The url of the artists + */ + QUrl url( ) const; + +private: + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfArtists &aArtists ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfArtists &aArtists ); + + }; + + +/** + * Method for Externalization. Writes the SmfArtists object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aArtists The SmfArtists object to be externalized + * @return reference to the written stream + */ +QDataStream &operator<<( QDataStream &aDataStream, + const SmfArtists &aArtists ); + +/** + * Method for Internalization. Reads a SmfArtists object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aArtists The SmfArtists object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfArtists &aArtists); + + +#endif /* SMFARTISTS_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfartists_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfmusic/smfartists_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,59 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfArtists class + * + */ + +#ifndef SMFARTISTS_P_H_ +#define SMFARTISTS_P_H_ + +#include +#include +#include + +class SmfArtistsPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfArtistsPrivate( ) { + m_names.clear(); + m_url.clear(); + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfArtistsPrivate( const SmfArtistsPrivate &aOther ) : + QSharedData ( aOther ), + m_names ( aOther.m_names ), + m_image ( aOther.m_image ), + m_url ( aOther.m_url ) { } + + /** + * Destructor + */ + ~SmfArtistsPrivate( ); + + QStringList m_names; // artist names + QImage m_image; // image + QUrl m_url; // url +}; + + +#endif /* SMFARTISTS_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfevent.h --- a/example/clientapi/smf/inc/common/smfmusic/smfevent.h Thu Mar 25 14:44:08 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/** - * @file smfevent.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * 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}". - * - * @section DESCRIPTION - * - * The event class represents a music event - */ - -#ifndef SMFEVENT_H_ -#define SMFEVENT_H_ - -#include -#include -#include -#include "SmfClientGlobal.h" -/** - * The event class represents a music event - */ -class SMFCLIENT_EXPORT SmfEvent : public QObject - { - Q_OBJECT -public: - /** - * Constructor with default argument - * @param aParent The parent object - */ - SmfEvent( QObject *aParent = 0 ); - - /** - * Destructor - */ - ~SmfEvent( ); - - /** - * Method to get the event name - * @param aName The event name - */ - void getTitle( QString &aName ); - - /** - * Method to get the event date and time - */ - void getEventDateTime( QDateTime &aDateTime ); - - /** - * Method to get the artist names - * @param aArtist The list of artists in the event - */ - void getArtists( QStringList &aArtist ); - - /** - * Method to get the venue of the event - * @param aVenue The venue of the event - */ - void getVenue( SmfVenue &aVenue ); - - /** - * Method to get the URL for getting tickets for the event - * @param aUrl The Url for getting ticket for the event - */ - void getTicketUrl( QUrl &aUrl ); - - /** - * Method to get the id of the event - * @param aId The ID value - */ - void getId( QString &aId ); - - /** - * Method to set the event name - * @param aName The new event name - */ - void setTitle( const QString& aName ); - - /** - * Method to set the event date and time - * @param aDateTime The new date and time of the event - * - */ - void setEventDateTime( const QDateTime& aDateTime ); - - /** - * Method to set the artist names - * @param aArtist The new list of artists in the event - */ - void setArtists( const QStringList& aArtist ); - - /** - * Method to set the venue name - * @param aVenue The new venue of the event - */ - void setVenue( const SmfVenue& aVenue ); - - /** - * Method to set the URL for getting tickets for the event - * @param aUrl The new Url for getting ticket for the event - */ - void setTicketUrl( const QUrl &aUrl ); - -private: - QStringList m_name; // event name - QDateTime m_dateTime; // event date and time - QStringList m_artistName; // event artist names - SmfVenue m_venue; // venue of the event - QUrl m_url; // ticket url - QString m_eventId; - - }; -/** -* Externalization -*/ -QDataStream &operator<<(QDataStream &, const SmfEvent&); -/** - * Internalization - */ -QDataStream &operator>>(QDataStream &, SmfEvent&); - -#endif /* SMFEVENT_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smflyrics.h --- a/example/clientapi/smf/inc/common/smfmusic/smflyrics.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfmusic/smflyrics.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,30 +1,34 @@ /** - * @file smflyrics.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * 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}". + * 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 * - * @section DESCRIPTION + * Description: + * The SmfLyrics class represents an instance of a music track's lyrics * - * The lyrics class represents an instance of a music track's lyrics */ #ifndef SMFLYRICS_H_ #define SMFLYRICS_H_ -#include #include #include -#include "SmfClientGlobal.h" +#include +#include + +class SmfLyricsPrivate; + /** + * @ingroup smf_common_group * The lyrics class represents an instance of a music track's lyrics */ class SMFCLIENT_EXPORT SmfLyrics : public QObject @@ -38,61 +42,70 @@ SmfLyrics( QObject *aParent = 0 ); /** + * Copy Constructor + * @param aOther The reference object + */ + SmfLyrics( const SmfLyrics &aOther ); + + /** * Destructor */ ~SmfLyrics( ); - + /** * Method to get the lyrics - * @param aLyrics The lyrics content + * @return The lyrics data */ - void getLyrics( QByteArray &aLyrics ); + QByteArray lyrics( ) const; /** * Method to get the language - * @param aLanguage The language - */ - void getLanguage( QString &aLanguage ); - - /** - * Method to get the frame rate - * @return the frame rate + * @return The language */ - double getFrameRate( ); - - /** - * Method to get the duration - * @return the duration - */ - double getDuration( ); + QString language( ) const; /** * Method to get the release year - * @param aRelYear The release year + * @return The release year */ - void getReleaseYear( QDateTime &aRelYear ); + QDateTime releaseYear( ) const; /** * Method to get the id of the lyrics - * @param aId The ID value + * @return The ID value */ - void getId( QString &aId ); - + QString id( ) const; + private: - QByteArray m_lyrics; // lyrics data - QString m_language; // language - double m_frameRate; // frame rate - double m_duration; // duration - QDateTime m_releaseYr; // release year - QString m_lyricsId; // lyrics id + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfLyrics &aLyrics ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfLyrics &aLyrics ); }; -/** -* Externalization -*/ -QDataStream &operator<<(QDataStream &, const SmfLyrics&); + + /** - * Internalization + * Method for Externalization. Writes the SmfLyrics object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aLyrics The SmfLyrics object to be externalized + * @return reference to the written stream */ -QDataStream &operator>>(QDataStream &, SmfLyrics&); +QDataStream &operator<<( QDataStream &aDataStream, + const SmfLyrics &aLyrics ); + +/** + * Method for Internalization. Reads a SmfLyrics object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aLyrics The SmfLyrics object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfLyrics &aLyrics); + #endif /* SMFLYRICS_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smflyrics_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfmusic/smflyrics_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,61 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfLyrics class + * + */ + +#ifndef SMFLYRICS_P_H_ +#define SMFLYRICS_P_H_ + +#include +#include + +class SmfLyricsPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfLyricsPrivate( ) { + m_lyrics.clear(); + m_language.clear(); + m_lyricsId.clear(); + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfLyricsPrivate( const SmfLyricsPrivate &aOther ) : + QSharedData ( aOther ), + m_lyrics ( aOther.m_lyrics ), + m_language ( aOther.m_language ), + m_releaseYr ( aOther.m_releaseYr ), + m_lyricsId ( aOther.m_lyricsId ) { } + + /** + * Destructor + */ + ~SmfLyricsPrivate( ); + + QByteArray m_lyrics; // lyrics data + QString m_language; // language + QDateTime m_releaseYr; // release year + QString m_lyricsId; // lyrics id + +}; + +#endif /* SMFLYRICS_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfmusicfingerprint.h --- a/example/clientapi/smf/inc/common/smfmusic/smfmusicfingerprint.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfmusic/smfmusicfingerprint.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,31 +1,36 @@ /** - * @file smfmusicfingerprint.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * 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}". + * 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 * - * @section DESCRIPTION + * Description: + * The SmfMusicFingerPrint class represents a music finger print used in searches * - * The musicfingerprint class represents a music finger print used in searches */ #ifndef SMFMUSICFINGERPRINT_H_ #define SMFMUSICFINGERPRINT_H_ -#include +#include +#include +#include + +class SmfMusicFingerPrintPrivate; /** + * @ingroup smf_common_group * The musicfingerprint class represents a music finger print used in searches */ -class SmfMusicFingerPrint : public QObject +class SMFCLIENT_EXPORT SmfMusicFingerPrint : public QObject { Q_OBJECT public: @@ -39,13 +44,42 @@ */ ~SmfMusicFingerPrint( ); + /** + * GEt the music finger print data + * @return The music finger print data + */ + QByteArray musicFingerPrint ( ) const; + +private: + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfMusicFingerPrint &aMFP ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfMusicFingerPrint &aMFP ); + }; + + /** -* Externalization -*/ -friend QDataStream &operator<<(QDataStream &, const SmfMusicFingerPrint&); + * Method for Externalization. Writes the SmfMusicFingerPrint object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aMFP The SmfMusicFingerPrint object to be externalized + * @return reference to the written stream + */ +QDataStream &operator<<( QDataStream &aDataStream, + const SmfMusicFingerPrint &aMFP ); + /** - * Internalization + * Method for Internalization. Reads a SmfMusicFingerPrint object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aMFP The SmfMusicFingerPrint object to be internalized + * @return reference to the stream */ -friend QDataStream &operator>>(QDataStream &, SmfMusicFingerPrint&); +QDataStream &operator>>( QDataStream &aDataStream, + SmfMusicFingerPrint &aMFP); + #endif /* SMFMUSICFINGERPRINT_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfmusicfingerprint_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfmusic/smfmusicfingerprint_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,51 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfMusicFingerPrint class + * + */ + +#ifndef SMFMUSICFINGERPRINT_P_H_ +#define SMFMUSICFINGERPRINT_P_H_ + +#include + +class SmfMusicFingerPrintPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfMusicFingerPrintPrivate( ); + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfMusicFingerPrintPrivate( const SmfMusicFingerPrintPrivate &aOther ) : + QSharedData ( aOther ), + m_fingerPrintData ( aOther.m_fingerPrintData ) { } + + /** + * Destructor + */ + ~SmfMusicFingerPrintPrivate( ); + + QByteArray m_fingerPrintData; + +}; + + +#endif /* SMFMUSICFINGERPRINT_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfmusicprofile.h --- a/example/clientapi/smf/inc/common/smfmusic/smfmusicprofile.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfmusic/smfmusicprofile.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,86 +1,124 @@ /** - * @file smfmusicprofile.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * 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}". + * 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 * - * @section DESCRIPTION + * Description: + * The music profile class represents a user's profile in music site * - * The music profile class represents a user's profile in music site */ #ifndef SMFMUSICPROFILE_H_ #define SMFMUSICPROFILE_H_ +#include +#include #include -#include "SmfClientGlobal.h" +#include +#include -#include "smfcontact.h" -class SmfTrackInfo; -class SmfEventsList; -typedef QList SmfTrackInfoList; -/** - * User profile containing music usage and interest info, extends SmfContact. - * Consists of,- - * 1. Conatct info - * 2. Music usage info as SmfTrackInfoList - * 3. Interest info as SmfTrackInfoList - * 4. Events SmfEventsList - */ -class SMFCLIENT_EXPORT SmfMusicProfile : public SmfContact - { - Q_OBJECT +class SmfMusicProfilePrivate; - public: - // Seeing as this is a plug-in implementation, these will realistically - // be generated by SMF factory of some kind - SmfMusicProfile(QObject* parent = 0); - ~SmfMusicProfile(); - - /** - * Gets the music usage info of the user as list of SmfTrackInfo - */ - SmfTrackInfoList* getMusicUsageInfo(); - - /** - * Gets the music interest info of the user as list of SmfTrackInfo - */ - SmfTrackInfoList* getInterestInfo(); - - /** - * Gets the user events as list of SmfEvents - */ - SmfEventsList* getUserEvents(); - - /** - * Sets the music usage info of the user as list of SmfTrackInfo - */ - void setMusicUsageInfo(SmfTrackInfoList* usage); - - /** - * Gets the music interest info of the user as list of SmfTrackInfo - */ - void setInterestInfo(SmfTrackInfoList* interest); +/** + * @ingroup smf_common_group + * The music profile class represents a user's profile in music site + */ +class SMFCLIENT_EXPORT SmfMusicProfile : public QObject + { + Q_OBJECT +public: + /** + * Constructor with default argument + * @param aParent The parent object + */ + SmfMusicProfile( QObject *aParent = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfMusicProfile( const SmfMusicProfile &aOther ); + + /** + * Destructor + */ + ~SmfMusicProfile( ); + + /** + * Method to get the user's used tracks + * @return The users track list + */ + QList musicUsageInfo( ) const; + + /** + * Method to get the user's interested tracks + * @return The users interested track list + */ + QList interestInfo( ) const; + + /** + * Method to get the user events as list of SmfEvents + * @return The list of events + */ + QList userEvents( ) const; + + /** + * Method to get the id of the music profile + * @return The ID value + */ + QString id( ) const; + + /** + * Method to set the user's used tracks + * @param aUsage The users new track list + */ + void setMusicUsageInfo( const QList& aUsage ); + + /** + * Method to set the user's interested tracks + * @param aInterest The users new interested track list + */ + void setInterestInfo( const QList& aInterest ); - private: - SmfTrackInfoList* usage; - SmfTrackInfoList* interest; - +private: + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfMusicProfile &aProfile ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfMusicProfile &aProfile ); + }; + + /** -* Externalization -*/ -QDataStream &operator<<(QDataStream &, const SmfMusicProfile&); + * Method for Externalization. Writes the SmfMusicProfile object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aProfile The SmfMusicProfile object to be externalized + * @return reference to the written stream + */ +QDataStream &operator<<( QDataStream &aDataStream, + const SmfMusicProfile &aProfile ); + /** - * Internalization + * Method for Internalization. Reads a SmfMusicProfile object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aProfile The SmfMusicProfile object to be internalized + * @return reference to the stream */ -QDataStream &operator>>(QDataStream &, SmfMusicProfile&); +QDataStream &operator>>( QDataStream &aDataStream, + SmfMusicProfile &aProfile); + #endif /* SMFMUSICPROFILE_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfmusicprofile_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfmusic/smfmusicprofile_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,64 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfMusicProfile class + * + */ + +#ifndef SMFMUSICPROFILE_P_H_ +#define SMFMUSICPROFILE_P_H_ + + +#include +#include +#include + +class SmfMusicProfilePrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfMusicProfilePrivate( ) { + m_usage.clear(); + m_interest.clear(); + m_events.clear(); + m_profileId.clear(); + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfMusicProfilePrivate( const SmfMusicProfilePrivate &aOther ) : + QSharedData ( aOther ), + m_usage ( aOther.m_usage ), + m_interest ( aOther.m_interest ), + m_events ( aOther.m_events ), + m_profileId ( aOther.m_profileId ) { } + + /** + * Destructor + */ + ~SmfMusicProfilePrivate( ); + + QList m_usage; // usage tracks + QList m_interest;// interested tracks + QList m_events; // events list + QString m_profileId; + +}; + +#endif /* SMFMUSICPROFILE_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfmusicrating.h --- a/example/clientapi/smf/inc/common/smfmusic/smfmusicrating.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfmusic/smfmusicrating.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,82 +1,121 @@ /** - * @file smfmusicrating.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * 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}". + * 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 * - * @section DESCRIPTION + * Description: + * The music rating class represents an instance of rating + * about a music track * - * The music rating class represents an instance of rating - * about a music track */ #ifndef SMFMUSICRATING_H_ #define SMFMUSICRATING_H_ #include -#include "SmfClientGlobal.h" +#include +#include + class SmfTrackInfo; +class SmfMusicRatingPrivate; + /** - * Rating value, services should define their own scale + * Indicates range of values to represent ratings, + * SP should normalize their rating value to this scale */ -class SMFCLIENT_EXPORT SmfMusicRating : QObject +const int SMF_MAX_RATING = 10; +const int SMF_MIN_RATING = 0; + +/** + * @ingroup smf_common_group + * The music rating class represents an instance of rating + * about a music track + */ +class SMFCLIENT_EXPORT SmfMusicRating : public QObject { Q_OBJECT - public: /** - * Constructs the rating for the given track + * Constructor with default argument + * @param aParent The parent object + * (parent should be of type SmfTrackInfo) */ - SmfMusicRating(SmfTrackInfo* track); - /** - * Gets the rating - */ - int getRating(); + SmfMusicRating(SmfTrackInfo *aParent = 0); /** - * Gets the max for the rating scale + * Copy Constructor + * @param aOther The reference object */ - int getMax(); + SmfMusicRating( const SmfMusicRating &aOther ); + + /** + * Overloaded = operator + * @param aOther The reference object + */ + SmfMusicRating operator=( const SmfMusicRating &aOther ); + + /** + * Destructor + */ + ~SmfMusicRating( ); /** - * Gets the min for the rating scale - */ - int getMin(); - - /** - * Gets the rating + * Method to get the rating + * @return The rating value */ - void setRating(int rating); - + int rating( ) const; + /** - * Sets the max for the rating scale + * Method to get the max rating + * @return The max rating value */ - void setMax(int max); + int maxRating( ) const; /** - * Sets the min for the rating scale + * Method to get the min rating + * @return The min rating value */ - void setMin(int min); + int minRating( ) const; + +private: + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfMusicRating &aMusicRating ); -private: - int m_rating; - int m_max; - int m_min; + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfMusicRating &aMusicRating ); + }; -/** -* Externalization -*/ -QDataStream &operator<<(QDataStream &, const SmfMusicRating&); + + /** - * Internalization + * Method for Externalization. Writes the SmfMusicRating object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aMusicRating The SmfMusicRating object to be externalized + * @return reference to the written stream */ -QDataStream &operator>>(QDataStream &, SmfMusicRating&); +QDataStream &operator<<( QDataStream &aDataStream, + const SmfMusicRating &aMusicRating ); + +/** + * Method for Internalization. Reads a SmfMusicRating object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aMusicRating The SmfMusicRating object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfMusicRating &aMusicRating); + #endif /* SMFMUSICRATING_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfmusicrating_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfmusic/smfmusicrating_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,58 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfMusicRating class + * + */ + +#ifndef SMFMUSICRATING_P_H_ +#define SMFMUSICRATING_P_H_ + +#include + +class SmfMusicRatingPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfMusicRatingPrivate( int aMax, int aMin ) { + m_rating = 0; + m_max = aMax; + m_min = aMin; + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfMusicRatingPrivate( const SmfMusicRatingPrivate &aOther ) : + QSharedData ( aOther ), + m_rating ( aOther.m_rating ), + m_max ( aOther.m_max ), + m_min ( aOther.m_min ) { } + + /** + * Destructor + */ + ~SmfMusicRatingPrivate( ); + + int m_rating; // rating + int m_max; // max rating + int m_min; // min rating + +}; + +#endif /* SMFMUSICRATING_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfplaylist.h --- a/example/clientapi/smf/inc/common/smfmusic/smfplaylist.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfmusic/smfplaylist.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,20 +1,20 @@ /** - * @file smfplaylist.h - * @author Nalina Hariharan,Manasij Roy Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * 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}". + * 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 * - * @section DESCRIPTION + * Description: + * The playlist class represents an instance of a playlist * - * The playlist class represents an instance of a playlist */ #ifndef SMFPLAYLIST_H_ @@ -22,11 +22,16 @@ #include #include +#include +#include + +class SmfPlaylistPrivate; /** + * @ingroup smf_common_group * The playlist class represents an instance of a playlist */ -class SmfPlaylist : public QObject +class SMFCLIENT_EXPORT SmfPlaylist : public QObject { Q_OBJECT public: @@ -37,33 +42,39 @@ SmfPlaylist( QObject *aParent = 0 ); /** + * Copy Constructor + * @param aOther The reference object + */ + SmfPlaylist( const SmfPlaylist &aOther ); + + /** * Destructor */ ~SmfPlaylist( ); /** * Method to get the list of tracks in the playlist - * @param aList The list of tracks in the playlist + * @return The list of tracks in the playlist */ - void getTrackList( QList& aList ); + QList trackList( ) const; /** * Method to get the playlist title - * @param aTitle The title of the playlist + * @return The title of the playlist */ - void getPlayListTitle( QString &aTitle ); + QString playListTitle( ) const; /** * Method to get the creation date of the playlist - * @param aDate The date and time of creation of the playlist + * @return The date and time of creation of the playlist */ - void getCreationDate( QDateTime &aDate ); + QDateTime creationDate( ) const; /** * Method to get the id of the playlist - * @param aId The ID value + * @return The ID value */ - void getId( QString &aId ); + QString id( ) const; /** * Method to set the list of tracks in the playlist @@ -84,19 +95,35 @@ void setCreationDate( const QDateTime &aDate ); private: - QList m_trackList; // list of tracks - QString m_title; // playlist name - QDateTime m_creationDate; // creation date - QString m_playlistId; + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfPlaylist &aPlaylist ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfPlaylist &aPlaylist ); }; - /** - * Externalization - */ - QDataStream &operator<<(QDataStream &, const SmfPlaylist &); - /** - * Internalization - */ - QDataStream &operator>>(QDataStream &, SmfPlaylist &); - + + +/** + * Method for Externalization. Writes the SmfPlaylist object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aPlaylist The SmfPlaylist object to be externalized + * @return reference to the written stream + */ +QDataStream &operator<<( QDataStream &aDataStream, + const SmfPlaylist &aPlaylist ); + +/** + * Method for Internalization. Reads a SmfPlaylist object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aPlaylist The SmfPlaylist object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfPlaylist &aPlaylist); + #endif /* SMFPLAYLIST_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfplaylist_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfmusic/smfplaylist_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,61 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfPlaylist class + * + */ + +#ifndef SMFPLAYLIST_P_H_ +#define SMFPLAYLIST_P_H_ + +#include +#include + +class SmfPlaylistPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfPlaylistPrivate( ) { + m_trackList.clear(); + m_title.clear(); + m_playlistId.clear(); + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfPlaylistPrivate( const SmfPlaylistPrivate &aOther ) : + QSharedData ( aOther ), + m_trackList ( aOther.m_trackList ), + m_title ( aOther.m_title ), + m_creationDate ( aOther.m_creationDate ), + m_playlistId ( aOther.m_playlistId ) { } + + /** + * Destructor + */ + ~SmfPlaylistPrivate( ); + + QList m_trackList;// list of tracks + QString m_title; // playlist name + QDateTime m_creationDate; // creation date + QString m_playlistId; + +}; + +#endif /* SMFPLAYLIST_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfsubtitle.h --- a/example/clientapi/smf/inc/common/smfmusic/smfsubtitle.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfmusic/smfsubtitle.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,20 +1,20 @@ /** - * @file smfsubtitle.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * 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}". + * 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 * - * @section DESCRIPTION + * Description: + * The subtitle class represents information about a track's subtitle * - * The subtitle class represents information about a track's subtitle */ #ifndef SMFSUBTITLE_H_ @@ -23,8 +23,24 @@ #include #include #include -#include "SmfClientGlobal.h" +#include +#include + +enum SmfSubtitleSearchFilterFields + { + SubtitleLanguage = 0, + SubtitleFrameRate, // value = 1 + SubtitleDuration, // value = 2 + SubtitleReleaseYear, // value = 3 + SubtitleAll = SubtitleLanguage | SubtitleFrameRate | + SubtitleDuration | SubtitleReleaseYear + }; +typedef QMap SmfSubtitleSearchFilter; + +class SmfSubtitlePrivate; + /** + * @ingroup smf_common_group * The subtitle class represents information about a track's subtitle */ class SMFCLIENT_EXPORT SmfSubtitle : public QObject @@ -38,61 +54,82 @@ SmfSubtitle( QObject *aParent = 0 ); /** + * Copy Constructor + * @param aOther The reference object + */ + SmfSubtitle( const SmfSubtitle &aOther ); + + /** * Destructor */ ~SmfSubtitle( ); - /** * Method to get the subtitle as a bytearray - * @param aSubTitle The subtitle content + * @return The subtitle content */ - void getSubtitle( QByteArray &aSubTitle ); + QByteArray subtitle( ) const; /** * Method to get the language - * @param aLanguage The language + * @return The language */ - void getLanguage( QString &aLanguage ); + QString language( ) const; /** * Method to get the frame rate * @return the frame rate */ - double getFrameRate( ); + double frameRate( ) const; /** * Method to get the duration * @return the duration */ - double getDuration( ); + double duration( ) const; /** * Method to get the release year - * @param aRelYear The release year + * @return The release year */ - void getReleaseYear( QDateTime &aRelYear ); + QDateTime releaseYear( ) const; /** * Method to get the id of the subtitle - * @param aId The ID value + * @return The ID value */ - void getId( QString &aId ); + QString id( ) const; private: - QByteArray m_subtitle; // subtitle data - QString m_language; // language - double m_frameRate; // frame rate - double m_duration; // duration - QDateTime m_releaseYr; // release year - QString m_subtitleId; // subtitle id + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfSubtitle &aSubtitle ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfSubtitle &aSubtitle ); + }; + + /** - * Externalization + * Method for Externalization. Writes the SmfSubtitle object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aSubtitle The SmfSubtitle object to be externalized + * @return reference to the written stream */ -QDataStream &operator<<(QDataStream &, const SmfSubtitle&); - /** - * Internalization - */ -QDataStream &operator>>(QDataStream &, SmfSubtitle&); +QDataStream &operator<<( QDataStream &aDataStream, + const SmfSubtitle &aSubtitle ); + +/** + * Method for Internalization. Reads a SmfSubtitle object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aSubtitle The SmfSubtitle object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfSubtitle &aSubtitle); + #endif /* SMFSUBTITLE_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfsubtitle_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfmusic/smfsubtitle_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,66 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfSubtitle class + * + */ + +#ifndef SMFSUBTITLE_P_H_ +#define SMFSUBTITLE_P_H_ + +#include +#include + +class SmfSubtitlePrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfSubtitlePrivate( ) { + m_language.clear(); + m_frameRate = 0; + m_duration = 0; + m_subtitleId.clear(); + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfSubtitlePrivate( const SmfSubtitlePrivate &aOther ) : + QSharedData ( aOther ), + m_subtitle ( aOther.m_subtitle ), + m_language ( aOther.m_language ), + m_frameRate ( aOther.m_frameRate ), + m_duration ( aOther.m_duration ), + m_releaseYr ( aOther.m_releaseYr ), + m_subtitleId ( aOther.m_subtitleId ) { } + + /** + * Destructor + */ + ~SmfSubtitlePrivate( ); + + QByteArray m_subtitle; // subtitle data + QString m_language; // language + double m_frameRate; // frame rate + double m_duration; // duration + QDateTime m_releaseYr; // release year + QString m_subtitleId; // subtitle id + +}; + +#endif /* SMFSUBTITLE_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfsubtitlesearchfilter.h --- a/example/clientapi/smf/inc/common/smfmusic/smfsubtitlesearchfilter.h Thu Mar 25 14:44:08 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/** - * @file smfsubtitlesearchfilter.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * 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}". - * - * @section DESCRIPTION - * - * The subtitle search filter class represents the filter options - * for searching tracks - */ - -#ifndef SMFSUBTITLESEARCHFILTER_H_ -#define SMFSUBTITLESEARCHFILTER_H_ - -#include -#include "SmfClientGlobal.h" -/** - * The subtitle search filter class represents the filter options - * for searching tracks - */ -class SMFCLIENT_EXPORT SmfSubtitleSearchFilter : public QObject - { - Q_OBJECT -public: - /** - * Constructor with default argument - * @param aParent The parent object - */ - SmfSubtitleSearchFilter( QObject *aParent = 0 ); - - /** - * Destructor - */ - ~SmfSubtitleSearchFilter( ); - - /** - * Method to get the language - * @param aLang The language - */ - void getLanguage( QString &aLang ); - - /** - * Method to get the frame rate - * @return The frame rate - */ - double getFrameRate( ); - - /** - * Method to get the duration - * @param aTime The duration - */ - void getDuration( QTime &aTime ); - - /** - * Method to get the release year - * @param aDateTime The release year - */ - void getReleaseYear( QDateTime &aDateTime ); - - /** - * Method to set the language - * @param aLang The new language - */ - void setLanguage( const QString& aLang ); - - /** - * Method to set the frame rate - * @param aFr The new frame rate - */ - void setFrameRate( const double aFr ); - - /** - * Method to set the duration - * @param aDuration The new duration - */ - void setDuration( const QTime& aDuration ); - - /** - * Method to set the release year - * @param aDateTime The new release year - */ - void setReleaseYear( const QDateTime &aDateTime ); - -private: - QString m_language; // language - double m_frameRate; // frame rate - QTime m_duration; // duration - QDateTime m_releaseYr; // release year - }; - -#endif /* SMFSUBTITLESEARCHFILTER_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smftrackinfo.h --- a/example/clientapi/smf/inc/common/smfmusic/smftrackinfo.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfmusic/smftrackinfo.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,20 +1,20 @@ /** - * @file smftrackinfo.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * 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}". + * 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 * - * @section DESCRIPTION + * Description: + * The track info class represents information about a music track * - * The track info class represents information about a music track */ #ifndef SMFTRACKINFO_H_ @@ -23,138 +23,184 @@ #include #include #include -#include "SmfClientGlobal.h" +#include +#include +#include +#include +#include + +class SmfTrackInfoPrivate; + /** - * Music track info as track id,title, album, artist, genre, - * tag, director,release year, rating, comment info + * @ingroup smf_common_group + * The track info class represents information about a music track */ class SMFCLIENT_EXPORT SmfTrackInfo : public QObject { Q_OBJECT public: - /** - * Constructs track info - */ - SmfTrackInfo(QObject* parent=0); /** - * Gets track id + * Constructor with default argument + * @param aParent The parent object + * (parent should be of type SmfMusicServicePlugin) */ - void getId(QString& id); + SmfTrackInfo(QObject *aParent = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfTrackInfo( const SmfTrackInfo &aOther ); /** - * Gets title of the track + * Destructor */ - void getTitle(QString& title); + ~SmfTrackInfo( ); + + /** + * Method to get the id of the track + * @return The ID value + */ + QString id( ) const; /** - * Gets album name + * Method to get the track title + * @return The title of the track */ - void getAlbum(QString& album); + QString title( ) const; /** - * Gets track artist + * Method to get the track album + * @return The album of the track */ - void getArtist(QString& artist); - - /** - * Gets track genre - */ - void getGenre(QString& genre); + SmfAlbum album( ) const; /** - * Gets track tag + * Method to get the track's artists + * @return The artists of the track */ - void getTag(QString& tag); + SmfArtists artists( ) const; /** - * Gets director name + * Method to get the genre of the track + * @return The genre of the track */ - void getDirector(QString& director); + QString genre( ) const; /** - * Gets release year + * Method to get the track's tag + * @return The tag of the track */ - void getYear(QString& year); + QStringList tags( ) const; /** - * Gets track rating + * Method to get the release year of the track + * @return The release year of the track */ - void getRating(SmfMusicRating& rating); + QDateTime year( ) const; /** - * Gets comments + * Method to get the track's rating + * @return The rating of the track */ - void getComment(QStringList& comment); - + SmfMusicRating rating( ) const; /** - * Sets id + * Method to get the comments on the track + * @return The comments on the track */ - void setId(QString& id); + QStringList comments( ) const; + + /** + * Method to get the track's duration + * @return The duration of the track + */ + QTime duration( ) const; /** - * Sets title + * Method to set the track title + * @param aTitle The new title of the track */ - void setTitle(QString& title); + void setTitle( const QString &aTitle ); /** - * Sets album name + * Method to set the track album + * @param aAlbum The new album of the track */ - void setAlbum(QString& album); + void setAlbum( const SmfAlbum &aAlbum ); + + /** + * Method to set the track's artists + * @param aArtists The new artists of the track + */ + void setArtists( const SmfArtists &aArtists ); /** - * Sets artist name + * Method to set the genre of the track + * @param aGenre The new genre of the track */ - void setArtist(QString& artist); + void setGenre( const QString &aGenre ); /** - * Sets genre + * Method to set the track's tag + * @param aTag The tag of the track */ - void setGenre(QString& genre); + void setTags( const QStringList &aTag ); /** - * Sets tag + * Method to set the release year of the track + * @param aYear The new release year of the track */ - void setTag(QString& tag); + void setYear( const QDateTime &aYear ); /** - * Sets director name + * Method to set the track's rating + * @param aRating The new rating of the track */ - void setDirector(QString& director); + void setRating( const SmfMusicRating &aRating ); /** - * Sets release year + * Method to set the comments on the track + * @param aComment The new comment of the track */ - void setYear(QString& year); + void setComment( const QString &aComment ); /** - * Sets rating + * Method to set the duration of the track + * @param aDuration The new duration of the track */ - void setRating(SmfMusicRating& rating); - - /** - * Sets comment - */ - void setComment(QStringList& comment); + void setDuration( const QTime &aDuration ); private: - QString m_id; - QString m_title; - QString m_albumTitle; - QString m_artistName; - QString m_genre; - QString m_tag; - QString m_director; - QString m_year; - SmfMusicRating m_rating; - QString m_comment; + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfTrackInfo &aTrackInfo ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfTrackInfo &aTrackInfo ); + }; -/** -* Externalization -*/ -QDataStream &operator<<(QDataStream &, const SmfTrackInfo&); + + /** - * Internalization + * Method for Externalization. Writes the SmfTrackInfo object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aTrackInfo The SmfTrackInfo object to be externalized + * @return reference to the written stream */ -QDataStream &operator>>(QDataStream &, SmfTrackInfo&); +QDataStream &operator<<( QDataStream &aDataStream, + const SmfTrackInfo &aTrackInfo ); + +/** + * Method for Internalization. Reads a SmfTrackInfo object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aTrackInfo The SmfTrackInfo object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfTrackInfo &aTrackInfo); + #endif /* SMFTRACKINFO_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smftrackinfo_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfmusic/smftrackinfo_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,80 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfTrackInfo class + * + */ + +#ifndef SMFTRACKINFO_P_H_ +#define SMFTRACKINFO_P_H_ + +#include +#include +#include +#include + +class SmfTrackInfoPrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfTrackInfoPrivate( int aMaxRating, int aMinRating ) : m_rating(aMaxRating, aMinRating) + { + m_trackId.clear(); + m_title.clear(); + m_albumTitle.clear(); + m_artistName.clear(); + m_genre.clear(); + m_tag.clear(); + m_comment.clear(); + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfTrackInfoPrivate( const SmfTrackInfoPrivate &aOther ) : + QSharedData ( aOther ), + m_trackId ( aOther.m_trackId ), + m_title ( aOther.m_title ), + m_albumTitle ( aOther.m_albumTitle ), + m_artistName ( aOther.m_artistName ), + m_genre ( aOther.m_genre ), + m_tag ( aOther.m_tag ), + m_year ( aOther.m_year ), + m_rating ( aOther.m_rating ), + m_comment ( aOther.m_comment ), + m_duration ( aOther.m_duration ) { } + + /** + * Destructor + */ + ~SmfTrackInfoPrivate( ); + + QString m_trackId; // track id + QString m_title; // title + QString m_albumTitle; // album name + QString m_artistName; // artist name + QString m_genre; // genre information + QStringList m_tag; // tag information + QDateTime m_year; // release year + SmfMusicRating m_rating;// rating + QStringList m_comment; // comments + QTime m_duration; // duration + +}; + +#endif /* SMFTRACKINFO_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfmusic/smfvenue.h --- a/example/clientapi/smf/inc/common/smfmusic/smfvenue.h Thu Mar 25 14:44:08 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/** - * @file smfvenue.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * 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}". - * - * @section DESCRIPTION - * - * The venue class represents a venue and its related information - * - * Note: This class has dependencies on QtMobility project - */ - -#ifndef SMFVENUE_H_ -#define SMFVENUE_H_ - -#include -#include // Qt mobility class -#include -#include "SmfClientGlobal.h" - -/** - * Popular venues. - * Consists of venue name, city, street, pin, country,url and geo info. - */ -class SMFCLIENT_EXPORT SmfVenue : QObject - { - Q_OBJECT - -public: - - /** - * Gets the venue name - */ - QString getName(); - - /** - * Sets the venue name - */ - void setName(QString& name); - - /** - * Gets the city name - */ - QString getCity(); - - /** - * Sets the city name - */ - void setCity(QString& name); - - /** - * Gets the Street name - */ - QString getStreet(); - - /** - * Sets the Street name - */ - void setStreet(QString& name); - - /** - * Gets the Pin - */ - QString getPin(); - - /** - * Sets the Pin - */ - void setPin(QString& name); - - /** - * Gets the Country name - */ - QString getCountry(); - - /** - * Sets the Country name - */ - void setCountry(QString& name); - - /** - * Gets the geo info - */ - QtMobility::QGeoPositionInfo getGeo(); - - /** - * Sets the geo info - */ - void setGeo(QtMobility::QGeoPositionInfo& geo); - - /** - * Gets the url - */ - QUrl getUrl(); - - /** - * Sets the url - */ - void setUrl(QUrl& url); - - -private: - QString m_name; - QString m_city; - QString m_street; - QString m_pin; - QString m_country; - QtMobility::QGeoPositionInfo m_geo; - QUrl m_url; - }; - -/** -* Externalization -*/ -QDataStream &operator<<(QDataStream &, const SmfVenue&); -/** - * Internalization - */ -QDataStream &operator>>(QDataStream &, SmfVenue&); -#endif /* SMFVENUE_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfpictures/smfcomment.h --- a/example/clientapi/smf/inc/common/smfpictures/smfcomment.h Thu Mar 25 14:44:08 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/** - * @file smfcomment.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * 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}". - * - * @section DESCRIPTION - * - * The comment class represents a comment on a picture or a music track - */ - -#ifndef SMFCOMMENT_H_ -#define SMFCOMMENT_H_ - -#include -#include -#include "SmfClientGlobal.h" -/** - * The comment class represents a comment on a picture or a music track - */ -class SMFCLIENT_EXPORT SmfComment : public QObject - { - Q_OBJECT -public: - /** - * Constructor with default argument - * @param aParent The parent object - */ - SmfComment( QObject *aParent = 0 ); - /** - * Destructor - */ - ~SmfComment( ); - - - /** - * Method to get the comment text - * @param aText The comment text - */ - void getText( QString &aText ); - - /** - * Method to get the comment time stamp - * @param aTimeStamp The comment time stamp value - */ - void getTimeStamp( QDateTime &aTimeStamp ); - - /** - * Method to get the id of the comment - * @param aId The ID value - */ - void getId( QString &aId ); - - /** - * Method to set the comment text - * @param aText The comment text to be set - */ - void setText( const QString &aText ); - - /** - * Method to set the comment time stamp - * @param aTimeStamp The comment time stamp value to be set - */ - void setTimeStamp( const QDateTime &aTimeStamp ); - -private: - QString m_text; // comment text - QDateTime m_timeStamp; // comment time stamp - QString m_commetnId; - - }; -/** - * Externalization - */ -QDataStream &operator<<(QDataStream &, const SmfComment &); -/** - * Internalization - */ -QDataStream &operator>>(QDataStream &, SmfComment &); -#endif /* SMFCOMMENT_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfpictures/smfpicture.h --- a/example/clientapi/smf/inc/common/smfpictures/smfpicture.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/common/smfpictures/smfpicture.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,20 +1,20 @@ /** - * @file smfpicture.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * 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}". + * 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 * - * @section DESCRIPTION + * Description: + * The picture class represents an instance of a picture * - * The picture class represents an instance of a picture */ #ifndef SMFPICTURE_H_ @@ -24,7 +24,11 @@ #include #include #include -#include "SmfClientGlobal.h" +#include +#include + +class SmfPicturePrivate; + /** * SmfPictureVisibility enumeration */ @@ -36,7 +40,9 @@ SMFVisibilityGroup, SMFVisibilityPublic }; + /** + * @ingroup smf_common_group * The picture class represents an instance of a picture */ class SMFCLIENT_EXPORT SmfPicture : public QObject @@ -50,71 +56,81 @@ SmfPicture( QObject *aParent = 0 ); /** + * Copy Constructor + * @param aOther The reference object + */ + SmfPicture( const SmfPicture &aOther ); + + /** + * CConstructs SmfPicture from QImage + * @param aOther The QImage + */ + SmfPicture( const QImage &image ); + + /** * Destructor */ ~SmfPicture( ); - /** * Method to get the id of the picture - * @param aId The ID value + * @return The ID value */ - void getId( QString &aId ); + QString id( ) const; /** * Method to get a picture owner - * @param aOwner The owner of the picture + * @return The owner of the picture */ - void getOwner( QString &aOwner ); + QString owner( ) const; /** * Method to get a picture title - * @param aTitle The title of the picture + * @return The title of the picture */ - void getTitle( QString &aTitle ); + QString title( ) const; /** * Method to get a picture description - * @param aDescription The description of the picture + * @return The description of the picture */ - void getDescription( QString &aDescription ); + QString description( ) const; /** * Method to get a visibility of a picture for public - * @param aVisibility The visibility mode of - * this picture for others + * @return The visibility mode of this picture for others */ - void getVisibility( SmfPictureVisibility &aVisibility ); + SmfPictureVisibility visibility( ) const; /** * Method to get the date of posting the picture - * @param aPostedOn The posted date of the picture + * @return The posted date of the picture */ - void getPostedDate( QDateTime &aPostedOn ); + QDateTime postedDate( ) const; /** * Method to get the comments for the picture - * @param aComments The comments for the picture + * @return The comments for the picture */ - void getComments( QStringList &aComments ); + QStringList comments( ) const; /** * Method to get the tags for the picture - * @param aTags The tags for the picture + * @return The tags for the picture */ - void getTags( QStringList &aTags ); + QStringList tags( ) const; /** * Method to get the url of the picture - * @param aUrl The url of the picture + * @return The url of the picture */ - void getUrl( QUrl &aUrl ); + QUrl url( ) const; /** - * Method to get the picture data as a byte array - * @param aData The picture as a byte array + * Method to get the picture data as QImage + * @return The picture as QImage */ - void getPicture( QByteArray &aData ); + QImage picture( ) const; /** * Method to set a picture owner @@ -142,51 +158,53 @@ void setVisibility( const SmfPictureVisibility &aVisibility ); /** - * Method to set the date of posting the picture - * @param aPostedOn The posted date of the picture - */ - void setPostedDate( const QDateTime &aPostedOn ); - - /** - * Method to set the comments for the picture + * Method to add comment on the picture * @param aComment The comment for the picture */ - void setComment( const QString &aComment ); + void addComment( const QString &aComment ); /** - * Method to set the tags for the picture + * Method to add tags for the picture * @param aTag The tag for the picture */ - void setTag( const QString &aTag ); + void addTags( const QStringList &aTags ); /** - * Method to set the picture data as a byte array - * @param aData The picture as a byte array + * Method to set the picture data as QImage + * @param aData The picture as QImage */ - void setPicture( const QByteArray &aData ); + void setPicture( const QImage &aData ); private: - QString m_photoid; // unique ID of the picture, service provider specific - QString m_owner; // owner of the picture - QString m_title; // picture title - QString m_descrition;// description - bool m_ispublic;// visibility for public, Set to 0 for no, 1 for yes. - bool m_isfriend;// visilibility for friends Set to 0 for no, 1 for yes. - bool m_isfamily;// visilibility for family Set to 0 for no, 1 for yes. - QDateTime m_postedon;// date posted - QStringList m_comments;// comments - QStringList m_tags; // tags - QUrl m_url; // url - QByteArray* m_picture; // picture data as bytearray - QString m_caption; // caption + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfPicture &aPic ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfPicture &aPic ); }; -/** -* Externalization -*/ -QDataStream &operator<<(QDataStream &, const SmfPicture&); + + /** - * Internalization + * Method for Externalization. Writes the SmfPicture object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aPic The SmfPicture object to be externalized + * @return reference to the written stream */ -QDataStream &operator>>(QDataStream &, SmfPicture&); +QDataStream &operator<<( QDataStream &aDataStream, + const SmfPicture &aPic ); + +/** + * Method for Internalization. Reads a SmfPicture object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aPic The SmfPicture object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfPicture &aPic); + #endif /* SMFPICTURE_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfpictures/smfpicture_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfpictures/smfpicture_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,84 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfPicture class + * + */ + +#ifndef SMFPICTURE_P_H_ +#define SMFPICTURE_P_H_ + + +#include +#include +#include +#include +#include + +class SmfPicturePrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfPicturePrivate( ) { + m_photoId.clear(); + m_owner.clear(); + m_title.clear(); + m_description.clear(); + m_comments.clear(); + m_tags.clear(); + m_url.clear(); + m_caption.clear(); + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfPicturePrivate( const SmfPicturePrivate &aOther ) : + QSharedData ( aOther ), + m_photoId ( aOther.m_photoId ), + m_owner ( aOther.m_owner ), + m_title ( aOther.m_title ), + m_description ( aOther.m_description ), + m_picVisibility ( aOther.m_picVisibility ), + m_postedOn ( aOther.m_postedOn ), + m_comments ( aOther.m_comments ), + m_tags ( aOther.m_tags ), + m_url ( aOther.m_url ), + m_picture ( aOther.m_picture ), + m_caption ( aOther.m_caption ) { } + + /** + * Destructor + */ + ~SmfPicturePrivate( ); + + QString m_photoId; // unique ID of the picture, service provider specific + QString m_owner; // owner of the picture + QString m_title; // picture title + QString m_description;// description + SmfPictureVisibility m_picVisibility; // picture visibility + QDateTime m_postedOn;// date posted + QStringList m_comments;// comments + QStringList m_tags; // tags + QUrl m_url; // url + QImage m_picture; // picture data as bytearray + QString m_caption; // caption + +}; + +#endif /* SMFPICTURE_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfplace/smfplace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfplace/smfplace.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,204 @@ +/** + * 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 SmfPlace class represents a place and its related information + * Note: This class has dependencies on QtMobility project + * + */ + +#ifndef SMFPLACE_H_ +#define SMFPLACE_H_ + +#include +#include // Qt mobility class +#include +#include +#include + +using namespace QtMobility; // Qt mobility - namespace + +typedef enum +{ + SearchByStreet = 0x00, + SearchByLocality, + SearchByPostOffice, + SearchByTown, + SearchByRegion, + SearchByState, + SearchByCountry +}SmfLocationSearchBoundary; + +class SmfPlacePrivate; + +/** + * @ingroup smf_common_group + * The SmfPlace class represents a place and its related information. + * + * Note: This class has dependencies on QtMobility project + */ +class SMFCLIENT_EXPORT SmfPlace : public QObject + { + Q_OBJECT +public: + /** + * Constructor with default argument + * @param aParent The parent object + */ + SmfPlace( QObject *aParent = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfPlace( const SmfPlace &aOther ); + + /** + * Overloaded = operator + * @param aOther The reference object + */ + SmfPlace operator=( const SmfPlace &aOther ); + + /** + * Destructor + */ + ~SmfPlace( ); + + /** + * Method to get the place name + * @return The place name + */ + QString name( ) const; + + /** + * Method to get the city of place + * @return The city of the place + */ + QString city( ) const; + + /** + * Method to get the street information of place + * @return The street information of the place + */ + QString street( ) const; + + /** + * Method to get the zip code of place + * @return The zip code of place + */ + QString zipCode( ) const; + + /** + * Method to get the country of place + * @return The country of place + */ + QString country( ) const; + + /** + * Method to get the Geo Position information (like information gathered + * on a global position, direction and velocity at a particular point + * in time) of the place. + * @return The Geo Position information of place + */ + QtMobility::QGeoPositionInfo geoPositionInfo( ) const; + + /** + * Method to get the url indicating the place + * @return The url indicating the place + */ + QUrl url( ) const; + + /** + * Method to get the id of the place + * @return The ID value + */ + QString id( ) const; + + /** + * Method to set the place name + * @param aPlace The new place name + */ + void setName( const QString& aPlace ); + + /** + * Method to set the city of place + * @param aCity The new city of the place + */ + void setCity( const QString& aCity ); + + /** + * Method to set the street information of place + * @param aStreet The new street information of the place + */ + void setStreet( const QString& aStreet ); + + /** + * Method to set the zip code of place + * @param aZipCode The new zip code of place + */ + void setZipCode( const QString& aZipCode ); + + /** + * Method to set the country of place + * @param aCountry The new country of place + */ + void setCountry( const QString& aCountry ); + + /** + * Method to set the Geo Postion information (like information gathered + * on a global position, direction and velocity at a particular point + * in time) of the place. + * @param aGeoPosInfo The new Geo Position information of place + */ + void setGeoPositionInfo( const QtMobility::QGeoPositionInfo& aGeoPosInfo ); + + /** + * Method to set the url indicating the place + * @param aUrl The new url indicating the place + */ + void setUrl( const QUrl& aUrl ); + +private: + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfPlace &aPlace ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfPlace &aPlace ); + + }; + + +/** + * Method for Externalization. Writes the SmfPlace object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aPlace The SmfPlace object to be externalized + * @return reference to the written stream + */ +QDataStream &operator<<( QDataStream &aDataStream, + const SmfPlace &aPlace ); + +/** + * Method for Internalization. Reads a SmfPlace object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aPlace The SmfPlace object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfPlace &aPlace); + +#endif /* SMFPLACE_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/common/smfplace/smfplace_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/common/smfplace/smfplace_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,75 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfPlace class + * + */ + +#ifndef SMFPLACE_P_H_ +#define SMFPLACE_P_H_ + +#include +#include // Qt mobility class +#include + +using namespace QtMobility; // Qt mobility - namespace + +class SmfPlacePrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfPlacePrivate( ) { + m_name.clear(); + m_city.clear(); + m_street.clear(); + m_zipcode.clear(); + m_country.clear(); + m_url.clear(); + m_placeId.clear(); } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfPlacePrivate( const SmfPlacePrivate &aOther ) : + QSharedData ( aOther ), + m_name ( aOther.m_name ), + m_city ( aOther.m_city ), + m_street ( aOther.m_street ), + m_zipcode ( aOther.m_zipcode ), + m_country ( aOther.m_country ), + m_geo ( aOther.m_geo ), + m_url ( aOther.m_url ), + m_placeId ( aOther.m_placeId ) { } + + /** + * Destructor + */ + ~SmfPlacePrivate( ); + + QString m_name; // place name + QString m_city; // city of place + QString m_street; // street of place + QString m_zipcode; // zip code of place + QString m_country; // country of place + QtMobility::QGeoPositionInfo m_geo; // place geo position information + QUrl m_url; // url indicating the place + QString m_placeId; // place id + +}; + +#endif /* SMFPLACE_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfclient/smfclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/smfclient/smfclient.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,55 @@ +/** + * 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 SMFCLIENT_H +#define SMFCLIENT_H + +#include +#include +#include + +#include "../common/SmfClientGlobal.h" + +class SmfProvider; + +/** + * @ingroup smf_client_group + * Interface for a base service provider. Other service provider classes contains + * implementation of 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 SMFCLIENT_EXPORT SmfClient +{ + /*Q_OBJECT*/ + +public: + + /** + * @param name of the service + * @return service provider list + */ + static QList* GetServices(const QString& serviceName); + static QList* GetServices(const QString& serviceName, const QString& providerName); + static QList* GetServices(const QString& serviceName, const SmfProvider& provider); +}; + + +#endif // SMFCLIENT_H diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfclient/smfcontactfetcher.h --- a/example/clientapi/smf/inc/smfclient/smfcontactfetcher.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfclient/smfcontactfetcher.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,36 +1,39 @@ -/* -* 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 -* -*/ +/** + * 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 SMFCONTACTHETCHER_H #define SMFCONTACTHETCHER_H #include +#include "smfglobal.h" #include "smfprovider.h" #include "smfcontact.h" - +#include "smfplace.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 -class SmfContactList; +typedef QList SmfContactList; //List of SmfGroup typedef QList SmfGroupList; /** + * @ingroup smf_client_group * 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. @@ -54,61 +57,88 @@ * @param parent base provider info * @param contact Used for searching friends of the given contact * Seeing as this is a plug-in implementation, these will realistically - * be generated by SMF factory of some kind + * be generated by SMF factory of some kind */ - SmfContactFetcher(SmfProvider* baseProvider = 0, SmfContact* contact = 0); + SmfContactFetcher(SmfProvider* baseProvider); + SmfContactFetcher(SmfProvider* baseProvider, SmfContact* contact); ~SmfContactFetcher(); public: /** * Get the friend listing asynchronously. The friendsListAvailable() signal - * is emitted with SmfContactList once data is arrived. + * is emitted with SmfContactList once data 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 */ - virtual void friends() = 0; // list of contact objects - + bool friends(int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE); + /** * Get the list of followers asynchronously. The followersListAvailable() signal - * is emitted with SmfContactList once data is arrived. + * is emitted with SmfContactList once data is arrived. Please note that some + * service may not support followers/fans - FALSE is returned if not supported. + * 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 */ - virtual void followers() = 0; // list of contact objects - + bool followers(int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE); // list of contact objects + /** * Searches for a contact The searchContactFinished() signal - * is emitted with SmfContactList once data is arrived. + * is emitted with SmfContactList once data 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 */ - virtual void search(SmfContact* contact) = 0; // list of contact objects - + void search(SmfContact* contact,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // list of contact objects + + /** + * Searches for a contacts (friends) who are near the user. + * Signal searchNearFinished() is emitted with SmfContactList once data is arrived. + * Proximity defines accuracy level + * 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 + */ + bool searchNear(SmfPlace* location,SmfLocationSearchBoundary proximity,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; + + /** * Get the list of groups. The groupListAvailable() signal - * is emitted with SmfGroupList once data is arrived. + * is emitted with SmfGroupList once data is arrived. False might be returned + * if this service doesn't support any mode of grouping (very rare). + * 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 */ - virtual void groups() = 0; // list of group objects - + bool groups(int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // list of group objects + /** - * Searches for Smf Contacts in an Smf group + * Searches for Smf Contacts in an Smf group. + * 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 * @param group The group to be searcged in - * The nextDataPageAvailable() signal - * of SmfProvider is emitted with SmfContactList once data is arrived. */ - virtual void searchInGroup(SmfGroup group) = 0; // list of contact objects + bool searchInGroup(SmfGroup group,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // list of contact objects + - //APIs to get/set base provider info (SmfProvider) - + /** * Gets the base provider info */ - virtual SmfProvider* getProvider() = 0; - - /** - * Sets the base provider info - */ - virtual void setProvider(SmfProvider* provider) = 0; - + SmfProvider* getProvider() ; public slots: -Q_SIGNALS: +signals: /** * This signal is emitted when a request to get friends is completed. @@ -116,10 +146,10 @@ * In that case this signal is emitted multiple times. * @param list list of friends * @param error error string - * @param pageNumber Page number + * @param resultPage Page number info * @see friends() */ - void friendsListAvailable(SmfContactList* list, QString error, int pageNumber=0); + void friendsListAvailable(SmfContactList* list, QString error, SmfResultPage resultPage); /** * This signal is emitted when a request to get followers is completed @@ -127,45 +157,56 @@ * In that case this signal is emitted multiple times. * @param list list of followers * @param error error string - * @param pageNumber Page number + * @param resultPage Page number info * @see followers() */ - void followersListAvailable(SmfContactList* list, QString error, int pageNumber=0); - + void followersListAvailable(SmfContactList* list, QString error, SmfResultPage resultPage); + /** * This signal is emitted when a request to get groups is completed * Note if number of groups is large, then it can download the list page by page * In that case this signal is emitted multiple times. * @param list list of groups * @param error error string - * @param pageNumber Page number + * @param resultPage Page number info * @see groups() */ - void groupListAvailable(SmfGroupList* list, QString error, int pageNumber=0); - + void groupListAvailable(SmfGroupList* list, QString error, SmfResultPage resultPage); + /** * Emitted when search for a contact is finished. * Note if number of contacts in the search is large, then it can download the list page by page * In that case this signal is emitted multiple times. * @param list List of filtered contacts - * @param pageNumber Page number + * @param resultPage Page number info * @see search() */ - void searchContactFinished(SmfContactList* list,QString error, int pageNumber=0); - + void searchContactFinished(SmfContactList* list,QString error, SmfResultPage resultPage); + + + /** + * Emitted when search for contacts who are near a geographic location, is finished. + * Note if number of contacts in the search is large, then it can download the list page by page + * In that case this signal is emitted multiple times. + * @param list List of filtered contacts + * @param resultPage Page number info + * @see search() + */ + void searchNearFinished(SmfContactList* list,QString error, SmfResultPage resultPage); + /** * Emitted when search for a contact in a group is finished * Note if number of contacts in the search is large, then it can download the list page by page * In that case this signal is emitted multiple times. * @param list list of filtered contacts - * @param pageNumber Page number + * @param resultPage Page number info * @see searchInGroup() */ - void searchInGroupFinished(SmfContactList* list,QString error, int pageNumber=0); + void searchInGroupFinished(SmfContactList* list,QString error, SmfResultPage resultPage); private: SmfProvider* m_baseProvider; }; -SMF_GETSERVICES(SmfContactFetcher, "org.symbian.smf.client.contact.fetcher\0.2") +SMF_SERVICE_NAME(SmfContactFetcher, "org.symbian.smf.client.contact.fetcher\0.2") #endif // SMFCONTACTHETCHER_H diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfclient/smfgallery.h --- a/example/clientapi/smf/inc/smfclient/smfgallery.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfclient/smfgallery.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,31 +1,31 @@ -/* -* 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 -* -*/ +/** + * 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 SMFGALLERY_H #define SMFGALLERY_H - +#include "smfglobal.h" #include "smfprovider.h" #include "../common/SmfClientGlobal.h" class SmfProvider; +class SmfComment; //user id, string, and url class SmfPicture; -class SmfGalleryModel; -class SmfComment; //user id, string, and url #include @@ -34,6 +34,7 @@ //List of SmfPicture typedef QList SmfPictureList; /** + * @ingroup smf_client_group * 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. @@ -65,30 +66,24 @@ /** * Get the picture listing asynchronously. * The picturesAvailable() signal is emitted with SmfPictureList once the pictures have 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 */ - virtual void pictures() = 0; - - /** - * Returns model - */ - virtual SmfGalleryModel model() = 0; // maybe we can make a QItemModel-derived model? - + void pictures(int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE); + /** * Returns a user title/caption for the picture */ - virtual QString description() = 0; // A user title or caption, maybe? - + QString description(SmfPicture& picture); // A user title or caption, maybe? + //APIs to get/set base provider info (SmfProvider) - + /** * Gets the base provider info */ - virtual SmfProvider* getProvider() = 0; - - /** - * Sets the base provider info - */ - virtual void setProvider(SmfProvider* provider) = 0; + SmfProvider* getProvider() ; public slots: /** @@ -96,22 +91,22 @@ * uploadFinished() signal is emitted with the success value of the upload * @param image the image to be uploaded */ - virtual void upload(SmfPicture* image) = 0; - + void upload(SmfPicture* image) ; + /** * Upload an list image.Implemented as slot to connect to UI controls more easily * uploadFinished() signal is emitted with the success value of the upload * @param images the list image to be uploaded */ - virtual void upload(SmfPictureList* images) = 0; - + void upload(SmfPictureList* images) ; + /** * Posts a comment for an image. uploadFinished() signal is emitted * with success of the post once comment is posted. * @param image Image to comment on * @param comment Comment to post */ - virtual void postComment(SmfPicture image, SmfComment comment) = 0; + void postComment(SmfPicture image, SmfComment comment) ; signals: /* @@ -121,20 +116,20 @@ * through pictures(). * @param pics Picture list * @param error Error string - * @param pageNumber Page number + * @param resultPage Page number info */ - void picturesAvailable(SmfPictureList* pics, QString error, int pageNumber=0); - + void picturesAvailable(SmfPictureList* pics, QString error, SmfResultPage resultPage); + /** * Notification of the success of the uploading of image/comment - * @param success The success of the post + * @param error The upload success result of each individual pictures */ - void uploadFinished(bool success); + void uploadFinished(QList error); private: SmfProvider* m_baseProvider; }; -SMF_GETSERVICES(SmfGallery, "org.symbian.smf.client.gallery\0.2") +SMF_SERVICE_NAME(SmfGallery, "org.symbian.smf.client.gallery\0.2") #endif // SMFGALLERY_H diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfclient/smfmusic.h --- a/example/clientapi/smf/inc/smfclient/smfmusic.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfclient/smfmusic.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,20 +1,21 @@ -/* -* 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 -* -*/ +/** + * 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 @@ -24,9 +25,10 @@ #include #include +#include "smfglobal.h" #include "smfprovider.h" #include "smfcontact.h" - +#include "smfevent.h" class SmfProvider; //basic Smf service Provider info class SmfContact; // Smf contact @@ -35,8 +37,7 @@ 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 SmfMusicModel; -class SmfEvents; +class SmfEvent; class SmfPlaylist; class SmfLyricsService; class SmfLyrics; @@ -45,13 +46,14 @@ typedef QList SmfMusicProfileList; typedef QList SmfTrackInfoList; -typedef QList SmfEventsList; +typedef QList SmfEventsList; typedef QList SmfProviderList; typedef QList SmfPlaylistList; typedef QList SmfVenueList; typedef QList SmfLyricsList; typedef QList SmfSubtitleList; /** + * @ingroup smf_client_group * Basic music service ("org.symbian.smf.client.music.service") */ class SMFCLIENT_EXPORT SmfMusicService : public QObject @@ -69,35 +71,28 @@ ~SmfMusicService(); public: - + /** * Gets self profile information asynchronously. * userInfoAvailable() signal is emitted with SmfMusicProfile when the info is arrived */ - virtual void userinfo() = 0; - + void userinfo() ; + /** * Asynchronously searches information about other service users for a particular venue - * serachInfoAvailable() signal is emitted with SmfMusicProfileList when the info is arrived + * 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 */ - virtual void searchUser(SmfVenue venue) = 0; - - /** - * Returns the model - */ - virtual SmfMusicModel model() = 0; // maybe we can make a QItemModel-derived model? + void searchUser(SmfVenue venue,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; - //APIs to get/set base provider info (SmfProvider) - /** * Gets the base provider info */ - virtual SmfProvider* getProvider() = 0; - - /** - * Sets the base provider info - */ - virtual void setProvider(SmfProvider* provider) = 0; + SmfProvider* getProvider() ; + signals: /** @@ -105,10 +100,12 @@ * @param profile The self profile */ void userInfoAvailable(SmfMusicProfile* profile, QString error); + + void searchInfoAvailable(SmfMusicProfileList& profileList, QString error,SmfResultPage resultPage); private: SmfProvider* m_baseProvider; }; -SMF_GETSERVICES(SmfMusicService, "org.symbian.smf.client.music.service\0.2") +SMF_SERVICE_NAME(SmfMusicService, "org.symbian.smf.client.music.service\0.2") /** @@ -130,49 +127,57 @@ 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. - * @param track The track for which similar recommendations need to be fetched. + * 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 */ - virtual void recommendations(SmfTrackInfo track) = 0; // basic list of track objects - + 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. - * @param track The search criteria, similar tracks are searched + * 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 */ - virtual void tracks(SmfTrackInfo track) = 0; // basic list of track objects - + 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 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 */ - virtual void trackInfo(SmfMusicFingerPrint signature) = 0; // search by fingerprint object - + 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 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 */ - virtual void stores(SmfTrackInfo track) = 0; - + 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 */ - virtual SmfProvider* getProvider() = 0; - - /** - * Sets the base provider info - */ - virtual void setProvider(SmfProvider* provider) = 0; + SmfProvider* getProvider() ; + public slots: @@ -181,30 +186,30 @@ * Success can be checked by checking the signal postFinished() * @param track Track to post */ - virtual void postCurrentPlaying(SmfTrackInfo track) = 0; - //virtual int postRating(SmfTrackInfo track, SmfMusicRating rate) = 0; - //virtual int postComments(SmfTrackInfo track, SmfComment comment) = 0; + 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 result The search result + * @param resultPage Page number info */ - void trackSearchAvailable(SmfTrackInfoList* result, QString error, int pageNumber=0); - + 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 result The search result + * @param resultPage Page number info */ - void storeSearchAvailable(SmfProviderList* result, QString error, int pageNumber=0); + void storeSearchAvailable(SmfProviderList* result, QString error, SmfResultPage resultPage); private: SmfProvider* m_baseProvider; }; -SMF_GETSERVICES(SmfMusicSearch, "org.symbian.smf.client.music.search\0.2") +SMF_SERVICE_NAME(SmfMusicSearch, "org.symbian.smf.client.music.search\0.2") /** @@ -213,41 +218,41 @@ 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; @@ -284,33 +289,37 @@ ~SmfPlaylistService(); public: - + /** * Gets the list playlists for the logged-in user asynchronously. - * The signal playlistsListAvailable() signal is emitted with - * SmfPlaylistList once its arrived + * 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 */ - virtual void playlists() = 0; // basic list of playlist objects - + 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 + * 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 */ - virtual void playlistsOf(SmfMusicProfile* user) = 0; + 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 */ - virtual SmfProvider* getProvider() = 0; - - /** - * Sets the base provider info - */ - virtual void setProvider(SmfProvider* provider) = 0; + SmfProvider* getProvider() ; + public slots: @@ -320,23 +329,24 @@ * @param plst The playlist to be added in * @param tracks The list of tracks to uploaded */ - virtual int addToPlaylist(SmfPlaylist plst, SmfTrackInfoList* tracks) = 0; - + 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 */ - virtual int postCurrentPlayingPlaylist(SmfPlaylist plst) = 0; + 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. + * In that case this signal is emitted multiple times. + * @param resultPage Page number info */ - void playlistsListAvailable(SmfPlaylistList*, QString error, int pageNumber=0); + void playlistsListAvailable(SmfPlaylistList*, QString error, SmfResultPage resultPage); /** * Signals remote updation of playlist with success value */ @@ -344,7 +354,7 @@ private: SmfProvider* m_baseProvider; }; -SMF_GETSERVICES(SmfPlaylistService, "org.symbian.smf.client.music.playlist\0.2") +SMF_SERVICE_NAME(SmfPlaylistService, "org.symbian.smf.client.music.playlist\0.2") /** @@ -364,37 +374,45 @@ ~SmfMusicEvents(); public: - + /** * Gets list of events in a particular location asynchronously. - * eventsAvailable() signal is emitted with SmfEventsList once its arrived + * 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 */ - virtual void events(QtMobility::QContactGeolocation location) = 0; - + 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. + * 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 */ - virtual void venues(QtMobility::QContactGeolocation location) = 0; // basic list of venue objects - + 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 + * 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 */ - virtual void events(SmfVenue venue) = 0; // basic list of events objects - + 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 */ - virtual SmfProvider* getProvider() = 0; - - /** - * Sets the base provider info - */ - virtual void setProvider(SmfProvider* provider) = 0; + SmfProvider* getProvider() ; + public slots: @@ -403,32 +421,34 @@ * eventsUpdated() signal can be checked for success value. * @param SmfEventsList List of events to be posted */ - virtual void postEvents(SmfEventsList events); + 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. + * In that case this signal is emitted multiple times. + * @param resultPage Page number info */ - void eventsAvailable(SmfEventsList* list, QString error, int pageNumber=0); - + 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. + * In that case this signal is emitted multiple times. + * @param resultPage Page number info */ - void venuesAvailable(SmfVenueList* list, QString error, int pageNumber=0); + void venuesAvailable(SmfVenueList* list, QString error, SmfResultPage resultPage); private: SmfProvider* m_baseProvider; }; -SMF_GETSERVICES(SmfMusicEvents, "org.symbian.smf.client.music.events\0.2") +SMF_SERVICE_NAME(SmfMusicEvents, "org.symbian.smf.client.music.events\0.2") /** @@ -449,56 +469,58 @@ ~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 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 */ - virtual void lyrics(SmfTrackInfo track) = 0; - + 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 */ - virtual void subtitles(SmfTrackInfo track, SmfSubtitleSearchFilter filter) = 0; // texts with time information + 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 */ - virtual SmfProvider* getProvider() = 0; - - /** - * Sets the base provider info - */ - virtual void setProvider(SmfProvider* provider) = 0; + 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. + * In that case this signal is emitted multiple times. + * @param resultPage Page number info */ - void lyricsAvailable(SmfLyricsList* list, QString error, int pageNumber=0); + 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. + * In that case this signal is emitted multiple times. + * @param resultPage Page number info */ - void subtitleAvailable(SmfSubtitleList* list, QString error, int pageNumber=0); + void subtitleAvailable(SmfSubtitleList* list, QString error, SmfResultPage resultPage); private: SmfProvider* m_baseProvider; }; -SMF_GETSERVICES(SmfLyricsService, "org.symbian.smf.client.music.lyrics\0.2") +SMF_SERVICE_NAME(SmfLyricsService, "org.symbian.smf.client.music.lyrics\0.2") #endif // SMFMUSIC_H diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfclient/smfpostprovider.h --- a/example/clientapi/smf/inc/smfclient/smfpostprovider.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfclient/smfpostprovider.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,29 +1,33 @@ -/* -* 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 -* -*/ +/** + * 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 SMFPOSTPROVIDER_H #define SMFPOSTPROVIDER_H #include #include #include +#include +#include "smfglobal.h" #include "smfprovider.h" #include "smfcontact.h" +#include "smfplace.h" class SmfProvider; //base-class for service provider class SmfContact; //class for Contact in a social network @@ -31,132 +35,167 @@ /** - * Location info + * class for information (text, image and url) contained in post in social network + * This could be changed to contain html data + * + * For those service provider which supports only string format, @see supportedFormats() */ -typedef QtMobility::QGeoPositionInfo SmfLocationInfo ; -class SmfPost; //class for information (text, image and url) contained in post in social network -class SmfContactModel; -class SmfStatusData; +class SmfPost : public QTextDocument + { + Q_OBJECT + +public: + SmfPost ( QObject * parent = 0 ); + SmfPost ( const QString & text, QObject * parent = 0 ); + +private: + QString* id; + SmfProvider* provider; + }; + +/** + * Presence info of the user + */ +enum SmfAppearenceInfo + { + ENotSupported, + EOnline, + EOffline, + EBusy, + EDoNotDisturb, + EAppearOffline, + EOther + }; //Post lists typedef QList SmfPostList; + /** + * @ingroup smf_client_group * Interface to post scrap/tweet like info. * Note that branding information for the particular service implementation * is available from getProvider() API. See also: * SmfProvider::serviceName(), SmfProvider::serviceIcon(), SmfProvider::description() * - * All of the functionality described here should be implemented by a service - * specific plug-in object. * Interface name for SmfPostProvider is org.symbian.smf.client.contact.posts */ class SMFCLIENT_EXPORT SmfPostProvider : public QObject -{ - Q_OBJECT + { + Q_OBJECT + +public: + /** + * Constructs SmfPostProvider. + * @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 + */ + SmfPostProvider(SmfProvider* baseProvider); + ~SmfPostProvider(); + public: - /** - * Constructs SmfPostProvider. - * @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 - */ - SmfPostProvider(SmfProvider* baseProvider = 0); - ~SmfPostProvider(); + /** + * returns maximum no of chars (unicode) that service provider can post without truncation + * negative value means no limit + */ + qint32 maxCharsInPost() const; + /** + * returns maximum no of items that can be returned in a single query to getPosts + * negative value means feature not supported. + */ + qint32 maxItems() const; - /** - * Presence info of the user - */ -enum SmfPresenceInfo - { - ENotSupported, - EOnline, - EOffline, - EBusy, - EDoNotDisturb, - EAppearOffline, - EOther - }; - -public: - /** - * Gets the posts asynchronously. The signal postsAvailable()with SmfPostList is emitted - * once the post lists are available - * @see postsAvailable() - */ - virtual void getPosts(SmfStatusData statusData) = 0; - - /** - * Gets the model - */ - virtual SmfContactModel model() = 0; + /** + * returns all the formatting of posts that this service provider supports. + * May return 0 items to mean only QString is supported. + */ + QVector supportedFormats () const; + + /** + * returns whether this SP supports Appearence @see SmfAppearenceInfo + */ + bool supportsAppearence () const; public slots: - /** - * Updates a post, the success of the post can be checked with signal + * Gets the posts asynchronously. The signal postsAvailable()with SmfPostList is emitted + * once the post lists are available + * @param user user's contact in this SP, omit for self contact + * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. + * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE + * @see postsAvailable() + */ + void posts(SmfContact* user = 0,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE); + + /** + * Updates a post to own area, the success of the post can be checked with signal * updatePostFinished() signal * @param postData data to be posted * @param location location data */ - virtual void updatePost(SmfPost& postData,SmfLocationInfo& location) = 0; // list of contact objects + void post(SmfPost& postData,SmfPlace& location) ; /** - * Updates a post, the success of the post can be checked with signal + * Updates the last post to own area with new data, the success of the post can be checked with signal * updatePostFinished() signal - * @param postData data to be posted + * @param postData edited/new data to be posted * @param location location data */ - virtual void updatePost(SmfPost& postData) = 0; // list of contact objects - - /** - * Updates a post to a particular Smf contact. the success of the post can be checked with signal - * updatePostFinished() signal. - * @param postData data to be posted - * @param contact contact to which the post is to be directed - * @param location location data - */ - virtual void updatePostDirected(SmfPost& postData,SmfContact& contact,SmfLocationInfo location) = 0; // list of contact objects - - /** - * Posts appearance info of the user. - * @param appearence user appearance - * @see SmfPresenceInfo - */ - virtual QList postAppearence(SmfPresenceInfo appearence) = 0; // appear offline, busy, do-not-disturb - - //APIs to get/set base provider info (SmfProvider) - - /** - * Gets the base provider info - */ - virtual SmfProvider* getProvider() = 0; - - /** - * Sets the base provider info - */ - virtual void setProvider(SmfProvider* provider) = 0; - - Q_SIGNALS: - + void updatePost(SmfPost& postData); + + /** + * Updates a post to a particular Smf contact. the success of the post can be checked with signal + * updatePostFinished() signal. + * @param postData data to be posted + * @param contact contact to which the post is to be directed + * @param location location data + */ + void postDirected(SmfPost& postData,SmfContact& contact,SmfPlace* location=0); + + /** + * Posts appearance info of the user.e.g. appear offline, busy, do-not-disturb + * @param appearence user appearance + * @see SmfPresenceInfo + * @return False on Failure/Not supported + */ + bool postAppearence(SmfAppearenceInfo appearence); + /** + * Share /a contact's post to user's friends and followers (e.g. retweet in twitter, share on facebook) + * emits updatePostFinished() signal when done. + * @param postData data to be posted + * @param contact contact to which the post belonged + * @param bool whether user changed items within the post + */ + void sharePost(SmfPost& postData,SmfContact& contact,bool edited); + + //APIs to get/set base provider info (SmfProvider) + + /** + * Gets the base provider info + */ + SmfProvider* getProvider() const; + +signals: + /** * Emitted when a request to getPosts() is finished * Note if number of posts is large, then it can download the list page by page * In that case this signal is emitted multiple times. * @param list list of posts * @param error error string - * @param pageNumber Page number + * @param resultPage Page number info */ - void postsAvailable(SmfPostList* list, QString error, int pageNumber=0); + void postsAvailable(SmfPostList* list, QString error, SmfResultPage resultPage); /** * Emitted when update post is finished. * @param success the success of the update */ - void updatePostFinished(bool success); + void postFinished(bool success); + + private: + SmfProvider* m_baseProvider; + }; -private: - SmfProvider* m_baseProvider; -}; - -SMF_GETSERVICES(SmfPostProvider, "org.symbian.smf.client.contact.posts\0.2") +SMF_SERVICE_NAME(SmfPostProvider, "org.symbian.smf.client.contact.posts\0.2") #endif // SMFPOSTPROVIDER_H diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfclient/smfprovider.h --- a/example/clientapi/smf/inc/smfclient/smfprovider.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfclient/smfprovider.h Tue Apr 06 16:35:37 2010 +0530 @@ -1,20 +1,21 @@ /** -* 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 -* -*/ + * 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 SMFPROVIDER_H #define SMFPROVIDER_H @@ -25,6 +26,7 @@ #include "../common/SmfClientGlobal.h" /** + * @ingroup smf_client_group * Interface for a base service provider. Other service provider classes contains * implementation of this base class so that each has access to service provider * information. @@ -48,30 +50,34 @@ * Localizable name of the service * @return service name */ - virtual QString serviceName() = 0; + QString& serviceName() const; /** * Logo of the service * @return logo image of the service */ - virtual QImage serviceIcon() = 0; // + QImage& serviceIcon() const; /** * Readable service description * @return service description */ - virtual QString description() = 0; // readable service description + QString description() const; /* * Website of the service */ - virtual QUrl serviceUrl() = 0; // + QUrl serviceUrl() const; /** * URL of the application providing this service */ - virtual QUrl applicationUrl() = 0; // + QUrl applicationUrl() const; // + /** + * service types - list of interfaces that this provider support + */ + QList serviceTypes() const; }; /** * Externalization @@ -81,5 +87,5 @@ * Internalization */ QDataStream &operator>>(QDataStream &, SmfProvider&); -SMF_GETSERVICES(SmfProvider, "org.symbian.smf.client.provider\0.2") + #endif // SMFPROVIDER_H diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/base/smfpluginbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/smfplugins/base/smfpluginbase.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,106 @@ +/** + * 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 SmfPluginBase class is the base class for all plugins. + * + */ + +#ifndef SMFPLUGINBASE_H_ +#define SMFPLUGINBASE_H_ + +#include +#include +#include + +/** + * @ingroup smf_plugin_group + * The SmfPluginBase class is the base class for all plugins + */ +class SmfPluginBase : public QObject + { + Q_OBJECT + +public: + /** + * Constructor with default argument + * @param aParent The parent object + */ + SmfPluginBase( QObject* aParent = 0 ); + + /** + * Destructor + */ + ~SmfPluginBase( ); + + /** + * Method to get the provider information + * @return Instance of SmfProviderBase + */ + virtual SmfProviderBase* getProviderInfo( ) = 0; + + /** + * Method to get the result for a network request. + * @param aTransportResult The result of transport operation + * @param aReply The QNetworkReply instance for the request + * @param aResult [out] An output parameter to the plugin manager.If the + * return value is SmfSendRequestAgain, QVariant will be of type + * SmfPluginRequestData. + * + * For SmfContactFetcherPlugin: If last operation was friends() or followers() + * or search() or searchInGroup() or searchNear(), aResult will be of type + * QList. If last operation was groups(), aResult will be of + * type QList + * For SmfPostProviderPlugin: If last operation was retrieve(), aResult will be + * of type QList. If last operation was post() or updatePost() or + * postDirected() or commentOnAPost() or postAppearence(), aResult will be + * of type bool + * For SmfLyricsServicePlugin: If last operation was lyrics(), aResult will + * be of type SmfLyrics. If last operation was subtitles(), aResult will + * be of type SmfSubtitle. + * For SmfMusicEventsPlugin: If last operation was events(), aResult will + * be of type QList. If last operation was venues(), aResult + * will be of type QList. If last operation was postEvents(), + * aResult will be of type bool + * For SmfMusicSearchPlugin: If last operation was recommendations() or + * tracks() or trackInfo(), aResult will be of type QList. + * If last operation was stores(), aResult will be of type + * QList. If last operation was postCurrentPlaying(), + * aResult will be of type bool. + * For SmfMusicServicePlugin: If last operation was userInfo(), aResult + * will be of type SmfMusicProfile. If last operation was searchUser(), + * aResult will be of type QList. + * For SmfPlaylistServicePlugin: If last operation was playlists() or + * playlistsOf(), aResult will be of type QList. If last + * operation was addToPlaylist() or postCurrentPlayingPlaylist(), + * aResult will be of type bool. + * For SmfGalleryPlugin: If last operation was pictures(), aResult will + * be of type QList. If last operation was description(), + * aResult will be of type QString. If last operation was upload() or + * postComment(), aResult will be of type bool. + * + * @param aRetType [out] SmfPluginRetType + * @param aPageResult [out] The SmfResultPage structure variable + */ + virtual SmfPluginError responseAvailable( + const SmfTransportResult aTransportResult, + QNetworkReply *aReply, + QVariant* aResult, + SmfPluginRetType aRetType, + SmfResultPage &aPageResult ) = 0; + + }; + + +#endif /* SMFPLUGINBASE_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/base/smfproviderbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/smfplugins/base/smfproviderbase.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,170 @@ +/** + * 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 Provider Base class is the class that has to be contained as a member + * in all Plug-in Interfaces. + * + */ + +#ifndef SMFPROVIDERBASE_H_ +#define SMFPROVIDERBASE_H_ + +#include +#include +#include +#include +#include +#include + +class SmfProviderBasePrivate; + +/** + * @ingroup smf_plugin_group + * The Provider Base class is the class that has to be contained as a member + * in all Plug-in Interfaces. + * + * All of plug-ins should contain this class as a member and should also + * contain a public method to get instance of this class. + */ +class SmfProviderBase : public QObject + { + Q_OBJECT + +public: + /** + * Constructor with default argument + * @param aParent The parent object + */ + SmfProviderBase( QObject* aParent = 0 ); + + /** + * Copy Constructor + * @param aOther The reference object + */ + SmfProviderBase( const SmfProviderBase &aOther ); + + /** + * Destructor + */ + ~SmfProviderBase( ); + + /** + * Method to get the Localisable name of the service. + * @return The Localisable name of the service. + */ + QString serviceName( ) const; + + /** + * Method to get the Logo of the service + * @return The Logo of the service + */ + QImage serviceIcon( ) const; + + /** + * Method to get the Readable service description + * @return The Readable service description + */ + QString description( ) const; + + /** + * Method to get the Website of the service + * @return The Website of the service + */ + QUrl serviceUrl( ) const; + + /** + * Method to get the URL of the Application providing this service + * @return The URL of the Application providing this service + */ + QUrl applicationUrl( ) const; + + /** + * Method to get the Icon of the application + * @return The Icon of the application + */ + QImage applicationIcon( ) const; + + /** + * Method to get the Plugin specific ID + * @return The Plugin specific ID + */ + quint32 pluginId( ) const; + + /** + * Method to get the ID of the authentication application + * for this service + * @param aProgram The authentication application name + * @param aArguments List of arguments required for authentication app + * @param aMode Strting mode for authentication application + * @return The ID of the authentication application + */ + quint32 authenticationApp( QString &aProgram, QStringList & aArguments, + QIODevice::OpenModeFlag aMode = QIODevice::ReadWrite ) const; + + /** + * Method to get the unique registration ID provided by the + * Smf for authorised plugins + * @return The unique registration ID/token provided by the Smf for + * authorised plugins + */ + QString smfRegistrationId( ) const; + + /** + * Method to get the data usage of each plugin + * @return The data usage structure + */ + SmfPluginDataUsage getDataUsage( ) const; + + /** + * Method to get the reference count for loading. + * The reference count increased with each load request and decreased + * with each unload request + * @return The reference count value for loading of the plugins + */ + uint getLoadRefCount( ) const; + +private: + QSharedDataPointer d; + + friend QDataStream &operator<<( QDataStream &aDataStream, + const SmfProviderBase &aProviderBase ); + + friend QDataStream &operator>>( QDataStream &aDataStream, + SmfProviderBase &aProviderBase ); + + }; + + +/** + * Method for Externalization. Writes the SmfProviderBase object to + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be written + * @param aProviderBase The SmfProviderBase object to be externalized + * @return reference to the written stream + */ +QDataStream &operator<<( QDataStream &aDataStream, + const SmfProviderBase &aProviderBase ); + +/** + * Method for Internalization. Reads a SmfProviderBase object from + * the stream and returns a reference to the stream. + * @param aDataStream Stream to be read + * @param aProviderBase The SmfProviderBase object to be internalized + * @return reference to the stream + */ +QDataStream &operator>>( QDataStream &aDataStream, + SmfProviderBase &aProviderBase); + +#endif /* SMFPROVIDERBASE_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/base/smfproviderbase_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/clientapi/smf/inc/smfplugins/base/smfproviderbase_p.h Tue Apr 06 16:35:37 2010 +0530 @@ -0,0 +1,86 @@ +/** + * 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: + * Private class implemented for implicit sharing of SmfProviderBase class + * + */ + +#ifndef SMFPROVIDERBASE_P_H_ +#define SMFPROVIDERBASE_P_H_ + +#include +#include +#include +#include +#include + + +class SmfProviderBasePrivate : public QSharedData +{ +public: + /** + * Constructor + */ + SmfProviderBasePrivate( ) { + m_serviceName.clear(); + m_description.clear(); + m_serviceUrl.clear(); + m_applicationUrl.clear(); + m_pluginId = 0; + m_authenticationAppId = 0; + m_registrationId.clear(); + m_loadRefCount = 0; + } + + /** + * Copy Consturctor + * @param aOther The reference object to be copy constructed + */ + SmfProviderBasePrivate( const SmfProviderBasePrivate &aOther ) : + QSharedData ( aOther ), + m_serviceName ( aOther.m_serviceName ), + m_serviceIcon ( aOther.m_serviceIcon ), + m_description ( aOther.m_description ), + m_serviceUrl ( aOther.m_serviceUrl ), + m_applicationUrl ( aOther.m_applicationUrl ), + m_applicationIcon ( aOther.m_applicationIcon ), + m_pluginId ( aOther.m_pluginId ), + m_authenticationAppId ( aOther.m_authenticationAppId ), + m_registrationId ( aOther.m_registrationId ), + m_usage ( aOther.m_usage ), + m_loadRefCount ( aOther.m_loadRefCount ) { } + + /** + * Destructor + */ + ~SmfProviderBasePrivate( ); + + QString m_serviceName; // the Localisable name of the service + QImage m_serviceIcon; // the Logo of the service + QString m_description; // the Readable service description + QUrl m_serviceUrl; // the Website of the service + QUrl m_applicationUrl; // URL of the Application providing this service + QImage m_applicationIcon; //Icon of the application + quint32 m_pluginId; // The Plugin specific ID + quint32 m_authenticationAppId; // ID of the authentication application for this service + QString m_registrationId; // unique registration ID provided by the + // Smf for authorised plugins + SmfPluginDataUsage m_usage; //data usage of each plugin + uint m_loadRefCount; // reference count increased with each load request + // and decreased with each unload request + +}; + +#endif /* SMFPROVIDERBASE_P_H_ */ diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/smfcontacts/smfcontactfetcherplugin.h --- a/example/clientapi/smf/inc/smfplugins/smfcontacts/smfcontactfetcherplugin.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfplugins/smfcontacts/smfcontactfetcherplugin.h Tue Apr 06 16:35:37 2010 +0530 @@ -8,9 +8,9 @@ * 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}" + * under the terms of the "Eclipse Public License v1.0" * which accompanies this distribution, and is available - * at the URL "{LicenseUrl}". + * at the URL "http://www.eclipse.org/legal/epl-v10.html" * * @section DESCRIPTION * @@ -20,11 +20,13 @@ #ifndef SMFCONTACTFETCHERPLUGIN_H_ #define SMFCONTACTFETCHERPLUGIN_H_ -#include +#include #include #include +#include /** + * @ingroup smf_plugin_group * Interface specification for fetching contacts. This class provides * basic functionality to allow applications to obtain list of * friends, followers, groups of a user in a social networking service. @@ -32,7 +34,7 @@ * All of the functionality described here should be implemented by a service * specific plug-in. */ -class SmfContactFetcherPlugin : public QObject +class SmfContactFetcherPlugin : public SmfPluginBase { Q_OBJECT public: @@ -48,100 +50,79 @@ ~SmfContactFetcherPlugin( ); /** - * Method to get the provider information - * @return Instance of SmfProviderBase - */ - virtual SmfProviderBase* getProviderInfo( ) = 0; - - /** * Method to get the list of friends * @param aRequest [out] The request data to be sent to network - * @param aContact to search for friend of a friend, - * for self friend this parameter need not be included * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ virtual SmfPluginError friends( SmfPluginRequestData *aRequest, - const SmfContact aContact = 0, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to get the list of followers * @param aRequest [out] The request data to be sent to network - * @param aContact to search for follower of a friend, for self - * followers this parameter need not be included - * @param aPageNum The page to be extracted - * @param aItemsPerPage Number of items per page - * @return SmfPluginError Plugin error if any, else SmfPluginErrNone - */ - virtual SmfPluginError followers( SmfPluginRequestData *aRequest, - const SmfContact aContact = 0, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; - - /** - * Method to search for a contact - * @param aContact contact to be searched - * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError search( const SmfContact &aContact, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10) = 0; + virtual SmfPluginError followers( SmfPluginRequestData *aRequest, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; + + /** + * Method to search for a contact + * @param aRequest [out] The request data to be sent to network + * @param aContact contact to be searched + * @param aPageNum The page to be extracted + * @param aItemsPerPage Number of items per page + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + virtual SmfPluginError search( SmfPluginRequestData *aRequest, + const SmfContact *aContact, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; + + /** + * Method to search for contacts (friends) who are near the user. + * Proximity defines accuracy level + * @param aRequest [out] The request data to be sent to network + * @param aLocation The location search criteria + * @param aProximity location search boundary + * @param aPageNum The page to be extracted + * @param aItemsPerPage Number of items per page + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + virtual SmfPluginError searchNear( SmfPluginRequestData *aRequest, + const SmfPlace* aLocation, + const SmfLocationSearchBoundary aProximity, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to get the list of groups * @param aRequest [out] The request data to be sent to network - * @param aContact to search for groups of a friend, for self - * group this parameter need not be included * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ virtual SmfPluginError groups( SmfPluginRequestData *aRequest, - const SmfContact aContact = 0, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to search for a contact in a group + * @param aRequest [out] The request data to be sent to network * @param aGroup the group in which to search - * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError searchInGroup( const SmfGroup &aGroup, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; - - /** - * Method to get the result for a network request. - * @param aTransportResult The result of transport operation - * @param aReply The QNetworkReply instance for the request - * @param aResult [out] An output parameter to the plugin manager.If the - * return value is SmfSendRequestAgain, QVariant will be of type - * SmfPluginRequestData. - * If last operation was friends() or followers() or search() or - * searchInGroup(), aResult will be of type QList - * If last operation was groups(), aResult will be of type QList - * @param aRetType [out] SmfPluginRetType - * @param aIsLastPage [out] true if this the last page, else false - * @return SmfPluginError - */ - virtual SmfPluginError responseAvailable( - const SmfTransportResult aTransportResult, - QNetworkReply *aReply, - QVariant* aResult, - SmfPluginRetType aRetType, - bool aIsLastPage) = 0; + virtual SmfPluginError searchInGroup( SmfPluginRequestData *aRequest, + const SmfGroup &aGroup, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; }; diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/smfcontacts/smfpostproviderplugin.h --- a/example/clientapi/smf/inc/smfplugins/smfcontacts/smfpostproviderplugin.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfplugins/smfcontacts/smfpostproviderplugin.h Tue Apr 06 16:35:37 2010 +0530 @@ -8,9 +8,9 @@ * 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}" + * under the terms of the "Eclipse Public License v1.0" * which accompanies this distribution, and is available - * at the URL "{LicenseUrl}". + * at the URL "http://www.eclipse.org/legal/epl-v10.html" * * @section DESCRIPTION * @@ -20,11 +20,10 @@ #ifndef SMFPOSTPROVIDERPLUGIN_H_ #define SMFPOSTPROVIDERPLUGIN_H_ -#include +#include #include #include -#include - +#include /** * SmfPresenceInfo. @@ -43,6 +42,7 @@ }; /** + * @ingroup smf_plugin_group * Interface to get/update the posts to a service provider. This class * provides basic functionality to allow applications to obtain list of * posts, updates posts or change the presence information to a social @@ -51,7 +51,7 @@ * All of the functionality described here should be implemented by a service * specific plug-in. */ -class SmfPostProviderPlugin : public QObject +class SmfPostProviderPlugin : public SmfPluginBase { Q_OBJECT public: @@ -67,76 +67,120 @@ ~SmfPostProviderPlugin( ); /** - * Method to get the provider information - * @return Instance of SmfProviderBase + * Method that returns maximum no of chars (unicode) that service + * provider can post without truncation. Negative value means + * no limit + * @return Max characters that can be posted without truncation + */ + virtual qint32 maxCharsInPost( ) const = 0; + /** + * Method that returns maximum no of items that can be returned + * in a single query to getPosts. Negative value means feature + * not supported. + * @return Max items that can be returned in a single query */ - virtual SmfProviderBase* getProviderInfo( ) = 0; + virtual qint32 maxItems( ) const = 0; + + /** + * supportedFormats ( ) const = 0; + + /** + * Method that returns whether this SP supports Appearence + * @return Returns true if Appearance is supported, else false. + * @see SmfAppearenceInfo + */ + virtual bool supportsAppearence ( ) const = 0; /** * Method to get the latest posts - * @param aStatusData * @param aRequest [out] The request data to be sent to network + * @param aUser The user's contact in this SP, omit for self contact * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError getPosts( const SmfStatusData aStatusData, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; + virtual SmfPluginError retrieve( SmfPluginRequestData *aRequest, + const SmfContact* aUser = 0, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; + /** - * Method to update a post + * Method to update a post to own area. + * @param aRequest [out] The request data to be sent to network * @param aPostData The post data to be posted * @param aLocation The location - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError updatePost( const SmfPost aPostData, - const QtMobility::QContactGeolocation aLocation, - SmfPluginRequestData *aRequest ) = 0; + virtual SmfPluginError post( SmfPluginRequestData *aRequest, + const SmfPost aPostData, + const SmfPlace aLocation ) = 0; + + /** + * Method to update the last post to own area with new data + * @param aRequest [out] The request data to be sent to network + * @param aPostData The edited/new data to be posted + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + virtual SmfPluginError updatePost( SmfPluginRequestData *aRequest, + const SmfPost aPostData ) = 0; /** * Method to update a post to a particular contact + * @param aRequest [out] The request data to be sent to network * @param aPostData The post data to be posted * @param aContact The contact where the data has to be posted * @param aLocation The location - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError updatePostDirected( const SmfPost aPostData, + virtual SmfPluginError postDirected( SmfPluginRequestData *aRequest, + const SmfPost aPostData, const SmfContact aContact, - const QtMobility::QContactGeolocation aLocation, - SmfPluginRequestData *aRequest ) = 0; + const SmfPlace aLocation = NULL ) = 0; + + /** - * Method to update the presence information of the user - * @param aAppearence The appearence information + * Method to post a comment on a post. * @param aRequest [out] The request data to be sent to network - * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + * @param aTarget Post on which comment has to be posted + * @param aComment comment to be posted + * @param aLocation location data */ - virtual SmfPluginError postAppearence( const SmfPresenceInfo aAppearence, - SmfPluginRequestData *aRequest ) = 0; + virtual SmfPluginError commentOnAPost(SmfPluginRequestData *aRequest, + const SmfPost& aTarget, + const SmfPost& aComment, + const SmfPlace* aLocation = NULL); /** - * Method to get the result for a network request. - * @param aTransportResult The result of transport operation - * @param aReply The QNetworkReply instance for the request - * @param aResult [out] An output parameter to the plugin manager.If the - * return value is SmfSendRequestAgain, QVariant will be of type - * SmfPluginRequestData. - * If last operation was getPosts(), aResult will be of type QList - * If last operation was updatePost() or updatePostDirected() or - * postAppearence, aResult will be of type bool - * @param aRetType [out] SmfPluginRetType - * @param aIsLastPage [out] true if this the last page, else false - * @return SmfPluginError + * Method to update the presence information of the user + * @param aRequest [out] The request data to be sent to network + * @param aAppearence The appearence information + * @param aStatus The status string + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError responseAvailable( - const SmfTransportResult aTransportResult, - QNetworkReply *aReply, - QVariant* aResult, - SmfPluginRetType aRetType, - bool aIsLastPage) = 0; + virtual SmfPluginError postAppearence( SmfPluginRequestData *aRequest, + const SmfPresenceInfo aAppearence, + const QString aStatus ) = 0; + + /** + * Share /a contact's post to user's friends and followers + * (e.g. retweet in twitter, share on facebook) + * @param aRequest [out] The request data to be sent to network + * @param aPostData data to be posted + * @param aContact contact to which the post belonged + * @param aEdited whether user changed items within the post + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + virtual SmfPluginError sharePost( SmfPluginRequestData *aRequest, + const SmfPost& aPostData, + const SmfContact& aContact, + const bool aEdited); + }; diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/smfmusic/smflyricsserviceplugin.h --- a/example/clientapi/smf/inc/smfplugins/smfmusic/smflyricsserviceplugin.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfplugins/smfmusic/smflyricsserviceplugin.h Tue Apr 06 16:35:37 2010 +0530 @@ -8,9 +8,9 @@ * 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}" + * under the terms of the "Eclipse Public License v1.0" * which accompanies this distribution, and is available - * at the URL "{LicenseUrl}". + * at the URL "http://www.eclipse.org/legal/epl-v10.html" * * @section DESCRIPTION * @@ -20,20 +20,20 @@ #ifndef SMFLYRICSSERVICEPLUGIN_H_ #define SMFLYRICSSERVICEPLUGIN_H_ -#include +#include #include #include #include #include -#include /** + * @ingroup smf_plugin_group * Interface specification for music track lyrics * * All of the functionality described here should be implemented by a service * specific plug-in. */ -class SmfLyricsServicePlugin : public QObject +class SmfLyricsServicePlugin : public SmfPluginBase { Q_OBJECT public: @@ -49,50 +49,24 @@ ~SmfLyricsServicePlugin( ); /** - * Method to get the provider information - * @return Instance of SmfProviderBase - */ - virtual SmfProviderBase* getProviderInfo( ) = 0; - - /** * Method to get the lyrics + * @param aRequest [out] The request data to be sent to network * @param aTrack The track whose lyrics need to be fetched - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError lyrics( const SmfTrackInfo aTrack, - SmfPluginRequestData *aRequest ) = 0; + virtual SmfPluginError lyrics( SmfPluginRequestData *aRequest, + const SmfTrackInfo aTrack ) = 0; /** * Method to get the subtitle + * @param aRequest [out] The request data to be sent to network * @param aTrack The track whose subtitle need to be fetched - * @param aRequest [out] The request data to be sent to network * @param aFilter The subtitle search filter if any * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError subtitles( const SmfTrackInfo aTrack, - SmfPluginRequestData *aRequest, - const SmfSubtitleSearchFilter aFilter = 0 ) = 0; - - /** - * Method to get the result for a network request. - * @param aTransportResult The result of transport operation - * @param aReply The QNetworkReply instance for the request - * @param aResult [out] An output parameter to the plugin manager.If the - * return value is SmfSendRequestAgain, QVariant will be of type - * SmfPluginRequestData. - * If last operation was lyrics(), aResult will be of type SmfLyrics - * If last operation was subtitles(), aResult will be of type SmfSubtitle - * @param aRetType [out] SmfPluginRetType - * @param aIsLastPage [out] true if this the last page, else false - * @return SmfPluginError - */ - virtual SmfPluginError responseAvailable( - const SmfTransportResult aTransportResult, - QNetworkReply *aReply, - QVariant* aResult, - SmfPluginRetType aRetType, - bool aIsLastPage) = 0; + virtual SmfPluginError subtitles( SmfPluginRequestData *aRequest, + const SmfTrackInfo aTrack, + const SmfSubtitleSearchFilter aFilter = SubtitleAll ) = 0; }; diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/smfmusic/smfmusiceventsplugin.h --- a/example/clientapi/smf/inc/smfplugins/smfmusic/smfmusiceventsplugin.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfplugins/smfmusic/smfmusiceventsplugin.h Tue Apr 06 16:35:37 2010 +0530 @@ -8,9 +8,9 @@ * 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}" + * under the terms of the "Eclipse Public License v1.0" * which accompanies this distribution, and is available - * at the URL "{LicenseUrl}". + * at the URL "http://www.eclipse.org/legal/epl-v10.html" * * @section DESCRIPTION * @@ -22,14 +22,15 @@ #ifndef SMFMUSICEVENTSPLUGIN_H_ #define SMFMUSICEVENTSPLUGIN_H_ -#include +#include #include #include -#include +#include using namespace QtMobility; /** + * @ingroup smf_plugin_group * Interface specification for music events * * All of the functionality described here should be implemented by a service @@ -37,7 +38,7 @@ * * Note: This class has dependencies on QtMobility project */ -class SmfMusicEventsPlugin : public QObject +class SmfMusicEventsPlugin : public SmfPluginBase { Q_OBJECT public: @@ -53,81 +54,52 @@ ~SmfMusicEventsPlugin( ); /** - * Method to get the provider information - * @return Instance of SmfProviderBase - */ - virtual SmfProviderBase* getProviderInfo( ) = 0; - - /** * Method to get the events based on location + * @param aRequest [out] The request data to be sent to network * @param aLocation Location of the event - * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError events( const QtMobility::QContactGeolocation aLocation, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; + virtual SmfPluginError events( SmfPluginRequestData *aRequest, + const QtMobility::QContactGeolocation aLocation, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to get the venues based on location + * @param aRequest [out] The request data to be sent to network * @param aLocation Location of the venue - * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError venues( const QtMobility::QContactGeolocation aLocation, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; + virtual SmfPluginError venues( SmfPluginRequestData *aRequest, + const QtMobility::QContactGeolocation aLocation, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to get the events based on venues + * @param aRequest [out] The request data to be sent to network * @param aVenue Venue of the event - * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError events( const SmfVenue aVenue, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; + virtual SmfPluginError events( SmfPluginRequestData *aRequest, + const SmfPlace aVenue, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to post events - * of posting the events is available + * @param aRequest [out] The request data to be sent to network * @param aEventList The list of events to be posted - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError postEvents( const QList aEventList, - SmfPluginRequestData *aRequest ) = 0; - - - /** - * Method to get the result for a network request. - * @param aTransportResult The result of transport operation - * @param aReply The QNetworkReply instance for the request - * @param aResult [out] An output parameter to the plugin manager.If the - * return value is SmfSendRequestAgain, QVariant will be of type - * SmfPluginRequestData. - * If last operation was events(), aResult will be of type QList - * If last operation was venues(), aResult will be of type QList - * If last operation was postEvents(), aResult will be of type bool - * @param aRetType [out] SmfPluginRetType - * @param aIsLastPage [out] true if this the last page, else false - * @return SmfPluginError - */ - virtual SmfPluginError responseAvailable( - const SmfTransportResult aTransportResult, - QNetworkReply *aReply, - QVariant* aResult, - SmfPluginRetType aRetType, - bool aIsLastPage) = 0; + virtual SmfPluginError postEvents( SmfPluginRequestData *aRequest, + const QList aEventList ) = 0; }; diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/smfmusic/smfmusicsearchplugin.h --- a/example/clientapi/smf/inc/smfplugins/smfmusic/smfmusicsearchplugin.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfplugins/smfmusic/smfmusicsearchplugin.h Tue Apr 06 16:35:37 2010 +0530 @@ -8,9 +8,9 @@ * 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}" + * under the terms of the "Eclipse Public License v1.0" * which accompanies this distribution, and is available - * at the URL "{LicenseUrl}". + * at the URL "http://www.eclipse.org/legal/epl-v10.html" * * @section DESCRIPTION * @@ -20,12 +20,13 @@ #ifndef SMFMUSICSEARCHPLUGIN_H_ #define SMFMUSICSEARCHPLUGIN_H_ -#include +#include #include #include #include /** + * @ingroup smf_plugin_group * Interface specification for music search services. This class * provides basic functionality to allow applications to search for * tracks, get recommented tracks etc @@ -33,7 +34,7 @@ * All of the functionality described here should be implemented by a service * specific plug-in. */ -class SmfMusicSearchPlugin : public QObject +class SmfMusicSearchPlugin : public SmfPluginBase { Q_OBJECT public: @@ -49,96 +50,69 @@ ~SmfMusicSearchPlugin( ); /** - * Method to get the provider information - * @return Instance of SmfProviderBase - */ - virtual SmfProviderBase* getProviderInfo( ) = 0; - - /** * Method to get recommended tracks + * @param aRequest [out] The request data to be sent to network * @param aTrack The track for which similar recommendations * need to be fetched. - * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError recommendations( const SmfTrackInfo aTrack, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; + virtual SmfPluginError recommendations( SmfPluginRequestData *aRequest, + const SmfTrackInfo aTrack, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to get similar tracks + * @param aRequest [out] The request data to be sent to network * @param aTrack The track for which similar tracks * need to be fetched. - * @param aRequest [out] The request data to be sent to network - * @param aPageNum The page to be extracted - * @param aItemsPerPage Number of items per page - * @return SmfPluginError Plugin error if any, else SmfPluginErrNone - */ - virtual SmfPluginError tracks( const SmfTrackInfo aTrack, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10) = 0; - - /** - * Method to get tracks having a similar finger print - * @param aSignature The finger print to be searched for need to be - * fetched. - * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError trackInfo( const SmfMusicFingerPrint aSignature, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; + virtual SmfPluginError tracks( SmfPluginRequestData *aRequest, + const SmfTrackInfo aTrack, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** - * Method to search information about where to buy this song from - * @param aTrack The track for which stores need to be searched + * Method to get tracks having a similar finger print * @param aRequest [out] The request data to be sent to network + * @param aSignature The finger print to be searched for need to be + * fetched. * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError stores( const SmfTrackInfo aTrack, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10 ) = 0; + virtual SmfPluginError trackInfo( SmfPluginRequestData *aRequest, + const SmfMusicFingerPrint aSignature, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; + + /** + * Method to search information about where to buy this song from + * @param aRequest [out] The request data to be sent to network + * @param aTrack The track for which stores need to be searched + * @param aPageNum The page to be extracted + * @param aItemsPerPage Number of items per page + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + virtual SmfPluginError stores( SmfPluginRequestData *aRequest, + const SmfTrackInfo aTrack, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to post the currently playing track + * @param aRequest [out] The request data to be sent to network * @param aTrack The current playing track, that should be posted - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError postCurrentPlaying( const SmfTrackInfo aTrack, - SmfPluginRequestData *aRequest ) = 0; - - - /** - * Method to get the result for a network request. - * @param aTransportResult The result of transport operation - * @param aReply The QNetworkReply instance for the request - * @param aResult [out] An output parameter to the plugin manager.If the - * return value is SmfSendRequestAgain, QVariant will be of type - * SmfPluginRequestData. - * If last operation was recommendations()or tracks() or trackInfo(), - * aResult will be of type QList - * If last operation was postCurrentPlaying(), aResult will be of type bool - * @param aRetType [out] SmfPluginRetType - * @param aIsLastPage [out] true if this the last page, else false - * @return SmfPluginError - */ - virtual SmfPluginError responseAvailable( - const SmfTransportResult aTransportResult, - QNetworkReply *aReply, - QVariant* aResult, - SmfPluginRetType aRetType, - bool aIsLastPage) = 0; + virtual SmfPluginError postCurrentPlaying( + SmfPluginRequestData *aRequest, + const SmfTrackInfo aTrack ) = 0; }; diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/smfmusic/smfmusicserviceplugin.h --- a/example/clientapi/smf/inc/smfplugins/smfmusic/smfmusicserviceplugin.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfplugins/smfmusic/smfmusicserviceplugin.h Tue Apr 06 16:35:37 2010 +0530 @@ -8,9 +8,9 @@ * 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}" + * under the terms of the "Eclipse Public License v1.0" * which accompanies this distribution, and is available - * at the URL "{LicenseUrl}". + * at the URL "http://www.eclipse.org/legal/epl-v10.html" * * @section DESCRIPTION * @@ -20,11 +20,12 @@ #ifndef SMFMUSICSERVICEPLUGIN_H_ #define SMFMUSICSERVICEPLUGIN_H_ -#include +#include #include -#include +#include /** + * @ingroup smf_plugin_group * Interface specification for music services. This class provides basic * functionality to allow application to search for a user or check for * user information etc. @@ -32,7 +33,7 @@ * All of the functionality described here should be implemented by a service * specific plug-in. */ -class SmfMusicServicePlugin : public QObject +class SmfMusicServicePlugin : public SmfPluginBase { Q_OBJECT public: @@ -48,12 +49,6 @@ ~SmfMusicServicePlugin( ); /** - * Method to get the provider information - * @return Instance of SmfProviderBase - */ - virtual SmfProviderBase* getProviderInfo( ) = 0; - - /** * Method to get self profile information * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone @@ -62,39 +57,17 @@ /** * Method to search information about other service users for a - * particular venue - * @param aVenue The venue which is the search criteria + * particular place * @param aRequest [out] The request data to be sent to network + * @param aPlace The place which is the search criteria * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError searchUser( const SmfVenue aVenue, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10) = 0; - - - /** - * Method to get the result for a network request. - * @param aTransportResult The result of transport operation - * @param aReply The QNetworkReply instance for the request - * @param aResult [out] An output parameter to the plugin manager.If the - * return value is SmfSendRequestAgain, QVariant will be of type - * SmfPluginRequestData. - * If last operation was userInfo(), aResult will be of type SmfMusicProfile - * If last operation was searchUser(), aResult will be of type - * QList - * @param aRetType [out] SmfPluginRetType - * @param aIsLastPage [out] true if this the last page, else false - * @return SmfPluginError - */ - virtual SmfPluginError responseAvailable( - const SmfTransportResult aTransportResult, - QNetworkReply *aReply, - QVariant* aResult, - SmfPluginRetType aRetType, - bool aIsLastPage) = 0; + virtual SmfPluginError searchUser( SmfPluginRequestData *aRequest, + const SmfPlace aPlace, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; }; diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/smfmusic/smfplaylistserviceplugin.h --- a/example/clientapi/smf/inc/smfplugins/smfmusic/smfplaylistserviceplugin.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfplugins/smfmusic/smfplaylistserviceplugin.h Tue Apr 06 16:35:37 2010 +0530 @@ -8,9 +8,9 @@ * 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}" + * under the terms of the "Eclipse Public License v1.0" * which accompanies this distribution, and is available - * at the URL "{LicenseUrl}". + * at the URL "http://www.eclipse.org/legal/epl-v10.html" * * @section DESCRIPTION * @@ -20,12 +20,13 @@ #ifndef SMFPLAYLISTSERVICEPLUGIN_H_ #define SMFPLAYLISTSERVICEPLUGIN_H_ -#include +#include #include #include #include /** + * @ingroup smf_plugin_group * Interface specification for playlists service. This class provides * basic functionality to allow applications to get playlists of a user, * add some track to an existing playlist, post the current playing @@ -34,7 +35,7 @@ * All of the functionality described here should be implemented by a service * specific plug-in. */ -class SmfPlaylistServicePlugin : public QObject +class SmfPlaylistServicePlugin : public SmfPluginBase { Q_OBJECT public: @@ -50,92 +51,49 @@ ~SmfPlaylistServicePlugin( ); /** - * Method to get the provider information - * @return Instance of SmfProviderBase - */ - virtual SmfProviderBase* getProviderInfo( ) = 0; - - /** * Method to get the playlist * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError playlists( - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10) = 0; + virtual SmfPluginError playlists( SmfPluginRequestData *aRequest, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to get the playlist of a particular user + * @param aRequest [out] The request data to be sent to network * @param aUser The user whose playlists need to be fetched - * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError playlistsOf( const SmfMusicProfile aUser, - SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10) = 0; + virtual SmfPluginError playlistsOf( SmfPluginRequestData *aRequest, + const SmfMusicProfile aUser, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to add tracks to a playlist + * @param aRequest [out] The request data to be sent to network * @param aPlaylist The playlist where tracks should be added * @param aTracks The tracks to be added to the playlist - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError* addToPlaylist( const SmfPlaylist aPlaylist, - const QList aTracks, - SmfPluginRequestData *aRequest ) = 0; + virtual SmfPluginError addToPlaylist( SmfPluginRequestData *aRequest, + const SmfPlaylist aPlaylist, + const QList aTracks ) = 0; /** * Method to post the current playing playlist + * @param aRequest [out] The request data to be sent to network * @param aPlaylist The current playing playlist which should be posted - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError* postCurrentPlayingPlaylist( - const SmfPlaylist aPlaylist, - SmfPluginRequestData *aRequest ) = 0; - - - /** - * Method to get the result for a network request. - * @param aTransportResult The result of transport operation - * @param aReply The QNetworkReply instance for the request - * @param aResult An output parameter to the plugin manager.If the - * return value is SmfSendRequestAgain, QVariant will be of type - * SmfPluginRequestData. - * If last operation was playlists() or playlistsOf(), aResult will be of - * type QList - * If last operation was addToPlaylist() or postCurrentPlayingPlaylist(), - * aResult will be of type bool - * @return SmfPluginRetType - */ - /** - * Method to get the result for a network request. - * @param aTransportResult The result of transport operation - * @param aReply The QNetworkReply instance for the request - * @param aResult [out] An output parameter to the plugin manager.If the - * return value is SmfSendRequestAgain, QVariant will be of type - * SmfPluginRequestData. - * If last operation was playlists() or playlistsOf(), aResult will be of - * type QList - * If last operation was addToPlaylist() or postCurrentPlayingPlaylist(), - * aResult will be of type bool - * @param aRetType [out] SmfPluginRetType - * @param aIsLastPage [out] true if this the last page, else false - * @return SmfPluginError - */ - virtual SmfPluginError responseAvailable( - const SmfTransportResult aTransportResult, - QNetworkReply *aReply, - QVariant* aResult, - SmfPluginRetType aRetType, - bool aIsLastPage) = 0; + virtual SmfPluginError postCurrentPlayingPlaylist( + SmfPluginRequestData *aRequest, + const SmfPlaylist aPlaylist ) = 0; }; diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/smfpictures/smfgalleryplugin.h --- a/example/clientapi/smf/inc/smfplugins/smfpictures/smfgalleryplugin.h Thu Mar 25 14:44:08 2010 +0530 +++ b/example/clientapi/smf/inc/smfplugins/smfpictures/smfgalleryplugin.h Tue Apr 06 16:35:37 2010 +0530 @@ -8,9 +8,9 @@ * 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}" + * under the terms of the "Eclipse Public License v1.0" * which accompanies this distribution, and is available - * at the URL "{LicenseUrl}". + * at the URL "http://www.eclipse.org/legal/epl-v10.html" * * @section DESCRIPTION * @@ -20,11 +20,12 @@ #ifndef SMFGALLERYPLUGIN_H_ #define SMFGALLERYPLUGIN_H_ -#include +#include #include #include /** + * @ingroup smf_plugin_group * Interface specification for plugins that implement gallery related services * like getting pictures, their description, uploading, posting comments * on pictures etc @@ -51,7 +52,7 @@ @endmsc * */ -class SmfGalleryPlugin : public QObject +class SmfGalleryPlugin : public SmfPluginBase { Q_OBJECT public: @@ -67,12 +68,6 @@ ~SmfGalleryPlugin( ); /** - * Method to get the provider information - * @return Instance of SmfProviderBase - */ - virtual SmfProviderBase* getProviderInfo( ) = 0; - - /** * Method to get a list of pictures * @param aRequest [out] The request data to be sent to network * @param aPageNum The page to be extracted @@ -80,69 +75,46 @@ * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ virtual SmfPluginError pictures( SmfPluginRequestData *aRequest, - const int aPageNum = 0, - const int aItemsPerPage = 10) = 0; + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0; /** * Method to get a description + * @param aRequest [out] The request data to be sent to network * @param aImage The image abot which the description is required - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError description( const SmfPicture &aImage, - SmfPluginRequestData *aRequest ) = 0; + virtual SmfPluginError description( SmfPluginRequestData *aRequest, + const SmfPicture &aImage ) = 0; /** * Method to upload a picture + * @param aRequest [out] The request data to be sent to network * @param aImage The image to be uploaded - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError upload( const SmfPicture &aImage, - SmfPluginRequestData *aRequest ) = 0; + virtual SmfPluginError upload( SmfPluginRequestData *aRequest, + const SmfPicture &aImage ) = 0; /** * Method to upload a list of pictures + * @param aRequest [out] The request data to be sent to network * @param aImages The list of images to be uploaded - * @param aRequest [out] The request data to be sent to network * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError upload( const QList &aImages, - SmfPluginRequestData *aRequest ) = 0; - - /** - * Method to post comment on a picture - * is available - * @param aImage The image on which comment is to be posted - * @param aComment The comment to be posted - * @param aRequest [out] The request data to be sent to network - * @return SmfPluginError Plugin error if any, else SmfPluginErrNone - */ - virtual SmfPluginError postComment( const SmfPicture &aImage, - const SmfComment &aComment, - SmfPluginRequestData *aRequest ) = 0; + virtual SmfPluginError upload( SmfPluginRequestData *aRequest, + const QList &aImages ) = 0; /** - * Method to get the result for a network request. - * @param aTransportResult The result of transport operation - * @param aReply The QNetworkReply instance for the request - * @param aResult [out] An output parameter to the plugin manager.If the - * return value is SmfSendRequestAgain, QVariant will be of type - * SmfPluginRequestData. - * If last operation was pictures(), aResult will be of type QList - * If last operation was description(), aResult will be of type QString - * If last operation was upload() or postComment(), aResult will be of - * type bool - * @param aRetType [out] SmfPluginRetType - * @param aIsLastPage [out] true if this the last page, else false - * @return SmfPluginError + * Method to post comment on a picture is available + * @param aRequest [out] The request data to be sent to network + * @param aImage The image on which comment is to be posted + * @param aComment The comment to be posted + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ - virtual SmfPluginError responseAvailable( - const SmfTransportResult aTransportResult, - QNetworkReply *aReply, - QVariant* aResult, - SmfPluginRetType aRetType, - bool aIsLastPage) = 0; + virtual SmfPluginError postComment( SmfPluginRequestData *aRequest, + const SmfPicture &aImage, + const SmfComment &aComment ) = 0; }; diff -r 4b1e636e8a71 -r 86af6c333601 example/clientapi/smf/inc/smfplugins/smfprovider/smfproviderbase.h --- a/example/clientapi/smf/inc/smfplugins/smfprovider/smfproviderbase.h Thu Mar 25 14:44:08 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,286 +0,0 @@ -/** - * @file smfproviderbase.h - * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution - * @version 1.0 - * - * @section LICENSE - * - * 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}". - * - * @section DESCRIPTION - * - * The Provider Base class is the class that has to be contained as a member - * in all Plug-in Interfaces. - */ - -#ifndef SMFPROVIDERBASE_H_ -#define SMFPROVIDERBASE_H_ - -#include -#include -#include -#include - - -/** - * The enumeration used to track the plugin methods return type - */ -enum SmfPluginRetType - { - SmfSendRequestAgain = 0, - SmfRequestComplete - }; - -/** - * The enumeration used to indicate result of transport to the plugins - */ -enum SmfTransportResult - { - SmfNoError = 0, - SmfNetworkTimeOut, - SmfIAPChanged, - SmfUnknownError - }; - -/** - * The enumeration used to denote errors reported by plugin - * Smf can't continue without handling these errors - */ -enum SmfPluginError - { - SmfPluginErrNone = 0, - SmfPluginErrTooManyRequest, - SmfPluginErrRequestQuotaExceeded, - SmfPluginErrInvalidRequest, - SmfPluginErrUserNotLoggedIn, - SmfPluginErrAuthenticationExpired, - SmfPluginErrPermissionDenied, - SmfPluginErrInvalidApplication, - SmfPluginErrServiceUnavailable, - SmfPluginErrServiceTemporaryUnavailable, - SmfPluginErrFormatNotSupported, - SmfPluginErrDataSizeExceeded - }; - - -/** - * The enumeration used to indicate the type of network operation done - */ -enum SmfRequestOperation - { - SmfContactGetFriends = 0, - SmfContactGetFollowers, - SmfContactSearch, - SmfContactGerGroups, - SmfContactSearchInGroup, - SmfContactGetPosts, - SmfContactUpdatePost, - SmfContactUpdatePostDirected, - SmfContactPostAppearence, - SmfMusicGetLyrics, - SmfMusicGetSubtitle, - SmfMusicGetEventsOnLoc, - SmfMusicGetVenueOnLoc, - SmfMusicGetEventsOnVenue, - SmfMusicPostEvents, - SmfMusicGetRecommendations, - SmfMusicGetTracks, - SmfMusicGetTrackInfo, - SmfMusicGetStores, - SmfMusicPostCurrentPlaying, - SmfMusicGetUserInfo, - SmfMusicSearchUser, - SmfMusicGetPlaylists, - SmfMusicGetPlaylistsOfUser, - SmfMusicAddToPlaylist, - SmfMusicPostCurrentPlayingPlaylist, - SmfPictureGetPictures, - SmfPictureDescription, - SmfPictureUpload, - SmfPictureMultiUpload, - SmfPicturePostComment - - }; - - -/** - * The structure used to track the data usage of each plugins - */ -struct SmfPluginDataUsage - { - /** - * Application that called the plugin - */ - QString iAppName; - - /** - * Interface implemented by the plugin - */ - QString iInterfaceName; - - /** - * The service provider - */ - QString iServiceProviderName; - - /** - * number of bytes sent for this plugin - */ - uint iBytesSent; - - /** - * number of bytes received for this plugin - */ - uint iBytesReceived; - - }; - - -/** - * The structure used to hold the request created by the plugins - */ -struct SmfPluginRequestData - { - /** - * Indicates the type of operation performed, like getting Friends - * list, upload image etc - */ - SmfRequestOperation iRequestType; - - /** - * The QNetworkRequest that has to be filled up by the plugins - */ - QNetworkRequest *iNetworkRequest; - - /** - * The data to be posted in case of HTTP POST operation - */ - QBuffer *iPostData; - - /** - * The type of HTTP transaction, like GET, POST etc - */ - QNetworkAccessManager::Operation iHttpOperationType; - - }; - -/** - * The Provider Base class is the class that has to be contained as a member - * in all Plug-in Interfaces. - * - * All of plug-ins should contain this class as a member and should also - * contain a public method to get instance of this class. - */ -class SmfProviderBase : public QObject - { - Q_OBJECT - -public: - /** - * Constructor with default argument - * @param aParent The parent object - */ - SmfProviderBase( QObject* aParent = 0 ); - - /** - * Destructor - */ - ~SmfProviderBase( ); - - /** - * Method to get the Localisable name of the service. - * @return The Localisable name of the service. - */ - QString serviceName( ); - - /** - * Method to get the Logo of the service - * @return The Logo of the service - */ - QImage serviceIcon( ); - - /** - * Method to get the Readable service description - * @return The Readable service description - */ - QString description( ); - - /** - * Method to get the Website of the service - * @return The Website of the service - */ - QUrl serviceUrl( ); - - /** - * Method to get the URL of the Application providing this service - * @return The URL of the Application providing this service - */ - QUrl applicationUrl( ); - - /** - * Method to get the Icon of the application - * @return The Icon of the application - */ - QImage applicationIcon( ); - - /** - * Method to get the Plugin specific ID - * @return The Plugin specific ID - */ - uint pluginId( ); - - /** - * Method to get the ID of the authentication application - * for this service - * @param aProgram The authentication application name - * @param aArguments List of arguments required for authentication app - * @param aMode Strting mode for authentication application - * @return The ID of the authentication application - */ - uint authenticationApp( QString &aProgram, QStringList & aArguments, - QIODevice::OpenModeFlag aMode = QIODevice::ReadWrite ); - - /** - * Method to get the unique registration ID provided by the - * Smf for authorised plugins - * @return The unique registration ID/token provided by the Smf for - * authorised plugins - */ - QString smfRegistrationId( ); - - /** - * Method to get the data usage of each plugin - * @param aUsage The data usage structure - */ - void getDataUsage( SmfPluginDataUsage &aUsage ); - - /** - * Method to get the reference count for loading. - * The reference count increased with each load request and decreased - * with each unload request - * @return The reference count value for loading of the plugins - */ - uint getLoadRefCount( ); - -private: - QString m_serviceName; // the Localisable name of the service - QImage m_serviceIcon; // the Logo of the service - QString m_description; // the Readable service description - QUrl m_serviceUrl; // the Website of the service - QUrl m_applicationUrl; // URL of the Application providing this service - QImage m_applicationIcon; //Icon of the application - uint m_pluginId; // The Plugin specific ID - uint m_authenticationAppId; // ID of the authentication application for this service - QString m_registrationId; // unique registration ID provided by the - // Smf for authorised plugins - SmfPluginDataUsage m_usage; //data usage of each plugin - uint m_loadRefCount; // reference count increased with each load request - // and decreased with each unload request - }; - -#endif /* SMFPROVIDERBASE_H_ */