sbIMediaListView.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 
33 #include "nsISupports.idl"
34 
35 interface nsIMutableArray;
36 interface nsIStringEnumerator;
37 interface nsITreeView;
38 interface sbICascadeFilterSet;
39 interface sbIMediaItem;
40 interface sbIMediaList;
41 interface sbIMediaListView;
42 interface sbIMutablePropertyArray;
44 
51 [scriptable, uuid(bb26d18e-8387-4512-9d99-8ce9b18f929b)]
53 {
54  AString toString();
55 };
56 
63 [scriptable, uuid(378fc540-9592-43df-908c-ed84ac0e1221)]
65 {
69  void onFilterChanged(in sbIMediaListView aChangedView);
70 
74  void onSearchChanged(in sbIMediaListView aChangedView);
75 
79  void onSortChanged(in sbIMediaListView aChangedView);
80 };
81 
88 [scriptable, uuid(53cefc7c-0967-4cab-84bd-11b52b1bf081)]
90 {
94  readonly attribute sbIMediaList mediaList;
95 
99  readonly attribute unsigned long length;
100 
104  readonly attribute nsITreeView treeView;
105 
110 
116  sbIMediaItem getItemByIndex(in unsigned long aIndex);
117 
125  unsigned long getIndexForItem(in sbIMediaItem aMediaItem);
126 
133  unsigned long getUnfilteredIndex(in unsigned long aIndex);
134 
143  AString getViewItemUIDForIndex(in unsigned long aIndex);
144 
152  unsigned long getIndexForViewItemUID(in AString aViewItemUID);
153 
154  /*
155  * \brief Return the distinct values in the view for a given property
156  * \param aPropertyID Propery ID to get distinct values for
157  * \return String enumerator of distinct values for the given property
158  */
159  nsIStringEnumerator getDistinctValuesForProperty(in AString aPropertyID);
160 
167 
175 
191  void addListener(in sbIMediaListViewListener aListener,
192  [optional] in boolean aOwnsWeak);
193 
207  void removeListener(in sbIMediaListViewListener aListener);
208 
213 
218 };
AString getViewItemUIDForIndex(in unsigned long aIndex)
Returns an opaque identifier that uniquely identifies the media item at a given position. This identifier can be used later to find the same media item after this view's filter and sort has been changed.
void onFilterChanged(in sbIMediaListView aChangedView)
Called when the view's filter configuration changes.
sbIMediaListView clone()
Create a clone of this view. This will return a copy with the same search, filter, sort, and cascade filter set as the original.
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 onSearchChanged(in sbIMediaListView aChangedView)
Called when the view's search changes.
readonly attribute sbICascadeFilterSet cascadeFilterSet
Get the cascade filter set for this media list view.
void removeListener(in sbIMediaListViewListener aListener)
Remove a listener from the view.
readonly attribute sbIMediaList mediaList
The media list this view is on.
void removeSelectedMediaItems()
Remove selected items from the view's media list.
Cascade filter management for a media list.
readonly attribute nsITreeView treeView
Get a treeview that will display this media list view.
var uuid
A brief description of the contents of this interface.
unsigned long getUnfilteredIndex(in unsigned long aIndex)
Given an index of an item in the filtered list, get the index of the same item in the unfiltered list...
A distinct view on a given media list.
sbIMediaListViewState getState()
Returns a snapshot of the current state of this view. Can later be used to restore the state by passi...
An interface to carry around arrays of nsIProperty instances Note that implementations of the interfa...
unsigned long getIndexForViewItemUID(in AString aViewItemUID)
Given an opaque identifier returned by getViewItemUIDForIndex, return the index of the media item it ...
Saved state of a media list view.
nsIStringEnumerator getDistinctValuesForProperty(in AString aPropertyID)
Saved state of a media list view.
Interface that defines a single item of media in the system.
readonly attribute sbIMediaListViewSelection selection
Get the selection for the view.
readonly attribute unsigned long length
Returns the length of filtered view of this list.
void onSortChanged(in sbIMediaListView aChangedView)
Called when the view's sort configuration changes.
sbIMediaItem getItemByIndex(in unsigned long aIndex)
Get a media item in the filtered view of this list by index.
void addListener(in sbIMediaListViewListener aListener, [optional] in boolean aOwnsWeak)
Add a listener to this view to be notified of changes to filter configuration, search, and sort configuration.
unsigned long getIndexForItem(in sbIMediaItem aMediaItem)
Searches the view for the first occurrence of the specified media item and returns the index where it...