sbIRemoteWebPlaylist.idl
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25  */
26 
32 #include "nsISupports.idl"
33 
34 interface nsISimpleEnumerator;
35 interface sbIMediaListView;
36 interface sbIRemoteMediaList;
37 
38 /*
39 Class: WebPlaylist
40 
41 The <WebPlaylist> UI object. This object controls the UI that appears at
42 the bottom of the page. The information accessible here and operations
43 available here correspond to the the actual UI. Selection, column modification
44 and setting of the <MediaList> that serves as the data for the UI.
45 
46 Columns:
47 A note about columns. All the columns in the UI are driven by the existance
48 of global level properties in Songbird. There are a number of types available
49 to the developer ( see appendColumn() ). Each column must have a unique name and
50 there are a number system default names we use to get the default set of
51 columns. They are set when Songbird starts. When a column name is required as a
52 parameter to a function the default names can be used provided the operation
53 is not trying to add a column of that name. They can be passed in for the
54 before column, or they can be hidden via hideColumn().
55 
56 The default columns have names of this format -
57 (begin code)
58  http://songbirdnest.com/data/1.0#<columnIdentifier>
59 (end)
60 
61 The complete list of column names can be found in
62 http://publicsvn.songbirdnest.com/browser/trunk/components/property/src/sbStandardProperties.h
63 
64 */
72 [scriptable, uuid(fb29d038-9c71-40ab-9362-c5e728766d0d)]
74 {
75  /*
76  Prop: mediaList
77 
78  The <MediaList> associated with this <WebPlaylist> instance.
79 
80  Type:
81  <MediaList>
82  */
84 
85  /*
86  Prop: selection
87 
88  The current selection in the <WebPlaylist>.
89 
90  Type:
91  Enumerator, contains <MediaItems>.
92 
93  Example:
94  (start code)
95  //Get the current webplaylist.
96  var webPlaylist = songbird.webPlaylist;
97 
98 
99  //Get the currently selected mediaitems in the webplaylist.
100  var selectedMediaItems = webPlaylist.selection;
101 
102  //Go through all the selected mediaitems.
103 
104  //The hasMoreElements method will return true until there are
105  //no more elements left to get using the getNext method.
106 
107  while(selectedMediaItems.hasMoreElements()) {
108  var mediaItem = selectedMediaItems.getNext();
109 
110  //Do something with the mediaitem.
111  ...
112  }
113  (end)
114 
115  See Also:
116  Please see <http://www.xulplanet.com/references/xpcomref/ifaces/nsISimpleEnumerator.html> for nsISimpleEnumerator interface reference.
117  */
118  readonly attribute nsISimpleEnumerator selection;
119 
120  /*
121  Group: WebPlaylist Methods
122  */
123 
124  /*
125  Method: setSelectionByIndex()
126 
127  Set the selection in the <WebPlaylist>.
128 
129  Prototype:
130  setSelectionByIndex(Number index, Boolean selected)
131 
132  Parameters:
133  index - Index of the item in the <WebPlaylist>. Index starts at 0.
134  selected - Flag used for setting the selection state, may be true or false.
135 
136  Example:
137  (start code)
138  //Get the current webPlaylist.
139  var webPlaylist = songbird.webPlaylist;
140 
141  //Select the first item.
142  webPlaylist.setSelectionByIndex(0, true);
143 
144  //Select the third item.
145  webPlaylist.setSelectionByIndex(2, true);
146 
147  //Unselect the first item.
148  webPlaylist.setSelectionByIndex(0, false);
149  (end)
150  */
151  void setSelectionByIndex(in unsigned long aIndex, in boolean aSelected);
152 
153 
154  /*
155  Prop: hidden
156 
157  Is the <WebPlaylist> hidden?
158 
159  Setting <mediaList> on the <WebPlaylist> will automatically make the
160  <WebPlaylist> visible. <hidden> is intended for more advanced uses where a
161  web page might want to manipulate the visiblity of the <WebPlaylist>
162  directly.
163 
164  Type:
165  boolean
166 
167  Example:
168  (start code)
169  // show the webplaylist
170  songbird.webPlaylist.hidden = false;
171  // hide the webplaylist
172  songbird.webPlaylist.hidden = true;
173  // is the webplaylist hidden?
174  alert(songbird.webPlaylist.hidden?"It's hidden":"It's shown");
175  (end)
176  */
177  attribute boolean hidden;
178 };
179 
An interface to control a media list from remote web pages.
attribute sbIRemoteMediaList mediaList
var uuid
A distinct view on a given media list.
void setSelectionByIndex(in unsigned long aIndex, in boolean aSelected)
readonly attribute nsISimpleEnumerator selection
An interface to control a media list from remote web pages.