smf/smfservermodule/smfclient/client/smfmusic_p.h
changeset 14 a469c0e6e7fb
equal deleted inserted replaced
13:b5d63d5fc252 14:a469c0e6e7fb
       
     1 /**
       
     2  * Copyright (c) 2010 Sasken Communication Technologies Ltd.
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the "Eclipse Public License v1.0" 
       
     6  * which accompanies  this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html"
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
       
    11  *
       
    12  * Contributors:
       
    13  * Manasij Roy, Nalina Hariharan
       
    14  * 
       
    15  * Description:
       
    16  * 
       
    17  */
       
    18 
       
    19 #ifndef SMFMUSICPRIVATE_H_
       
    20 #define SMFMUSICPRIVATE_H_
       
    21 
       
    22 #include "smfmusic.h"
       
    23 #include "smfglobal.h"
       
    24 #include "smfobserver.h"
       
    25 #include "smfcomment.h"
       
    26 #ifdef Q_OS_SYMBIAN
       
    27 #include "smfclientsymbian.h"
       
    28 #else
       
    29 #include "smfclientqt.h"
       
    30 #endif
       
    31 class SmfMusicService;
       
    32 class SmfMusicSearch;
       
    33 class SmfPlaylistService;
       
    34 class SmfMusicEvents;
       
    35 class SmfLyricsService;
       
    36 
       
    37 class SmfMusicServicePrivate : public smfObserver
       
    38 	{
       
    39 	Q_OBJECT
       
    40 public:
       
    41 	/**
       
    42 	 * Constructor
       
    43 	 */
       
    44 	SmfMusicServicePrivate(SmfMusicService* aMusicService);
       
    45 	~SmfMusicServicePrivate();
       
    46 	/**
       
    47 	* Gets self profile information asynchronously.
       
    48 	* userInfoAvailable() signal is emitted with SmfMusicProfile when the info is arrived
       
    49 	*/
       
    50 	void userinfo() ;
       
    51 	
       
    52 	/**
       
    53 	* Asynchronously searches information about other service users for a particular venue
       
    54 	* searchInfoAvailable() signal is emitted with SmfMusicProfileList when the info is arrived.
       
    55 	* When the list is big user can specify the page number and per page item data.
       
    56 	* If not supplied by the user default values are used.
       
    57 	* @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
    58 	* @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
    59 	*/
       
    60 	void searchUser(SmfLocation venue,int pageNum,int perPage) ;
       
    61 	
       
    62 	/** from smfobserver */
       
    63    void resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error);
       
    64 private:
       
    65 	  SmfProvider* m_baseProvider;
       
    66 	  //serialized byte array of provider+other info to be sent to the server
       
    67 	  //The order:- SmfProvider then params in order of their appearance in fn
       
    68 	  QByteArray m_serializedDataToServer;
       
    69 	  //serialized xtra info, order of serialization follows order of param
       
    70 	  QByteArray m_xtraInfoSerialized;
       
    71 	#ifdef Q_OS_SYMBIAN
       
    72 	  CSmfClientSymbian* m_SmfClientPrivate;
       
    73 	  friend class CSmfClientSymbian;
       
    74 	  int m_xtraInfoFlag;
       
    75 	  int m_pageInfoFlag;
       
    76 	#else
       
    77 	  SmfClientQt* m_SmfClientPrivate;
       
    78 	  friend class SmfClientQt;
       
    79 	#endif
       
    80 	  bool m_connected;
       
    81 	  SmfMusicService* m_musicService;
       
    82 	  SmfMusicProfile* m_profile;
       
    83 	  SmfMusicProfileList m_profileList;
       
    84 	};
       
    85 //SmfMusicSearch
       
    86 class SmfMusicSearchPrivate : public smfObserver
       
    87 	{
       
    88 	Q_OBJECT
       
    89 public:
       
    90 	/**
       
    91 	 * Constructor
       
    92 	 */
       
    93 	SmfMusicSearchPrivate(SmfMusicSearch* aMusicSearch);
       
    94 	~SmfMusicSearchPrivate();
       
    95 public:
       
    96 	  /**
       
    97 	   * Searches for music recommendations similar to a particulartrack asynchronously.
       
    98 	   * The signal trackSearchAvailable() is emitted with SmfTrackInfoList
       
    99 	   * once its arrived.
       
   100 	   * When the list is big user can specify the page number and per page item data.
       
   101 	   * If not supplied by the user default values are used.
       
   102 	   * @param track The track for which similar recommendations need to be fetched.
       
   103 	   * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
   104 	   * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
   105 	   */
       
   106 	  void recommendations(SmfTrackInfo track,int pageNum,int perPage)  ; // basic list of track objects
       
   107 
       
   108 	  /**
       
   109 	   * Searches for tracks similar to a given track asynchronously.
       
   110 	   * The signal trackSearchAvailable() is emitted with SmfTrackInfoList
       
   111 	   * once its arrived.
       
   112 	   * When the list is big user can specify the page number and per page item data.
       
   113 	   * If not supplied by the user default values are used.
       
   114 	   * @param track The search criteria, similar tracks are searched
       
   115 	   * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
   116 	   * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
   117 	   */
       
   118 	  void tracks(SmfTrackInfo track,int pageNum,int perPage)  ; // basic list of track objects
       
   119 
       
   120 	  /**
       
   121 	   * Searches for a track having similar finger print asynchronously.
       
   122 	   * The signal trackSearchAvailable() is emitted with SmfTrackInfoList
       
   123 	   * once its arrived.
       
   124 	   * @param signature The search criteria,signature to be searched for
       
   125 	   * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
   126 	   * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
   127 	   */
       
   128 	  void trackInfo(SmfMusicFingerPrint signature,int pageNum,int perPage)  ; // search by fingerprint object
       
   129 
       
   130 	  /**
       
   131 	   * Search information about where to buy this song from asynchronously.
       
   132 	   * The signal storeSearchAvailable() is emitted with SmfProviderList once its arrived.
       
   133 	   * @param track The search criteria for stores
       
   134 	   * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
   135 	   * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
   136 	   */
       
   137 	  void stores(SmfTrackInfo track,int pageNum,int perPage)  ;
       
   138 		/**
       
   139 		 * Posts currently playing track.
       
   140 		 * Success can be checked by checking the signal postFinished()
       
   141 		 * @param track Track to post
       
   142 		 */
       
   143 	  void postCurrentPlaying(SmfTrackInfo track) ;
       
   144 	  void postRating(SmfTrackInfo track, SmfMusicRating rate) ;
       
   145 	  void postComments(SmfTrackInfo track, SmfComment comment) ;
       
   146 		/** from smfobserver */
       
   147 	   void resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error);
       
   148 private:
       
   149 	  SmfProvider* m_baseProvider;
       
   150 	  //serialized byte array of provider+other info to be sent to the server
       
   151 	  //The order:- SmfProvider then params in order of their appearance in fn
       
   152 	  QByteArray m_serializedDataToServer;
       
   153 	  //serialized xtra info, order of serialization follows order of param
       
   154 	  QByteArray m_xtraInfoSerialized;
       
   155 	#ifdef Q_OS_SYMBIAN
       
   156 	  CSmfClientSymbian* m_SmfClientPrivate;
       
   157 	  friend class CSmfClientSymbian;
       
   158 	  int m_xtraInfoFlag;
       
   159 	  int m_pageInfoFlag;
       
   160 	#else
       
   161 	  SmfClientQt* m_SmfClientPrivate;
       
   162 	  friend class SmfClientQt;
       
   163 	#endif
       
   164 	  bool m_connected;
       
   165 	  SmfMusicSearch* m_musicSearch;
       
   166 	  SmfMusicProfile* m_profile;
       
   167 	  SmfProviderList* m_providers;
       
   168 	  SmfTrackInfoList* m_trackInfoList;
       
   169 	  SmfMusicProfileList m_profileList;
       
   170 	};
       
   171 class SmfPlaylistServicePrivate : public smfObserver
       
   172 {
       
   173   Q_OBJECT
       
   174 
       
   175 public:
       
   176   /**
       
   177    * Constructs SmfPlaylistService with base provider info
       
   178    * Seeing as this is a plug-in implementation, these will realistically
       
   179    * be generated by SMF factory of some kind
       
   180    */
       
   181   SmfPlaylistServicePrivate(SmfPlaylistService* aPlayLstSrvc);
       
   182   ~SmfPlaylistServicePrivate();
       
   183 
       
   184 public:
       
   185 
       
   186   /**
       
   187    * Gets the list playlists for the logged-in user asynchronously.
       
   188    * The signal playlistsListAvailable() signal is emitted with
       
   189    * SmfPlaylistList once its arrived .
       
   190    * When the list is big user can specify the page number and per page item data.
       
   191    * If not supplied by the user default values are used.
       
   192    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
   193    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
   194    */
       
   195   void playlists(int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE)  ; // basic list of playlist objects
       
   196 
       
   197   /**
       
   198    * Gets the list playlists for the given user asynchronously.
       
   199    * The signal playlistsListAvailable() signal is emitted with
       
   200    * SmfPlaylistList once its arrived.
       
   201    * When the list is big user can specify the page number and per page item data.
       
   202    * If not supplied by the user default values are used.
       
   203    * @param user User for which to get the playlists
       
   204    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
   205    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
   206    */
       
   207   void playlistsOf(SmfMusicProfile* user,int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE)  ;
       
   208   /**
       
   209 	 * Upload currently playing track to a playlist. Signal
       
   210 	 * playlistUpdated() can be checked for success value
       
   211 	 * @param plst The playlist to be added in
       
   212 	 * @param tracks The list of tracks to uploaded
       
   213 	 */
       
   214   int addToPlaylist(SmfPlaylist plst, SmfTrackInfoList* tracks)  ;
       
   215 
       
   216 	/**
       
   217 	 * Upload currently playing playlist . Signal
       
   218 	 * playlistUpdated() can be checked for success value
       
   219 	 * @param plst The playlist to be uploaded
       
   220 	 */
       
   221   int postCurrentPlayingPlaylist(SmfPlaylist plst)  ;
       
   222   /** from smfobserver */
       
   223   void resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error);
       
   224 private:
       
   225 	SmfProvider* m_baseProvider;
       
   226 	//serialized byte array of provider+other info to be sent to the server
       
   227 	//The order:- SmfProvider then params in order of their appearance in fn
       
   228 	QByteArray m_serializedDataToServer;
       
   229 	//serialized xtra info, order of serialization follows order of param
       
   230 	QByteArray m_xtraInfoSerialized;
       
   231 	#ifdef Q_OS_SYMBIAN
       
   232 	CSmfClientSymbian* m_SmfClientPrivate;
       
   233 	friend class CSmfClientSymbian;
       
   234 	int m_xtraInfoFlag;
       
   235 	int m_pageInfoFlag;
       
   236 	#else
       
   237 	SmfClientQt* m_SmfClientPrivate;
       
   238 	friend class SmfClientQt;
       
   239 	#endif
       
   240 	bool m_connected;
       
   241 	SmfPlaylistService* m_playlstSrvc;
       
   242 	SmfPlaylistList* m_playlistList;
       
   243 };
       
   244 
       
   245 class SmfMusicEventsPrivate : public smfObserver
       
   246 {
       
   247   Q_OBJECT
       
   248 
       
   249 public:
       
   250   /**
       
   251    * Constructs SmfMusicEvents with base provider info
       
   252    * Seeing as this is a plug-in implementation, these will realistically
       
   253    *  be generated by SMF factory of some kind
       
   254    */
       
   255   SmfMusicEventsPrivate(SmfMusicEvents* aMusicEvent);
       
   256   ~SmfMusicEventsPrivate();
       
   257 
       
   258 public:
       
   259 
       
   260   /**
       
   261    * Gets list of events in a particular location asynchronously.
       
   262    * eventsAvailable() signal is emitted with SmfEventsList once its arrived.
       
   263    * When the list is big user can specify the page number and per page item data.
       
   264    * If not supplied by the user default values are used.
       
   265    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
   266    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
   267    */
       
   268   void events(QContactGeoLocation location,int pageNum,int perPage)  ;
       
   269 
       
   270   /**
       
   271    * Gets list of venues of a particular location asynchronously.
       
   272    * venuesAvailable() signal is emitted with SmfLocationList once its arrived.
       
   273    * When the list is big user can specify the page number and per page item data.
       
   274    * If not supplied by the user default values are used.
       
   275    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
   276    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
   277    */
       
   278   void venues(QContactGeoLocation location,int pageNum,int perPage)  ; // basic list of venue objects
       
   279 
       
   280   /**
       
   281    * Gets list of events in a particular venue asynchronously.
       
   282    * eventsAvailable() signal is emitted with SmfEventsList once its arrived.
       
   283    * When the list is big user can specify the page number and per page item data.
       
   284    * If not supplied by the user default values are used.
       
   285    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
   286    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
   287    */
       
   288   void events(SmfLocation venue,int pageNum,int perPage)  ; // basic list of events objects
       
   289 
       
   290 /**
       
   291 	 * Updates events. Might not be supported by all service provider.
       
   292 	 * eventsUpdated() signal can be checked for success value.
       
   293 	 * @param SmfEventsList List of events to be posted
       
   294 	 */
       
   295 	 void postEvents(SmfEventList events);
       
   296 	  /** from smfobserver */
       
   297 	  void resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error);
       
   298 	private:
       
   299 		SmfProvider* m_baseProvider;
       
   300 		//serialized byte array of provider+other info to be sent to the server
       
   301 		//The order:- SmfProvider then params in order of their appearance in fn
       
   302 		QByteArray m_serializedDataToServer;
       
   303 		//serialized xtra info, order of serialization follows order of param
       
   304 		QByteArray m_xtraInfoSerialized;
       
   305 		#ifdef Q_OS_SYMBIAN
       
   306 		CSmfClientSymbian* m_SmfClientPrivate;
       
   307 		friend class CSmfClientSymbian;
       
   308 		int m_xtraInfoFlag;
       
   309 		int m_pageInfoFlag;
       
   310 		#else
       
   311 		SmfClientQt* m_SmfClientPrivate;
       
   312 		friend class SmfClientQt;
       
   313 		#endif
       
   314 		bool m_connected;
       
   315 		SmfMusicEvents* m_musicEvent;
       
   316 		SmfEventList* m_events;
       
   317 		SmfLocationList* m_venues;
       
   318 };
       
   319 
       
   320 /**
       
   321 * provides service ("org.symbian.smf.client.music.lyrics")
       
   322 */
       
   323 class SmfLyricsServicePrivate : public smfObserver
       
   324 {
       
   325   Q_OBJECT
       
   326 
       
   327 public:
       
   328   /**
       
   329    * Constructs SmfLyricsService with base provider info.
       
   330    * Seeing as this is a plug-in implementation, these will realistically
       
   331    * be generated by SMF factory of some kind
       
   332    */
       
   333 
       
   334   SmfLyricsServicePrivate(SmfLyricsService* aLyricsSrvc);
       
   335   ~SmfLyricsServicePrivate();
       
   336 
       
   337 public:
       
   338 
       
   339   /**
       
   340    * Get the lyrics lists asynchrnously, it fetches texts without time info.
       
   341    * lyricsAvailable() notification comes SmfLyricsList with when the data is available
       
   342    * @param track Track for which lyrics needs to be fetched.
       
   343    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
   344    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
   345    */
       
   346   void lyrics(SmfTrackInfo track,int pageNum,int perPage)  ;
       
   347 
       
   348   /**
       
   349    * Get the lyrics lists asynchrnously, it fetches texts with time info.
       
   350    * Subtitle search filter can be applied
       
   351    * subtitleAvailable() notification comes SmfSubtitleList with when the data is available
       
   352    * @param track Track for which subtitle needs to be fetched.
       
   353    * @param filter Subtitle search filter
       
   354    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
   355    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
   356    */
       
   357   void subtitles(SmfTrackInfo track, SmfSubtitleSearchFilter filter,int pageNum,int perPage)  ; // texts with time information
       
   358   /** from smfobserver */
       
   359   void resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error);
       
   360 private:
       
   361 	SmfProvider* m_baseProvider;
       
   362 	//serialized byte array of provider+other info to be sent to the server
       
   363 	//The order:- SmfProvider then params in order of their appearance in fn
       
   364 	QByteArray m_serializedDataToServer;
       
   365 	//serialized xtra info, order of serialization follows order of param
       
   366 	QByteArray m_xtraInfoSerialized;
       
   367 	#ifdef Q_OS_SYMBIAN
       
   368 	CSmfClientSymbian* m_SmfClientPrivate;
       
   369 	friend class CSmfClientSymbian;
       
   370 	int m_xtraInfoFlag;
       
   371 	int m_pageInfoFlag;
       
   372 	#else
       
   373 	SmfClientQt* m_SmfClientPrivate;
       
   374 	friend class SmfClientQt;
       
   375 	#endif
       
   376 	bool m_connected;
       
   377 	SmfLyricsService* m_lyricsSrvc;
       
   378 	SmfLyricsList* m_lyricsList;
       
   379 	SmfSubtitleList* m_subList;
       
   380 };
       
   381 #endif