smf/smfservermodule/smfclient/client/smfmusic.h
changeset 14 a469c0e6e7fb
parent 8 4102c67b6e56
equal deleted inserted replaced
13:b5d63d5fc252 14:a469c0e6e7fb
    11  *
    11  *
    12  * Contributors:
    12  * Contributors:
    13  * Manasij Roy, Nalina Hariharan
    13  * Manasij Roy, Nalina Hariharan
    14  *
    14  *
    15  * Description:
    15  * Description:
    16  * The SmfEvent class represents an event
    16  * Music related services
    17  *
    17  *
    18  */
    18  */
    19 
    19 
    20 #ifndef SMFMUSIC_H
    20 #ifndef SMFMUSIC_H
    21 #define SMMUSIC_H
    21 #define SMFMUSIC_H
    22 
       
    23 #include <QObject>
       
    24 
    22 
    25 #include <qmobilityglobal.h>
    23 #include <qmobilityglobal.h>
    26 #include <qgeopositioninfo.h>
    24 #include <qgeopositioninfo.h>
    27 
       
    28 #include "smfglobal.h"
    25 #include "smfglobal.h"
    29 #include "smfprovider.h"
    26 #include "smfprovider.h"
    30 #include "smfcontact.h"
    27 #include "smfcontact.h"
    31 #include "smfevent.h"
    28 #include "smfevent.h"
    32 
    29 #include "smfmusicfingerprint.h"
    33 class SmfProvider; //basic Smf service Provider info
    30 #include "smfmusicrating.h"
    34 class SmfContact; // Smf contact
    31 #include "smfcomment.h"
    35 class SmfMusicRating;//rating value from 0..31 - services would map accordingly
    32 #include "smfsubtitle.h"
    36 class SmfMusicProfile; //user profile containing music usage and interest info, extends SmfContact
    33 
    37 class SmfTrackInfo; //id, title, album, artist, genre, tag, director,release year, rating, comment info
    34 #include "smfmusicprofile.h"
    38 class SmfMusicFingerPrint; //generation is not in scope of smf
    35 #include "smfalbum.h"
    39 class SmfVenue;
    36 #include "smfartists.h"
    40 class SmfEvent;
    37 #include "smfgroup.h"
    41 class SmfPlaylist;
    38 #include "smflyrics.h"
    42 class SmfLyricsService;
    39 #include "smfplaylist.h"
    43 class SmfLyrics;
    40 #include "smftrackinfo.h"
    44 class SmfSubtitle;
    41 #include "smflocation.h"
    45 class SmfSubtitleSearchFilter;
    42 class SmfMusicServicePrivate;
       
    43 class SmfMusicSearchPrivate;
       
    44 class SmfLyricsServicePrivate;
       
    45 class SmfPlaylistServicePrivate;
       
    46 class SmfMusicEventsPrivate;
       
    47 
       
    48 using namespace QtMobility;
    46 
    49 
    47 typedef QList<SmfMusicProfile> SmfMusicProfileList;
    50 typedef QList<SmfMusicProfile> SmfMusicProfileList;
    48 typedef QList<SmfTrackInfo> SmfTrackInfoList;
    51 typedef QList<SmfTrackInfo> SmfTrackInfoList;
    49 typedef QList<SmfEvent> SmfEventsList;
       
    50 typedef QList<SmfProvider> SmfProviderList;
       
    51 typedef QList<SmfPlaylist> SmfPlaylistList;
    52 typedef QList<SmfPlaylist> SmfPlaylistList;
    52 typedef QList<SmfVenue> SmfVenueList;
       
    53 typedef QList<SmfLyrics> SmfLyricsList;
    53 typedef QList<SmfLyrics> SmfLyricsList;
    54 typedef QList<SmfSubtitle> SmfSubtitleList;
    54 typedef QList<SmfSubtitle> SmfSubtitleList;
    55 /**
    55 /**
    56  * @ingroup smf_client_group
    56  * @ingroup smf_client_group
    57   * Basic music service ("org.symbian.smf.client.music.service")
    57   * Basic music service ("org.symbian.smf.client.music.service")
    68    *  be generated by SMF factory of some kind
    68    *  be generated by SMF factory of some kind
    69    */
    69    */
    70    SmfMusicService(SmfProvider* baseProvider = 0);
    70    SmfMusicService(SmfProvider* baseProvider = 0);
    71   ~SmfMusicService();
    71   ~SmfMusicService();
    72 
    72 
    73 public:
    73 public slots:
    74 
    74 
    75   /**
    75   /**
    76    * Gets self profile information asynchronously.
    76    * Gets self profile information asynchronously.
    77    * userInfoAvailable() signal is emitted with SmfMusicProfile when the info is arrived
    77    * userInfoAvailable() signal is emitted with SmfMusicProfile when the info is arrived
    78    */
    78    */
    84    * When the list is big user can specify the page number and per page item data.
    84    * When the list is big user can specify the page number and per page item data.
    85    * If not supplied by the user default values are used.
    85    * If not supplied by the user default values are used.
    86    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
    86    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
    87    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
    87    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
    88    */
    88    */
    89   void searchUser(SmfVenue venue,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ;
    89   void searchUser(SmfLocation venue,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE) ;
    90 
    90 
    91   /**
    91   /**
    92    * Gets the base provider info
    92    * Gets the base provider info
    93    */
    93    */
    94   SmfProvider* getProvider() ;
    94   SmfProvider* getProvider() ;
    97 signals:
    97 signals:
    98 	/**
    98 	/**
    99 	 * Notification on arrival of the self profile as result of userinfo().
    99 	 * Notification on arrival of the self profile as result of userinfo().
   100 	 * @param profile The self profile
   100 	 * @param profile The self profile
   101 	 */
   101 	 */
   102 	void userInfoAvailable(SmfMusicProfile* profile, QString error);
   102 	void userInfoAvailable(SmfMusicProfile* profile, SmfError error);
   103 
   103 	/**
   104 	void searchInfoAvailable(SmfMusicProfileList& profileList, QString error,SmfResultPage resultPage);
   104 	 * Notification on arrival of search info
       
   105 	 * @param profileList List of music profiles
       
   106 	 */
       
   107 	void searchInfoAvailable(SmfMusicProfileList& profileList, SmfError error,SmfResultPage resultPage);
   105 private:
   108 private:
   106   SmfProvider* m_baseProvider;
   109   SmfProvider* m_baseProvider;
       
   110   SmfMusicServicePrivate* m_private;
       
   111   friend class SmfMusicServicePrivate;
   107 };
   112 };
   108 SMF_SERVICE_NAME(SmfMusicService, "org.symbian.smf.client.music.service\0.2")
   113 SMF_SERVICE_NAME(SmfMusicService, "org.symbian.smf.client.music.service\0.2")
   109 
   114 
   110 
   115 
   111 /**
   116 /**
   124 
   129 
   125   SmfMusicSearch(SmfProvider* baseProvider = 0);
   130   SmfMusicSearch(SmfProvider* baseProvider = 0);
   126   ~SmfMusicSearch();
   131   ~SmfMusicSearch();
   127 
   132 
   128 public:
   133 public:
   129   // Get the track listing - might be made asynchrnous later
       
   130 
       
   131   /**
   134   /**
   132    * Searches for music recommendations similar to a particulartrack asynchronously.
   135    * Searches for music recommendations similar to a particulartrack asynchronously.
   133    * The signal trackSearchAvailable() is emitted with SmfTrackInfoList
   136    * The signal trackSearchAvailable() is emitted with SmfTrackInfoList
   134    * once its arrived.
   137    * once its arrived.
   135    * When the list is big user can specify the page number and per page item data.
   138    * When the list is big user can specify the page number and per page item data.
   185 	 * Posts currently playing track.
   188 	 * Posts currently playing track.
   186 	 * Success can be checked by checking the signal postFinished()
   189 	 * Success can be checked by checking the signal postFinished()
   187 	 * @param track Track to post
   190 	 * @param track Track to post
   188 	 */
   191 	 */
   189   void postCurrentPlaying(SmfTrackInfo track)  ;
   192   void postCurrentPlaying(SmfTrackInfo track)  ;
   190   //int postRating(SmfTrackInfo track, SmfMusicRating rate)  ;
   193   void postRating(SmfTrackInfo track, SmfMusicRating rate)  ;
   191   //int postComments(SmfTrackInfo track, SmfComment comment)  ;
   194   void postComments(SmfTrackInfo track, SmfComment comment)  ;
   192 
   195 
   193 signals:
   196 signals:
   194 	/**
   197 	/**
   195 	 * Emitted when the search result for a track is available.
   198 	 * Emitted when the search result for a track is available.
   196 	 * Note if number of tacks in the search is large, then it can download the list page by page.
   199 	 * Note if number of tacks in the search is large, then it can download the list page by page.
   197 	 * In that case this signal is emitted multiple times.
   200 	 * In that case this signal is emitted multiple times.
   198 	 * @param resultPage Page number info
   201 	 * @param resultPage Page number info
   199 	 */
   202 	 */
   200 	void trackSearchAvailable(SmfTrackInfoList* result, QString error,SmfResultPage resultPage);
   203 	void trackSearchAvailable(SmfTrackInfoList* result, SmfError error,SmfResultPage resultPage);
   201 
   204 
   202 	/**
   205 	/**
   203 	 *  Emitted when the search result for a store is available.
   206 	 *  Emitted when the search result for a store is available.
   204 	 *  Note if number of tacks in the search is large, then it can download the list page by page.
   207 	 *  Note if number of tacks in the search is large, then it can download the list page by page.
   205 	 *  In that case this signal is emitted multiple times.
   208 	 *  In that case this signal is emitted multiple times.
   206 	 *  @param resultPage Page number info
   209 	 *  @param resultPage Page number info
   207 	 */
   210 	 */
   208 	void storeSearchAvailable(SmfProviderList* result, QString error, SmfResultPage resultPage);
   211 	void storeSearchAvailable(SmfProviderList* result, SmfError error, SmfResultPage resultPage);
       
   212 	void postfinished(SmfError error);
   209 private:
   213 private:
   210   SmfProvider* m_baseProvider;
   214   SmfProvider* m_baseProvider;
       
   215   SmfMusicSearchPrivate* m_private;
       
   216   friend class SmfMusicSearchPrivate;
   211 };
   217 };
   212 SMF_SERVICE_NAME(SmfMusicSearch, "org.symbian.smf.client.music.search\0.2")
   218 SMF_SERVICE_NAME(SmfMusicSearch, "org.symbian.smf.client.music.search\0.2")
   213 
       
   214 
       
   215 /**
       
   216  * Remote playlist
       
   217  */
       
   218 class SMFCLIENT_EXPORT SmfPlaylist : public QObject
       
   219 	{
       
   220 	Q_OBJECT
       
   221 
       
   222 public:
       
   223 	SmfPlaylist();
       
   224 	~SmfPlaylist();
       
   225 
       
   226 	/**
       
   227 	 * Gets tracks in the playlist
       
   228 	 */
       
   229 	SmfTrackInfoList* getTrackList();
       
   230 
       
   231 	/**
       
   232 	 * Gets playlist title
       
   233 	 */
       
   234 	QString getPlayListTitle();
       
   235 
       
   236 	/**
       
   237 	 * Gets the creation date
       
   238 	 */
       
   239 	QDateTime getCreationDate();
       
   240 
       
   241 	/**
       
   242 	 * Sets tracks in the playlist
       
   243 	 */
       
   244 	void setTrackList(SmfTrackInfoList* trackList);
       
   245 
       
   246 	/**
       
   247 	 * Sets playlist title
       
   248 	 */
       
   249 	void setPlayListTitle(QString title);
       
   250 
       
   251 	/**
       
   252 	 * Sets creation date
       
   253 	 */
       
   254 	void setCreationDate(QDateTime time);
       
   255 
       
   256 private:
       
   257 	SmfTrackInfoList* m_trackList;
       
   258 	QString m_title;
       
   259 	QDateTime m_creationDate;
       
   260 	};
       
   261 
   219 
   262 
   220 
   263 /**
   221 /**
   264  * provides service ("org.symbian.smf.client.music.playlist")
   222  * provides service ("org.symbian.smf.client.music.playlist")
   265  *
   223  *
   344 	 * Notification of availability of list of playlists requested.
   302 	 * Notification of availability of list of playlists requested.
   345 	 * Note if number of list is large, then it can download the list page by page.
   303 	 * Note if number of list is large, then it can download the list page by page.
   346 	 * In that case this signal is emitted multiple times.
   304 	 * In that case this signal is emitted multiple times.
   347 	 * @param resultPage Page number info
   305 	 * @param resultPage Page number info
   348 	 */
   306 	 */
   349 	void playlistsListAvailable(SmfPlaylistList*, QString error, SmfResultPage resultPage);
   307 	void playlistsListAvailable(SmfPlaylistList*, SmfError error, SmfResultPage resultPage);
   350 	/**
   308 	/**
   351 	 * Signals remote updation of playlist with success value
   309 	 * Signals remote updation of playlist with success value
   352 	 */
   310 	 */
   353     int playlistUpdated(bool success) ;
   311     void playlistUpdated(SmfError success) ;
   354 private:
   312 private:
   355   SmfProvider* m_baseProvider;
   313   SmfProvider* m_baseProvider;
       
   314   SmfPlaylistServicePrivate* m_private;
       
   315   friend class SmfPlaylistServicePrivate;
   356 };
   316 };
   357 SMF_SERVICE_NAME(SmfPlaylistService, "org.symbian.smf.client.music.playlist\0.2")
   317 SMF_SERVICE_NAME(SmfPlaylistService, "org.symbian.smf.client.music.playlist\0.2")
   358 
   318 
   359 
   319 
   360 /**
   320 /**
   381    * When the list is big user can specify the page number and per page item data.
   341    * When the list is big user can specify the page number and per page item data.
   382    * If not supplied by the user default values are used.
   342    * If not supplied by the user default values are used.
   383    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   343    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   384    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   344    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   385    */
   345    */
   386   void events(QtMobility::QContactGeolocation location,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE)  ;
   346   void events(QContactGeoLocation location,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE)  ;
   387 
   347 
   388   /**
   348   /**
   389    * Gets list of venues of a particular location asynchronously.
   349    * Gets list of venues of a particular location asynchronously.
   390    * venuesAvailable() signal is emitted with SmfVenueList once its arrived.
   350    * venuesAvailable() signal is emitted with SmfLocationList once its arrived.
   391    * When the list is big user can specify the page number and per page item data.
   351    * When the list is big user can specify the page number and per page item data.
   392    * If not supplied by the user default values are used.
   352    * If not supplied by the user default values are used.
   393    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   353    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   394    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   354    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   395    */
   355    */
   396   void venues(QtMobility::QContactGeolocation location,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE)  ; // basic list of venue objects
   356   void venues(QContactGeoLocation location,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE)  ; // basic list of venue objects
   397 
   357 
   398   /**
   358   /**
   399    * Gets list of events in a particular venue asynchronously.
   359    * Gets list of events in a particular venue asynchronously.
   400    * eventsAvailable() signal is emitted with SmfEventsList once its arrived.
   360    * eventsAvailable() signal is emitted with SmfEventsList once its arrived.
   401    * When the list is big user can specify the page number and per page item data.
   361    * When the list is big user can specify the page number and per page item data.
   402    * If not supplied by the user default values are used.
   362    * If not supplied by the user default values are used.
   403    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   363    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
   404    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   364    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
   405    */
   365    */
   406   void events(SmfVenue venue,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE)  ; // basic list of events objects
   366   void events(SmfLocation venue,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE)  ; // basic list of events objects
   407 
   367 
   408 
   368 
   409   //APIs to get/set base provider info (SmfProvider)
   369   //APIs to get/set base provider info (SmfProvider)
   410 
   370 
   411   /**
   371   /**
   419 	/**
   379 	/**
   420 	 * Updates events. Might not be supported by all service provider.
   380 	 * Updates events. Might not be supported by all service provider.
   421 	 * eventsUpdated() signal can be checked for success value.
   381 	 * eventsUpdated() signal can be checked for success value.
   422 	 * @param SmfEventsList List of events to be posted
   382 	 * @param SmfEventsList List of events to be posted
   423 	 */
   383 	 */
   424 	 void postEvents(SmfEventsList events);
   384 	 void postEvents(SmfEventList events);
   425 
   385 
   426 signals:
   386 signals:
   427 
   387 
   428 	/**
   388 	/**
   429 	 * Notification of the success of request to post an event
   389 	 * Notification of the success of request to post an event
   430 	 */
   390 	 */
   431 	void eventsUpdated(bool success);
   391 	void eventsUpdated(SmfError success);
   432 
   392 
   433 	/**
   393 	/**
   434 	 * Notification on arrival of event lists
   394 	 * Notification on arrival of event lists
   435 	 * Note if number of list is large, then it can download the list page by page.
   395 	 * Note if number of list is large, then it can download the list page by page.
   436 	 * In that case this signal is emitted multiple times.
   396 	 * In that case this signal is emitted multiple times.
   437 	 * @param resultPage Page number info
   397 	 * @param resultPage Page number info
   438 	 */
   398 	 */
   439 	void eventsAvailable(SmfEventsList* list, QString error, SmfResultPage resultPage);
   399 	void eventsAvailable(SmfEventList* list, SmfError error, SmfResultPage resultPage);
   440 
   400 
   441 	/**
   401 	/**
   442 	 *  Notification on arrival of venues lists
   402 	 *  Notification on arrival of venues lists
   443 	 * Note if number of list is large, then it can download the list page by page.
   403 	 * Note if number of list is large, then it can download the list page by page.
   444 	 * In that case this signal is emitted multiple times.
   404 	 * In that case this signal is emitted multiple times.
   445 	 * @param resultPage Page number info
   405 	 * @param resultPage Page number info
   446 	 */
   406 	 */
   447 	void venuesAvailable(SmfVenueList* list, QString error, SmfResultPage resultPage);
   407 	void venuesAvailable(SmfLocationList* list, SmfError error, SmfResultPage resultPage);
   448 private:
   408 private:
   449   SmfProvider* m_baseProvider;
   409   SmfProvider* m_baseProvider;
       
   410   SmfMusicEventsPrivate* m_private;
       
   411   friend class SmfMusicEventsPrivate;
   450 };
   412 };
   451 SMF_SERVICE_NAME(SmfMusicEvents, "org.symbian.smf.client.music.events\0.2")
   413 SMF_SERVICE_NAME(SmfMusicEvents, "org.symbian.smf.client.music.events\0.2")
   452 
   414 
   453 
   415 
   454 /**
   416 /**
   493 
   455 
   494   /**
   456   /**
   495    * Gets the base provider info
   457    * Gets the base provider info
   496    */
   458    */
   497   SmfProvider* getProvider()  ;
   459   SmfProvider* getProvider()  ;
   498 
       
   499 
       
   500 public slots:
       
   501 
       
   502 
       
   503 signals:
   460 signals:
   504 
   461 
   505 	/**
   462 	/**
   506 	 * Notification on arrival of lyrics
   463 	 * Notification on arrival of lyrics
   507 	 * Note if the list is large, then it can download the list page by page.
   464 	 * Note if the list is large, then it can download the list page by page.
   508 	 * In that case this signal is emitted multiple times.
   465 	 * In that case this signal is emitted multiple times.
   509 	 * @param resultPage Page number info
   466 	 * @param resultPage Page number info
   510 	 */
   467 	 */
   511 	void lyricsAvailable(SmfLyricsList* list, QString error, SmfResultPage resultPage);
   468 	void lyricsAvailable(SmfLyricsList* list, SmfError error, SmfResultPage resultPage);
   512 
   469 
   513 	/**
   470 	/**
   514 	 * Notification on arrival of subtitle based on filter.
   471 	 * Notification on arrival of subtitle based on filter.
   515 	 * Note if the list is large, then it can download the list page by page.
   472 	 * Note if the list is large, then it can download the list page by page.
   516 	 * In that case this signal is emitted multiple times.
   473 	 * In that case this signal is emitted multiple times.
   517 	 * @param resultPage Page number info
   474 	 * @param resultPage Page number info
   518 	 */
   475 	 */
   519 	void subtitleAvailable(SmfSubtitleList* list, QString error, SmfResultPage resultPage);
   476 	void subtitleAvailable(SmfSubtitleList* list, SmfError error, SmfResultPage resultPage);
   520 private:
   477 private:
   521   SmfProvider* m_baseProvider;
   478   SmfProvider* m_baseProvider;
       
   479   SmfLyricsServicePrivate* m_private;
       
   480   friend class SmfLyricsServicePrivate;
   522 };
   481 };
   523 SMF_SERVICE_NAME(SmfLyricsService, "org.symbian.smf.client.music.lyrics\0.2")
   482 SMF_SERVICE_NAME(SmfLyricsService, "org.symbian.smf.client.music.lyrics\0.2")
   524 
   483 
   525 #endif // SMFMUSIC_H
   484 #endif // SMFMUSIC_H
   526 
   485