diff -r b5d63d5fc252 -r a469c0e6e7fb smf/smfservermodule/smfclient/client/smfmusic.h --- a/smf/smfservermodule/smfclient/client/smfmusic.h Mon Jun 07 11:43:45 2010 +0100 +++ b/smf/smfservermodule/smfclient/client/smfmusic.h Wed Jun 23 19:51:49 2010 +0530 @@ -13,43 +13,43 @@ * Manasij Roy, Nalina Hariharan * * Description: - * The SmfEvent class represents an event + * Music related services * */ #ifndef SMFMUSIC_H -#define SMMUSIC_H - -#include +#define SMFMUSIC_H #include #include - #include "smfglobal.h" #include "smfprovider.h" #include "smfcontact.h" #include "smfevent.h" +#include "smfmusicfingerprint.h" +#include "smfmusicrating.h" +#include "smfcomment.h" +#include "smfsubtitle.h" -class SmfProvider; //basic Smf service Provider info -class SmfContact; // Smf contact -class SmfMusicRating;//rating value from 0..31 - services would map accordingly -class SmfMusicProfile; //user profile containing music usage and interest info, extends SmfContact -class SmfTrackInfo; //id, title, album, artist, genre, tag, director,release year, rating, comment info -class SmfMusicFingerPrint; //generation is not in scope of smf -class SmfVenue; -class SmfEvent; -class SmfPlaylist; -class SmfLyricsService; -class SmfLyrics; -class SmfSubtitle; -class SmfSubtitleSearchFilter; +#include "smfmusicprofile.h" +#include "smfalbum.h" +#include "smfartists.h" +#include "smfgroup.h" +#include "smflyrics.h" +#include "smfplaylist.h" +#include "smftrackinfo.h" +#include "smflocation.h" +class SmfMusicServicePrivate; +class SmfMusicSearchPrivate; +class SmfLyricsServicePrivate; +class SmfPlaylistServicePrivate; +class SmfMusicEventsPrivate; + +using namespace QtMobility; typedef QList SmfMusicProfileList; typedef QList SmfTrackInfoList; -typedef QList SmfEventsList; -typedef QList SmfProviderList; typedef QList SmfPlaylistList; -typedef QList SmfVenueList; typedef QList SmfLyricsList; typedef QList SmfSubtitleList; /** @@ -65,16 +65,16 @@ * Constructs SmfMusicService. * @param baseProvider The base provider info * Seeing as this is a plug-in implementation, these will realistically - * be generated by SMF factory of some kind + * be generated by SMF factory of some kind */ SmfMusicService(SmfProvider* baseProvider = 0); ~SmfMusicService(); -public: +public slots: /** * Gets self profile information asynchronously. - * userInfoAvailable() signal is emitted with SmfMusicProfile when the info is arrived + * userInfoAvailable() signal is emitted with SmfMusicProfile when the info is arrived */ void userinfo() ; @@ -84,9 +84,9 @@ * 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 perPage Item per page, default is SMF_ITEMS_PER_PAGE */ - void searchUser(SmfVenue venue,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; + void searchUser(SmfLocation venue,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; /** * Gets the base provider info @@ -97,13 +97,18 @@ signals: /** * Notification on arrival of the self profile as result of userinfo(). - * @param profile The self profile + * @param profile The self profile */ - void userInfoAvailable(SmfMusicProfile* profile, QString error); - - void searchInfoAvailable(SmfMusicProfileList& profileList, QString error,SmfResultPage resultPage); + void userInfoAvailable(SmfMusicProfile* profile, SmfError error); + /** + * Notification on arrival of search info + * @param profileList List of music profiles + */ + void searchInfoAvailable(SmfMusicProfileList& profileList, SmfError error,SmfResultPage resultPage); private: SmfProvider* m_baseProvider; + SmfMusicServicePrivate* m_private; + friend class SmfMusicServicePrivate; }; SMF_SERVICE_NAME(SmfMusicService, "org.symbian.smf.client.music.service\0.2") @@ -119,15 +124,13 @@ /** * Constructs SmfMusicSearch with base provider as arguement. * Seeing as this is a plug-in implementation, these will realistically - * be generated by SMF factory of some kind + * be generated by SMF factory of some kind */ SmfMusicSearch(SmfProvider* baseProvider = 0); ~SmfMusicSearch(); public: - // Get the track listing - might be made asynchrnous later - /** * Searches for music recommendations similar to a particulartrack asynchronously. * The signal trackSearchAvailable() is emitted with SmfTrackInfoList @@ -136,7 +139,7 @@ * 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 + * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE */ void recommendations(SmfTrackInfo track,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // basic list of track objects @@ -148,7 +151,7 @@ * 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 + * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE */ void tracks(SmfTrackInfo track,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // basic list of track objects @@ -158,7 +161,7 @@ * once its arrived. * @param signature The search criteria,signature to be searched for * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. - * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE + * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE */ void trackInfo(SmfMusicFingerPrint signature,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // search by fingerprint object @@ -167,7 +170,7 @@ * The signal storeSearchAvailable() is emitted with SmfProviderList once its arrived. * @param track The search criteria for stores * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. - * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE + * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE */ void stores(SmfTrackInfo track,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; @@ -184,83 +187,38 @@ /** * Posts currently playing track. * Success can be checked by checking the signal postFinished() - * @param track Track to post + * @param track Track to post */ void postCurrentPlaying(SmfTrackInfo track) ; - //int postRating(SmfTrackInfo track, SmfMusicRating rate) ; - //int postComments(SmfTrackInfo track, SmfComment comment) ; + void postRating(SmfTrackInfo track, SmfMusicRating rate) ; + void postComments(SmfTrackInfo track, SmfComment comment) ; signals: /** * Emitted when the search result for a track is available. * Note if number of tacks in the search is large, then it can download the list page by page. * In that case this signal is emitted multiple times. - * @param resultPage Page number info + * @param resultPage Page number info */ - void trackSearchAvailable(SmfTrackInfoList* result, QString error,SmfResultPage resultPage); + void trackSearchAvailable(SmfTrackInfoList* result, SmfError error,SmfResultPage resultPage); /** * Emitted when the search result for a store is available. * Note if number of tacks in the search is large, then it can download the list page by page. * In that case this signal is emitted multiple times. - * @param resultPage Page number info + * @param resultPage Page number info */ - void storeSearchAvailable(SmfProviderList* result, QString error, SmfResultPage resultPage); + void storeSearchAvailable(SmfProviderList* result, SmfError error, SmfResultPage resultPage); + void postfinished(SmfError error); private: SmfProvider* m_baseProvider; + SmfMusicSearchPrivate* m_private; + friend class SmfMusicSearchPrivate; }; SMF_SERVICE_NAME(SmfMusicSearch, "org.symbian.smf.client.music.search\0.2") /** - * Remote playlist - */ -class SMFCLIENT_EXPORT SmfPlaylist : public QObject - { - Q_OBJECT - -public: - SmfPlaylist(); - ~SmfPlaylist(); - - /** - * Gets tracks in the playlist - */ - SmfTrackInfoList* getTrackList(); - - /** - * Gets playlist title - */ - QString getPlayListTitle(); - - /** - * Gets the creation date - */ - QDateTime getCreationDate(); - - /** - * Sets tracks in the playlist - */ - void setTrackList(SmfTrackInfoList* trackList); - - /** - * Sets playlist title - */ - void setPlayListTitle(QString title); - - /** - * Sets creation date - */ - void setCreationDate(QDateTime time); - -private: - SmfTrackInfoList* m_trackList; - QString m_title; - QDateTime m_creationDate; - }; - - -/** * provides service ("org.symbian.smf.client.music.playlist") * * Interface to a remote playlist service. This class @@ -283,7 +241,7 @@ /** * Constructs SmfPlaylistService with base provider info * Seeing as this is a plug-in implementation, these will realistically - * be generated by SMF factory of some kind + * be generated by SMF factory of some kind */ SmfPlaylistService(SmfProvider* baseProvider = 0); ~SmfPlaylistService(); @@ -297,7 +255,7 @@ * 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 perPage Item per page, default is SMF_ITEMS_PER_PAGE */ void playlists(int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // basic list of playlist objects @@ -327,7 +285,7 @@ * Upload currently playing track to a playlist. Signal * playlistUpdated() can be checked for success value * @param plst The playlist to be added in - * @param tracks The list of tracks to uploaded + * @param tracks The list of tracks to uploaded */ int addToPlaylist(SmfPlaylist plst, SmfTrackInfoList* tracks) ; @@ -344,15 +302,17 @@ * Notification of availability of list of playlists requested. * Note if number of list is large, then it can download the list page by page. * In that case this signal is emitted multiple times. - * @param resultPage Page number info + * @param resultPage Page number info */ - void playlistsListAvailable(SmfPlaylistList*, QString error, SmfResultPage resultPage); + void playlistsListAvailable(SmfPlaylistList*, SmfError error, SmfResultPage resultPage); /** - * Signals remote updation of playlist with success value + * Signals remote updation of playlist with success value */ - int playlistUpdated(bool success) ; + void playlistUpdated(SmfError success) ; private: SmfProvider* m_baseProvider; + SmfPlaylistServicePrivate* m_private; + friend class SmfPlaylistServicePrivate; }; SMF_SERVICE_NAME(SmfPlaylistService, "org.symbian.smf.client.music.playlist\0.2") @@ -368,7 +328,7 @@ /** * Constructs SmfMusicEvents with base provider info * Seeing as this is a plug-in implementation, these will realistically - * be generated by SMF factory of some kind + * be generated by SMF factory of some kind */ SmfMusicEvents(SmfProvider* baseProvider = 0); ~SmfMusicEvents(); @@ -381,19 +341,19 @@ * 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 perPage Item per page, default is SMF_ITEMS_PER_PAGE */ - void events(QtMobility::QContactGeolocation location,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; + void events(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 SmfLocationList 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 + * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE */ - void venues(QtMobility::QContactGeolocation location,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // basic list of venue objects + void venues(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. @@ -403,7 +363,7 @@ * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE */ - void events(SmfVenue venue,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; // basic list of events objects + void events(SmfLocation 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) @@ -419,34 +379,36 @@ /** * Updates events. Might not be supported by all service provider. * eventsUpdated() signal can be checked for success value. - * @param SmfEventsList List of events to be posted + * @param SmfEventsList List of events to be posted */ - void postEvents(SmfEventsList events); + void postEvents(SmfEventList events); signals: /** - * Notification of the success of request to post an event + * Notification of the success of request to post an event */ - void eventsUpdated(bool success); + void eventsUpdated(SmfError success); /** * Notification on arrival of event lists * Note if number of list is large, then it can download the list page by page. * In that case this signal is emitted multiple times. - * @param resultPage Page number info + * @param resultPage Page number info */ - void eventsAvailable(SmfEventsList* list, QString error, SmfResultPage resultPage); + void eventsAvailable(SmfEventList* list, SmfError error, SmfResultPage resultPage); /** * Notification on arrival of venues lists * Note if number of list is large, then it can download the list page by page. * In that case this signal is emitted multiple times. - * @param resultPage Page number info + * @param resultPage Page number info */ - void venuesAvailable(SmfVenueList* list, QString error, SmfResultPage resultPage); + void venuesAvailable(SmfLocationList* list, SmfError error, SmfResultPage resultPage); private: SmfProvider* m_baseProvider; + SmfMusicEventsPrivate* m_private; + friend class SmfMusicEventsPrivate; }; SMF_SERVICE_NAME(SmfMusicEvents, "org.symbian.smf.client.music.events\0.2") @@ -462,7 +424,7 @@ /** * Constructs SmfLyricsService with base provider info. * Seeing as this is a plug-in implementation, these will realistically - * be generated by SMF factory of some kind + * be generated by SMF factory of some kind */ SmfLyricsService(SmfProvider* baseProvider = 0); @@ -475,7 +437,7 @@ * lyricsAvailable() notification comes SmfLyricsList with when the data is available * @param track Track for which lyrics needs to be fetched. * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. - * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE + * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE */ void lyrics(SmfTrackInfo track,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ; @@ -495,30 +457,27 @@ * Gets the base provider info */ SmfProvider* getProvider() ; - - -public slots: - - signals: /** * Notification on arrival of lyrics * Note if the list is large, then it can download the list page by page. * In that case this signal is emitted multiple times. - * @param resultPage Page number info + * @param resultPage Page number info */ - void lyricsAvailable(SmfLyricsList* list, QString error, SmfResultPage resultPage); + void lyricsAvailable(SmfLyricsList* list, SmfError error, SmfResultPage resultPage); /** * Notification on arrival of subtitle based on filter. * Note if the list is large, then it can download the list page by page. * In that case this signal is emitted multiple times. - * @param resultPage Page number info + * @param resultPage Page number info */ - void subtitleAvailable(SmfSubtitleList* list, QString error, SmfResultPage resultPage); + void subtitleAvailable(SmfSubtitleList* list, SmfError error, SmfResultPage resultPage); private: SmfProvider* m_baseProvider; + SmfLyricsServicePrivate* m_private; + friend class SmfLyricsServicePrivate; }; SMF_SERVICE_NAME(SmfLyricsService, "org.symbian.smf.client.music.lyrics\0.2")