example/clientapi/smf/smfmusic.h
changeset 0 5d2360e70d9f
equal deleted inserted replaced
-1:000000000000 0:5d2360e70d9f
       
     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 "{License}"
       
     6 * which accompanies  this distribution, and is available
       
     7 * at the URL "{LicenseUrl}".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Interface spefication for music related services
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef SMFMUSIC_H
       
    20 #define SMFMUSIC_H
       
    21 
       
    22 class SmfProvider; //basic Smf service Provider info
       
    23 class SmfMusicRating;//rating value from 0..31 - services would map accordingly
       
    24 class SmfMusicProfile; //user profile containing music usage and interest info, extends SmfContact
       
    25 class SmfTracknfo; //id, title, album, artist, genre, tag, director,release year, rating, comment info
       
    26 class SmfMusicFingerPrint; //generation is not in scope of smf
       
    27 
       
    28 class SmfMusicModel;
       
    29 
       
    30 /**
       
    31   * basic music service ("org.symbian.smf.music.service")
       
    32   */
       
    33 class SmfMusicService : public SmfProvider
       
    34 {
       
    35   Q_OBJECT;
       
    36 
       
    37 public:
       
    38   // Seeing as this is a plug-in implementation, these will realistically
       
    39   // be generated by SMF factory of some kind
       
    40   SmfMusicService(QObject* parent = 0);
       
    41   ~SmfMusicService();
       
    42 
       
    43 public:
       
    44   virtual SmfMusicProfile userinfo() = 0; // get self profile information
       
    45   virtual QList<SmfMusicProfile> searchUser(SmfVenue venue) = 0; // search information about other service users
       
    46   virtual SmfMusicModel model() = 0; // maybe we can make a QItemModel-derived model?
       
    47 
       
    48 slots:
       
    49 
       
    50 
       
    51 signals:
       
    52 
       
    53 };
       
    54 
       
    55 /**
       
    56 * provides service ("org.symbian.smf.music.search")
       
    57 */
       
    58 class SmfMusicSearch : public SmfProvider
       
    59 {
       
    60   Q_OBJECT;
       
    61 
       
    62 public:
       
    63   // Seeing as this is a plug-in implementation, these will realistically
       
    64   // be generated by SMF factory of some kind
       
    65   SmfMusicSearch(QObject* parent = 0);
       
    66   ~SmfMusicSearch();
       
    67 
       
    68 public:
       
    69   // Get the track listing - might be made asynchrnous later
       
    70   virtual QList<SmfTrackInfo> recommendations(SmfTrackInfo track) = 0; // basic list of track objects
       
    71   virtual QList<SmfTrackInfo> tracks(SmfTrackInfo track) = 0; // basic list of track objects
       
    72   virtual QList<SmfTrackInfo> trackInfo(SmfMusicFingerPrint signature) = 0; // search by fingerprint object
       
    73   virtual QList<SmfProvider> stores(SmfTrackInfo track) = 0; // search information about where to buy this song from
       
    74 
       
    75 slots:
       
    76   virtual int postCurrentPlaying(SmfTrackInfo track) = 0;
       
    77   //virtual int postRating(SmfTrackInfo track, SmfMusicRating rate) = 0;
       
    78   //virtual int postComments(SmfTrackInfo track, SmfComment comment) = 0;
       
    79 
       
    80 signal:
       
    81 
       
    82 }
       
    83 
       
    84 class SmfPlaylist;//remote playlist
       
    85 /**
       
    86  * provides service ("org.symbian.smf.music.playlist")
       
    87  *
       
    88  * Interface to a remote playlist service. This class
       
    89  * provides some basic functionality to allow applications
       
    90  * to interact with playlists in some music related service provider (e.g. last.fm).
       
    91  *
       
    92  * Note that branding information for the particular service implementation
       
    93  * is available from base-class functions. See also:
       
    94  * SmfProvider::serviceName(), SmfProvider::serviceIcon()
       
    95  *
       
    96  * All of the functionality described here should be implemented by a service
       
    97  * specific plug-in object.
       
    98  *
       
    99  */
       
   100 class SmfPlaylistService : public SmfProvider
       
   101 {
       
   102   Q_OBJECT;
       
   103 
       
   104 public:
       
   105   // Seeing as this is a plug-in implementation, these will realistically
       
   106   // be generated by SMF factory of some kind
       
   107   SmfPlaylistService(QObject* parent = 0);
       
   108   ~SmfPlaylistService();
       
   109 
       
   110 public:
       
   111   // Get the playist listing - might be made asynchrnous later
       
   112   virtual QList<SmfPlaylist> playlists() = 0; // basic list of playlist objects for the logged-in user
       
   113   virtual QList<SmfPlaylist> playlistsOf(SmfMusicProfile user) = 0; // basic list of playlist objects for other user
       
   114 
       
   115 
       
   116 slots:
       
   117   // Upload currently playing song, etc - slots can connect to UI controls more easily
       
   118   virtual int addToPlaylist(SmfPlaylist plst, QList<SmfTrackInfo> tracks) = 0;
       
   119   virtual int postCurrentPlayingPlaylist(SmfPlaylist plst) = 0;
       
   120 
       
   121 
       
   122 signals:
       
   123  //signals remote updation of playlist
       
   124   virtual int playlistUpdated(void) = 0;
       
   125 };
       
   126 
       
   127 
       
   128 
       
   129 class SmfEvent;//musical events
       
   130 class SmfVenue;//popular venues
       
   131 /**
       
   132 * provides service ("org.symbian.smf.music.events")
       
   133 */
       
   134 class SmfMusicEvents : public SmfProvider
       
   135 {
       
   136   Q_OBJECT;
       
   137 
       
   138 public:
       
   139   // Seeing as this is a plug-in implementation, these will realistically
       
   140   // be generated by SMF factory of some kind
       
   141   SmfMusicEvents(QObject* parent = 0);
       
   142   ~SmfMusicEvents();
       
   143 
       
   144 public:
       
   145   virtual QList<SmfEvents> events(QContactGeolocation location) = 0; // basic list of events objects
       
   146   virtual QList<SmfVenue> venues(QContactGeolocation location) = 0; // basic list of venue objects
       
   147   virtual QList<SmfEvents> events(SmfVenue venue) = 0; // basic list of events objects
       
   148 
       
   149 slot:
       
   150  //update your event
       
   151  virtual void postEvents(QList<SmfEvents> events); //might not be supported by all service provider
       
   152 
       
   153 signal:
       
   154  virtual void eventsupdated(void);
       
   155 };
       
   156 
       
   157 
       
   158 
       
   159 
       
   160 class SmfSubtitleSearchFilter;//language, frame rate, duration, release year
       
   161 /**
       
   162 * provides service ("org.symbian.smf.music.lyrics")
       
   163 */
       
   164 class SmfLyricsService : public SmfProvider
       
   165 {
       
   166   Q_OBJECT;
       
   167 
       
   168 public:
       
   169   // Seeing as this is a plug-in implementation, these will realistically
       
   170   // be generated by SMF factory of some kind
       
   171   SmfLyricsService(QObject* parent = 0);
       
   172   ~SmfLyricsService();
       
   173 
       
   174 public:
       
   175   // Get the lyrics listing - might be made asynchrnous later
       
   176   virtual QList<SmfLyrics> lyrics(SmfTrackInfo track) = 0; //texts without time information
       
   177   virtual QList<SmfSubtitle> subtitles(SmfTrackInfo track, SmfSubtitleSearchFilter filter) = 0; // texts with time information
       
   178 
       
   179 
       
   180 slots:
       
   181 
       
   182 
       
   183 signals:
       
   184 
       
   185 };
       
   186 
       
   187 
       
   188 #endif // SMFMUSIC_H
       
   189