1 /* 2 Copyright (c) 2008, Pioneers of the Inevitable, Inc. 3 All rights reserved. 4 5 Redistribution and use in source and binary forms, with or without 6 modification, are permitted provided that the following conditions are met: 7 8 * Redistributions of source code must retain the above copyright notice, 9 this list of conditions and the following disclaimer. 10 * Redistributions in binary form must reproduce the above copyright notice, 11 this list of conditions and the following disclaimer in the documentation 12 and/or other materials provided with the distribution. 13 * Neither the name of Pioneers of the Inevitable, Songbird, nor the names 14 of its contributors may be used to endorse or promote products derived 15 from this software without specific prior written permission. 16 17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 21 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 #include "nsISupports.idl" 29 30 interface nsIDOMDocument; 31 interface nsIPropertyBag; 32 33 [scriptable, uuid(1e6a1de4-8b24-459d-8122-3809db6602ac)] 34 interface sbILastFm : nsISupports { 35 // the username of the currently logged-in last.fm user 36 readonly attribute string username; 37 }; 38 39 [scriptable, function, uuid(ccc25979-fa92-444c-8656-33bad339435b)] 40 interface sbILastFmWebServicesResponse : nsISupports { 41 // an API response has been recieved 42 // @aSucceeded indicates if the call was succesful or not 43 // @aResponse contains the XML response - for successful calls and for calls 44 // that return an API error See the Last.fm API documentation for the DOM 45 // structures to expect. 46 void responseReceived(in boolean aSucceeded, in nsIDOMDocument aResponse); 47 }; 48 49 [scriptable, uuid(30280ad6-8556-4d81-a479-4b59324c9334)] 50 interface sbILastFmWebServices : nsISupports { 51 // what user is currently associated with last.fm 52 readonly attribute string username; 53 54 // is the current user logged in? 55 readonly attribute boolean loggedIn; 56 57 // Make an API call against the new Last.fm API 58 // See <http://www.last.fm/api/rest> for the list of API calls that are 59 // available. The method name is passed in @aMethod. Authentication, API 60 // keys and request signing will be taken care of automatically. Other 61 // paramters should be passed in property bag @aArguments. The callback 62 // @aCallback will be called when the API call completes. 63 void apiCall(in string aMethod, 64 in nsIPropertyBag aArguments, // NOTE: values must be strings 65 in sbILastFmWebServicesResponse aCallback); 66 }; 67 68 [scriptable, uuid(b88cda15-f36e-4984-982e-160f60abca3e)] 69 interface sbILastFmRadio : nsISupports { 70 // tune into a lastfm:// ratio station 71 void radioPlay(in string aStation); 72 }; 73