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 00034 interface nsISimpleEnumerator; 00035 interface sbIMediaListView; 00036 interface sbIRemoteMediaList; 00037 00038 /* 00039 Class: WebPlaylist 00040 00041 The <WebPlaylist> UI object. This object controls the UI that appears at 00042 the bottom of the page. The information accessible here and operations 00043 available here correspond to the the actual UI. Selection, column modification 00044 and setting of the <MediaList> that serves as the data for the UI. 00045 00046 Columns: 00047 A note about columns. All the columns in the UI are driven by the existance 00048 of global level properties in Songbird. There are a number of types available 00049 to the developer ( see appendColumn() ). Each column must have a unique name and 00050 there are a number system default names we use to get the default set of 00051 columns. They are set when Songbird starts. When a column name is required as a 00052 parameter to a function the default names can be used provided the operation 00053 is not trying to add a column of that name. They can be passed in for the 00054 before column, or they can be hidden via hideColumn(). 00055 00056 The default columns have names of this format - 00057 (begin code) 00058 http://songbirdnest.com/data/1.0#<columnIdentifier> 00059 (end) 00060 00061 The complete list of column names can be found in 00062 http://publicsvn.songbirdnest.com/browser/trunk/components/property/src/sbStandardProperties.h 00063 00064 */ 00072 [scriptable, uuid(fb29d038-9c71-40ab-9362-c5e728766d0d)] 00073 interface sbIRemoteWebPlaylist : nsISupports 00074 { 00075 /* 00076 Prop: mediaList 00077 00078 The <MediaList> associated with this <WebPlaylist> instance. 00079 00080 Type: 00081 <MediaList> 00082 */ 00083 attribute sbIRemoteMediaList mediaList; 00084 00085 /* 00086 Prop: selection 00087 00088 The current selection in the <WebPlaylist>. 00089 00090 Type: 00091 Enumerator, contains <MediaItems>. 00092 00093 Example: 00094 (start code) 00095 //Get the current webplaylist. 00096 var webPlaylist = songbird.webPlaylist; 00097 00098 00099 //Get the currently selected mediaitems in the webplaylist. 00100 var selectedMediaItems = webPlaylist.selection; 00101 00102 //Go through all the selected mediaitems. 00103 00104 //The hasMoreElements method will return true until there are 00105 //no more elements left to get using the getNext method. 00106 00107 while(selectedMediaItems.hasMoreElements()) { 00108 var mediaItem = selectedMediaItems.getNext(); 00109 00110 //Do something with the mediaitem. 00111 ... 00112 } 00113 (end) 00114 00115 See Also: 00116 Please see <http://www.xulplanet.com/references/xpcomref/ifaces/nsISimpleEnumerator.html> for nsISimpleEnumerator interface reference. 00117 */ 00118 readonly attribute nsISimpleEnumerator selection; 00119 00120 /* 00121 Group: WebPlaylist Methods 00122 */ 00123 00124 /* 00125 Method: setSelectionByIndex() 00126 00127 Set the selection in the <WebPlaylist>. 00128 00129 Prototype: 00130 setSelectionByIndex(Number index, Boolean selected) 00131 00132 Parameters: 00133 index - Index of the item in the <WebPlaylist>. Index starts at 0. 00134 selected - Flag used for setting the selection state, may be true or false. 00135 00136 Example: 00137 (start code) 00138 //Get the current webPlaylist. 00139 var webPlaylist = songbird.webPlaylist; 00140 00141 //Select the first item. 00142 webPlaylist.setSelectionByIndex(0, true); 00143 00144 //Select the third item. 00145 webPlaylist.setSelectionByIndex(2, true); 00146 00147 //Unselect the first item. 00148 webPlaylist.setSelectionByIndex(0, false); 00149 (end) 00150 */ 00151 void setSelectionByIndex(in unsigned long aIndex, in boolean aSelected); 00152 00153 00154 /* 00155 Prop: hidden 00156 00157 Is the <WebPlaylist> hidden? 00158 00159 Setting <mediaList> on the <WebPlaylist> will automatically make the 00160 <WebPlaylist> visible. <hidden> is intended for more advanced uses where a 00161 web page might want to manipulate the visiblity of the <WebPlaylist> 00162 directly. 00163 00164 Type: 00165 boolean 00166 00167 Example: 00168 (start code) 00169 // show the webplaylist 00170 songbird.webPlaylist.hidden = false; 00171 // hide the webplaylist 00172 songbird.webPlaylist.hidden = true; 00173 // is the webplaylist hidden? 00174 alert(songbird.webPlaylist.hidden?"It's hidden":"It's shown"); 00175 (end) 00176 */ 00177 attribute boolean hidden; 00178 }; 00179