Songbird / Development / Songbird Add-Ons API Documentation

sbIMediaListView Interface Reference

A distinct view on a given media list. More...

import "sbIMediaListView.idl";

List of all members.

Public Member Functions

sbIMediaItem getItemByIndex (in unsigned long aIndex)
 Get a media item in the filtered view of this list by index.
unsigned long getIndexForItem (in sbIMediaItem aMediaItem)
 Searches the view for the first occurrence of the specified media item and returns the index where it was found.
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.
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.
unsigned long getIndexForViewItemUID (in AString aViewItemUID)
 Given an opaque identifier returned by getViewItemUIDForIndex, return the index of the media item it identifies.
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.
sbIMediaListViewState getState ()
 Returns a snapshot of the current state of this view. Can later be used to restore the state by passing the returned object as an argument to sbIMediaList::CreateView().
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.
void removeListener (in sbIMediaListViewListener aListener)
 Remove a listener from the view.
void removeSelectedMediaItems ()
 Remove selected items from the view's media list.

Public Attributes

readonly attribute sbIMediaList mediaList
 The media list this view is on.
readonly attribute unsigned
long 
length
 Returns the length of filtered view of this list.
readonly attribute nsITreeView treeView
 Get a treeview that will display this media list view.
readonly attribute sbICascadeFilterSet cascadeFilterSet
 Get the cascade filter set for this media list view.
readonly attribute sbIMediaListViewSelection selection
 Get the selection for the view.


Detailed Description

A distinct view on a given media list.

See also:
sbIMediaList

Definition at line 89 of file sbIMediaListView.idl.


Member Function Documentation

sbIMediaItem sbIMediaListView::getItemByIndex ( in unsigned long  aIndex  ) 

Get a media item in the filtered view of this list by index.

Parameters:
aIndex Filtered index of the media item
Returns:
Media item with the requested index

unsigned long sbIMediaListView::getIndexForItem ( in sbIMediaItem  aMediaItem  ) 

Searches the view for the first occurrence of the specified media item and returns the index where it was found.

Parameters:
aMediaItem Media item to search for
Returns:
Index where the media item was found
Exceptions:
NS_ERROR_NOT_AVAILABLE if the media item is not in the view

unsigned long sbIMediaListView::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.

Parameters:
aIndex Filtered index of the media item
Returns:
Index of the same item in the unfiltered list

AString sbIMediaListView::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.

Parameters:
aIndex Filtered index of the media item
Returns:
Opaque identifier of specified media item

unsigned long sbIMediaListView::getIndexForViewItemUID ( in AString  aViewItemUID  ) 

Given an opaque identifier returned by getViewItemUIDForIndex, return the index of the media item it identifies.

Parameters:
aViewItemUID The opaque identifier returned by getViewItemUIDForIndex
Returns:
Index of media item the identifer identifies.

sbIMediaListView 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.

Returns:
A clone of the media list view

sbIMediaListViewState sbIMediaListView::getState (  ) 

Returns a snapshot of the current state of this view. Can later be used to restore the state by passing the returned object as an argument to sbIMediaList::CreateView().

Returns:
The state of this media list view

void sbIMediaListView::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.

Calling addListener twice with the same listener and weak setting will be ignored. Calling twice with the same listener but different weak settings will cause two references to be stored, one weak and one strong.

Parameters:
aListener The listener instance.
aOwnsWeak [optional] Whether or not to hold a weak reference to the listener. If aOwnsWeak is true then aListener must be able to QI to nsISupportsWeakReference.
See also:
sbIMediaListViewListener

nsISupportsWeakReference

void sbIMediaListView::removeListener ( in sbIMediaListViewListener  aListener  ) 

Remove a listener from the view.

Calling removeListener with a listener that has not been previously added with addListener is a no-op.

Calling removeListener with a listener that had both a weak and a strong reference stored (via two calls to addListener with different values for aOwnsWeak) will cause the weak listener to be removed first. A second call to removeListener is necessary to remove the strong reference.

Parameters:
aListener The listener instance to remove.


The documentation for this interface was generated from the following file:
Generated on Tue Mar 10 14:29:00 2009 for Songbird by  doxygen 1.5.2