sbIMediaListViewSelection.idl
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2010 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
29 #include "nsISupports.idl"
30 
31 interface nsISimpleEnumerator;
32 interface sbIMediaItem;
33 
38 [scriptable, uuid(8e4e9f65-9c90-4381-a8ed-b8aa2d1ad028)]
40 {
44  void onSelectionChanged();
45 
50  void onCurrentIndexChanged();
51 };
52 
61 [scriptable, uuid(134d05d0-68ad-11df-a08a-0800200c9a66)]
63 {
67  readonly attribute long count;
68 
72  attribute long currentIndex;
73 
77  readonly attribute sbIMediaItem currentMediaItem;
78 
84  boolean isIndexSelected(in long aIndex);
85 
91  boolean isContentTypeSelected(in AString aContentType);
92 
100 
107 
112  void select(in long aIndex);
113 
119  void selectOnly(in long aIndex);
120 
127  void timedSelectOnly(in long aIndex, in long aDelay);
128 
133  void toggle(in long aIndex);
134 
139  void clear(in long aIndex);
140 
146  void selectRange(in long aStartIndex, in long aEndIndex);
147 
153  void clearRange(in long aStartIndex, in long aEndIndex);
154 
158  void selectNone();
159 
163  void selectAll();
164 
171 
177 
182 };
attribute long currentIndex
The index of the current media item.
Manage the selection of items within a view. This interface is a subset of nsITreeViewSelection. Note that if you are part of the user interface, you probably want to be calling nsITreeView.selection instead - otherwise things can get subtly out of sync.
void selectAll()
Selects all items.
saveStateDelayed aDelay
void clearRange(in long aStartIndex, in long aEndIndex)
Clear the specified range.
void selectOnly(in long aIndex)
Select only the item at the given index, all others will be deselected.
boolean isIndexSelected(in long aIndex)
Indicates whether or not the item at the specified index is part of the selection.
boolean isContentTypeSelected(in AString aContentType)
Indicates whether or not any item with the specified content type is selected.
var uuid
readonly attribute sbIMediaItem currentMediaItem
The current media item.
void selectRange(in long aStartIndex, in long aEndIndex)
Select the range specified by the indices.
void clear(in long aIndex)
Unselect the item at the given index.
void removeListener(in sbIMediaListViewSelectionListener aListener)
Remove a listener from the selection.
attribute boolean selectionNotificationsSuppressed
When set to true, notifications are not sent to the listeners.
void onSelectionChanged()
Called when the selection has changed.
void select(in long aIndex)
Select the item at the given index.
void onCurrentIndexChanged()
Called when the current index of has changed.
void toggle(in long aIndex)
Toggle the selection state of the item at the given index.
readonly attribute long count
The number of selected items.
Listener interface that gets notified on selection changes.
void selectNone()
Clears the selection.
void timedSelectOnly(in long aIndex, in long aDelay)
Same as selectOnly but notifies listeners after a delay (analogous to nsITreeSelection.timedSelect()).
Interface that defines a single item of media in the system.
readonly attribute nsISimpleEnumerator selectedIndexedMediaItems
Get an enumerator of all the selected media items. The elements contained in the enumerator implement...
void addListener(in sbIMediaListViewSelectionListener aListener)
Add a listener to the selection. It will be notified when the selection or current index changes...
readonly attribute nsISimpleEnumerator selectedMediaItems
Get an enumertaor of all the selected media items. The elements contained in the enumerator implement...