00001 /* 00002 // 00003 // BEGIN SONGBIRD GPL 00004 // 00005 // This file is part of the Songbird web player. 00006 // 00007 // Copyright(c) 2005-2008 POTI, Inc. 00008 // http://songbirdnest.com 00009 // 00010 // This file may be licensed under the terms of of the 00011 // GNU General Public License Version 2 (the "GPL"). 00012 // 00013 // Software distributed under the License is distributed 00014 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 00015 // express or implied. See the GPL for the specific language 00016 // governing rights and limitations. 00017 // 00018 // You should have received a copy of the GPL along with this 00019 // program. If not, go to http://www.gnu.org/licenses/gpl.html 00020 // or write to the Free Software Foundation, Inc., 00021 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00022 // 00023 // END SONGBIRD GPL 00024 // 00025 */ 00026 00032 #include "nsISupports.idl" 00033 #include "sbIRemoteMediaList.idl" 00034 00035 interface sbILibraryConstraint; 00036 interface sbIMediaItem; 00037 interface nsIStringEnumerator; 00038 00039 /* 00040 Class: FilterResult 00041 00042 A <FilterResult> is the object that results from a library filtering operation. 00043 */ 00053 [scriptable, uuid(4a1ebcf3-a68a-4fb9-bda0-8cbeb62d6cf2)] 00054 interface sbIScriptableFilterResult : nsISupports 00055 { 00056 /* 00057 Group: FilterResult Properties 00058 */ 00059 /* 00060 Property: artists 00061 00062 Get an hash of all of the unique artist names in the <Library>. 00063 00064 Prototype: 00065 Object artists 00066 00067 Returns: 00068 An object containing all of the unique artist names that exist in 00069 the <Library> as property names 00070 00071 Example: 00072 (start code) 00073 //Create or get a library. 00074 var library = songbird.siteLibrary("", ""); 00075 00076 //Get unique artists. 00077 var artists = library.artists; 00078 00079 for (var artist in artists) { 00080 //The artist name (ie. "Justice") 00081 alert(artist); 00082 } 00083 (end) 00084 00085 See Also: 00086 <albums> 00087 <genres> 00088 <years> 00089 <items> 00090 */ 00091 readonly attribute nsIStringEnumerator artists; 00092 00093 /* 00094 Property: albums 00095 00096 Get an hash of all of the unique album names in the <Library>. 00097 00098 Prototype: 00099 Object albums 00100 00101 Returns: 00102 An object containing all of the unique album names that exist in 00103 the <Library> as property names 00104 00105 Example: 00106 (start code) 00107 //Create or get a library. 00108 var library = songbird.siteLibrary("", ""); 00109 00110 //Get unique albums. 00111 var albums = library.albums; 00112 00113 for (var album in albums) { 00114 //The album name (ie. "Cross") 00115 alert(album); 00116 } 00117 (end) 00118 00119 See Also: 00120 <artists> 00121 <albums> 00122 <years> 00123 <items> 00124 */ 00125 readonly attribute nsIStringEnumerator albums; 00126 00127 /* 00128 Property: genres 00129 00130 Get an hash of all of the unique genres in the <Library>. 00131 00132 Prototype: 00133 Object genres 00134 00135 Returns: 00136 An object containing all of the unique genres that exist in 00137 the <Library> as property names 00138 00139 Example: 00140 (start code) 00141 //Create or get a library. 00142 var library = songbird.siteLibrary("", ""); 00143 00144 //Get unique genres. 00145 var genres = library.genres; 00146 00147 for (var genre in genres) { 00148 //The genre (ie. "Electronic") 00149 alert(genre); 00150 } 00151 00152 (end) 00153 00154 See Also: 00155 <artists> 00156 <albums> 00157 <years> 00158 <items> 00159 */ 00160 readonly attribute nsIStringEnumerator genres; 00161 00162 /* 00163 Property: years 00164 00165 Get an hash of all of the unique years in the <Library>. 00166 00167 Prototype: 00168 Object years 00169 00170 Returns: 00171 An object containing all of the unique years that exist in 00172 the <Library> as property names 00173 00174 Example: 00175 (start code) 00176 //Create or get a library. 00177 var library = songbird.siteLibrary("", ""); 00178 00179 //Get unique years. 00180 var years = library.years; 00181 00182 for (var year in years) { 00183 //The year (ie. "2007") 00184 alert(year); 00185 } 00186 (end) 00187 00188 See Also: 00189 <artists> 00190 <albums> 00191 <genres> 00192 <items> 00193 */ 00194 readonly attribute nsIStringEnumerator years; 00195 00196 /* 00197 Property: items 00198 00199 Get a collection of <MediaItems> that match the current filter 00200 00201 Prototype: 00202 Object items 00203 00204 Example: 00205 (start code) 00206 //Create or get a library. 00207 var library = songbird.siteLibrary("", ""); 00208 00209 //Get all items in the album "Hello" by the artist "Pancake" 00210 var items = library.albums["Hello"].artists["Pancake"].items; 00211 for each (var item in items) { 00212 // do something with this item 00213 alert(item.contentSrc); 00214 } 00215 (end) 00216 00217 See Also: 00218 <artists> 00219 <albums> 00220 <genres> 00221 <years> 00222 <MediaItem> 00223 */ 00224 00225 readonly attribute nsISupports items; 00226 00230 [noscript] readonly attribute sbILibraryConstraint constraint; 00231 };