A brief description of the contents of this interface. More...
import"sbIMediaList.idl";
Public Member Functions | |
sbIMediaItem | getItemByGuid (in AString aGuid) |
Get a media item in the list by guid. More... | |
sbIMediaItem | getItemByIndex (in unsigned long aIndex) |
Get a media item in the list by index. More... | |
unsigned short | getListContentType () |
Get the content type of the media list. More... | |
void | enumerateAllItems (in sbIMediaListEnumerationListener aEnumerationListener, [optional] in unsigned short aEnumerationType) |
Enumerate all items in the list. More... | |
void | enumerateItemsByProperty (in AString aPropertyID, in AString aPropertyValue, in sbIMediaListEnumerationListener aEnumerationListener, [optional] in unsigned short aEnumerationType) |
Enumerate the media items in the list that match a given property ID and value. More... | |
void | enumerateItemsByProperties (in sbIPropertyArray aProperties, in sbIMediaListEnumerationListener aEnumerationListener, [optional] in unsigned short aEnumerationType) |
Enumerate the media items that match a list of property IDs and values. More... | |
nsIArray | getItemsByProperty (in AString aPropertyID, in AString aPropertyValue) |
PRUint32 | getItemCountByProperty (in AString aPropertyID, in AString aPropertyValue) |
nsIArray | getItemsByProperties (in sbIPropertyArray aProperties) |
unsigned long | indexOf (in sbIMediaItem aMediaItem, [optional] in unsigned long aStartFrom) |
Get the first index of a media item in the list. More... | |
unsigned long | lastIndexOf (in sbIMediaItem aMediaItem, in unsigned long aStartFrom) |
Get the last index of a media item int he list. More... | |
boolean | contains (in sbIMediaItem aMediaItem) |
Check if the list contains a media item. More... | |
void | add (in sbIMediaItem aMediaItem) |
Add a media item to this list. More... | |
sbIMediaItem | addItem (in sbIMediaItem aMediaItem) |
addItem a media item to this list More... | |
void | addAll (in sbIMediaList aMediaList) |
Add the contents of a media list to this list. More... | |
void | addSome (in nsISimpleEnumerator aMediaItems) |
Adds media items suppled by the provided enumerator NOTE: This method is now deprecated. More... | |
void | addMediaItems (in nsISimpleEnumerator aMediaItems, in sbIAddMediaItemsListener aListener, in boolean aAsync) |
Adds media items suppled by the provided enumerator. More... | |
void | remove (in sbIMediaItem aMediaItem) |
Remove the first occurrence of the given media item from the list. More... | |
void | removeByIndex (in unsigned long aIndex) |
Remove a media item from the list by index. More... | |
void | removeSome (in nsISimpleEnumerator aMediaItems) |
Removed media items suppled by the provided enumerator. More... | |
void | clear () |
Clear the list. More... | |
void | addListener (in sbIMediaListListener aListener, [optional] in boolean aOwnsWeak, [optional] in unsigned long aFlags, [optional] in sbIPropertyArray aPropertyFilter) |
Add a listener to this media list. More... | |
void | removeListener (in sbIMediaListListener aListener) |
Remove a listener from this media list. More... | |
sbIMediaListView | createView ([optional] in sbIMediaListViewState aState) |
Create a new, raw view for this list. This is generally not the function that you want to use for making views as it will create a completely raw view, for example lacking any filterConstraint. Please consider using sbLibraryUtils.createStandardMediaListView and proceed carefully if you use this method instead. More... | |
void | runInBatchMode (in sbIMediaListBatchCallback aCallback, [optional] in nsISupports aUserData) |
Runs the given callback with the given user data in batch mode. More... | |
nsIStringEnumerator | getDistinctValuesForProperty (in AString aPropertyID) |
Public Member Functions inherited from sbIMediaItem | |
void | testIsURIAvailable (in nsIObserver aObserver) |
Test if this media item is available for playback. More... | |
nsIChannel | openInputStreamAsync (in nsIStreamListener aListener, in nsISupports aContext) |
Asynchronously get an input stream to the content of the media item. More... | |
nsIInputStream | openInputStream () |
Synchronously get an input stream to the content of the media item. More... | |
nsIOutputStream | openOutputStream () |
Get an output stream to the content of the media item. More... | |
AString | toString () |
Get a string representation of the media item, useful for debugging. More... | |
Public Member Functions inherited from sbILibraryResource | |
AString | getProperty (in AString aID) |
Get the value of a property of this resource. More... | |
void | setProperty (in AString aID, in AString aValue) |
Set the value of a property on this resource. More... | |
sbIPropertyArray | getProperties ([optional] in sbIPropertyArray aPropertyIDs) |
Get properties from this resource in a property array. More... | |
void | setProperties (in sbIPropertyArray aProperties) |
Sets the properties and values in the supplied property array to this resource. This works as if you called setProperty on each property in the array. More... | |
boolean | equals (in sbILibraryResource aOtherLibraryResource) |
Tests the equality of two library resources. More... | |
Public Attributes | |
const unsigned short | ENUMERATIONTYPE_SNAPSHOT = 0 |
This flag means that the list being enumerated is a copy that may become out of date. More... | |
const unsigned short | ENUMERATIONTYPE_LOCKING = 1 |
This flag means that the list is protected from changes by other threads during the enumeration. More... | |
const unsigned short | CONTENTTYPE_NONE = 0 |
These flags specify the contentType of the media list. More... | |
const unsigned short | CONTENTTYPE_AUDIO = 1 |
const unsigned short | CONTENTTYPE_VIDEO = 2 |
const unsigned short | CONTENTTYPE_MIX = 3 |
attribute AString | name |
The name of the media list. More... | |
readonly attribute AString | type |
The type of media list (eg "simple") More... | |
readonly attribute unsigned long | length |
Returns the length of the list. More... | |
readonly attribute boolean | isEmpty |
Is the list empty? More... | |
readonly attribute boolean | userEditableContent |
True if the user should be allowed to edit the content of this media list. More... | |
const unsigned long | LISTENER_FLAGS_ITEMADDED = 1 << 0 |
const unsigned long | LISTENER_FLAGS_BEFOREITEMREMOVED = 1 << 1 |
const unsigned long | LISTENER_FLAGS_AFTERITEMREMOVED = 1 << 2 |
const unsigned long | LISTENER_FLAGS_ITEMUPDATED = 1 << 3 |
const unsigned long | LISTENER_FLAGS_BEFORELISTCLEARED = 1 << 4 |
const unsigned long | LISTENER_FLAGS_LISTCLEARED = 1 << 5 |
const unsigned long | LISTENER_FLAGS_BATCHBEGIN = 1 << 6 |
const unsigned long | LISTENER_FLAGS_BATCHEND = 1 << 7 |
const unsigned long | LISTENER_FLAGS_ITEMMOVED = 1 << 8 |
const unsigned long | LISTENER_FLAGS_ALL = 0xffffffff |
Public Attributes inherited from sbIMediaItem | |
readonly attribute sbILibrary | library |
The library that this media item is contained in. More... | |
readonly attribute boolean | isMutable |
Can the media item be changed? More... | |
readonly attribute sbIMediaItemController | itemController |
An interface to the media item controller (if any) that determines this item's availability for playback. More... | |
attribute long long | mediaCreated |
Creation time of the media item as a unix timestamp. More... | |
attribute long long | mediaUpdated |
Last modification time of the media item as a unix timestamp. More... | |
attribute nsIURI | contentSrc |
A nsIURI that resolves to the content of the media item. More... | |
attribute long long | contentLength |
Size (in bytes) of the content of the media item. More... | |
attribute AString | contentType |
Content type of the content of the media item, typically a mime type (should this be renamed?) More... | |
Public Attributes inherited from sbILibraryResource | |
readonly attribute AString | guid |
The guid of this resource. More... | |
readonly attribute long long | created |
The creation time of this resource as a unix timestamp. More... | |
readonly attribute long long | updated |
The last update time of this resource as a unix timestamp. More... | |
readonly attribute nsIStringEnumerator | propertyIDs |
Returns a string enumerator of the IDs of all the properties set on this resource. More... | |
readonly attribute boolean | userEditable |
True if users should be allowed to modify the resource. More... | |
A brief description of the contents of this interface.
A detailed description of this interface
Definition at line 106 of file sbIMediaList.idl.
void sbIMediaList::add | ( | in sbIMediaItem | aMediaItem | ) |
Add a media item to this list.
aMediaItem | The media item to add to the list |
void sbIMediaList::addAll | ( | in sbIMediaList | aMediaList | ) |
Add the contents of a media list to this list.
aMediaList | The media list whose contents are to be added |
sbIMediaItem sbIMediaList::addItem | ( | in sbIMediaItem | aMediaItem | ) |
addItem a media item to this list
aMediaItem | The media item to add to the list |
void sbIMediaList::addListener | ( | in sbIMediaListListener | aListener, |
[optional] in boolean | aOwnsWeak, | ||
[optional] in unsigned long | aFlags, | ||
[optional] in sbIPropertyArray | aPropertyFilter | ||
) |
Add a listener to this media list.
aListener | The listener to add |
aOwnsWeak | If set to false, the media list will hold a strong reference to |aListener|. If set to true and |aListener| supports the nsIWeakReference interface, a weak reference will be held. Otherwise an error will be returned. |
aFlags | A bit mask made up the LISTENER_FLAGS_ constants above. Use this to filter out unwanted notifications. If not set, this will default to LISTENER_FLAGS_ALL |
aPropertyFilter | If this argument is specified, the onItemUpdated notification will only be sent for updates to any of the properties specified in the array. Note that the values of the properties in the array are ignored. If not set or null, no filtering will be applied. |
void sbIMediaList::addMediaItems | ( | in nsISimpleEnumerator | aMediaItems, |
in sbIAddMediaItemsListener | aListener, | ||
in boolean | aAsync | ||
) |
Adds media items suppled by the provided enumerator.
aMediaItems | An enumerator returning sbIMediaItem objects |
aListener | A listener that will get called with progress information |
aAsync | Whether the work is to be done asynchronously |
NS_ERROR_NOT_IMPLEMENTED | if not implemented by the underlying object. |
void sbIMediaList::addSome | ( | in nsISimpleEnumerator | aMediaItems | ) |
Adds media items suppled by the provided enumerator NOTE: This method is now deprecated.
void sbIMediaList::clear | ( | ) |
Clear the list.
boolean sbIMediaList::contains | ( | in sbIMediaItem | aMediaItem | ) |
Check if the list contains a media item.
aMediaItem | Media item to search for |
sbIMediaListView sbIMediaList::createView | ( | [optional] in sbIMediaListViewState | aState | ) |
Create a new, raw view for this list. This is generally not the function that you want to use for making views as it will create a completely raw view, for example lacking any filterConstraint. Please consider using sbLibraryUtils.createStandardMediaListView and proceed carefully if you use this method instead.
aState | Optional initial state for the view |
void sbIMediaList::enumerateAllItems | ( | in sbIMediaListEnumerationListener | aEnumerationListener, |
[optional] in unsigned short | aEnumerationType | ||
) |
Enumerate all items in the list.
Do not use ENUMERATIONTYPE_LOCKING unless you fit a usage scenario described in the ENUMERATIONTYPE_LOCKING constant documentation.
Do not remove items during enumeration, regardless of enumeration type! This will cause functional issues during enumeration because the property cache will no longer contain associated data for items even though the item instance is still valid!
aEnumerationListener | - The enumeration listener. |
aEnumerationType | - One of the ENUMERATIONTYPE values above. Default is ENUMERATIONTYPE_SNAPSHOT. |
void sbIMediaList::enumerateItemsByProperties | ( | in sbIPropertyArray | aProperties, |
in sbIMediaListEnumerationListener | aEnumerationListener, | ||
[optional] in unsigned short | aEnumerationType | ||
) |
Enumerate the media items that match a list of property IDs and values.
aProperties | - A list of property ID/value pairs. |
aEnumerationListener | - The enumeration listener. |
[optional] | aEnumerationType - One of the ENUMERATIONTYPE values above. |
void sbIMediaList::enumerateItemsByProperty | ( | in AString | aPropertyID, |
in AString | aPropertyValue, | ||
in sbIMediaListEnumerationListener | aEnumerationListener, | ||
[optional] in unsigned short | aEnumerationType | ||
) |
Enumerate the media items in the list that match a given property ID and value.
Do not remove items during enumeration, regardless of enumeration type! This will cause functional issues during enumeration because the property cache will no longer contain associated data for items even though the item instance is still valid!
aPropertyID | - Property ID to search. |
aPropertyValue | - Property value to search. |
aEnumerationListener | - The enumeration listener. |
[optional] | aEnumerationType - One of the ENUMERATIONTYPE values above. Default is <ENUMERATIONTYPE_SNAPSHOT>. |
nsIStringEnumerator sbIMediaList::getDistinctValuesForProperty | ( | in AString | aPropertyID | ) |
sbIMediaItem sbIMediaList::getItemByGuid | ( | in AString | aGuid | ) |
Get a media item in the list by guid.
aGuid | Guid of the media item |
sbIMediaItem sbIMediaList::getItemByIndex | ( | in unsigned long | aIndex | ) |
Get a media item in the list by index.
aIndex | Index of the media item |
PRUint32 sbIMediaList::getItemCountByProperty | ( | in AString | aPropertyID, |
in AString | aPropertyValue | ||
) |
Get item count that have a certain property set to the specified value.
aPropertyID | The property id. |
aPropertyValue | The property value. |
NS_ERROR_NOT_AVAILABLE | when no items match the criteria. |
nsIArray sbIMediaList::getItemsByProperties | ( | in sbIPropertyArray | aProperties | ) |
Get all items that have a all properties set to the values specified.
aProperties | The property array containing property key/value pairs. |
NS_ERROR_NOT_AVAILABLE | when no items match the criteria. |
nsIArray sbIMediaList::getItemsByProperty | ( | in AString | aPropertyID, |
in AString | aPropertyValue | ||
) |
Get all items that have a certain property set to the specified value.
aPropertyID | The property id. |
aPropertyValue | The property value. |
NS_ERROR_NOT_AVAILABLE | when no items match the criteria. |
unsigned short sbIMediaList::getListContentType | ( | ) |
Get the content type of the media list.
unsigned long sbIMediaList::indexOf | ( | in sbIMediaItem | aMediaItem, |
[optional] in unsigned long | aStartFrom | ||
) |
Get the first index of a media item in the list.
aMediaItem | Media item to search for |
aStartFrom | If specified, the index to start the search from. |
unsigned long sbIMediaList::lastIndexOf | ( | in sbIMediaItem | aMediaItem, |
in unsigned long | aStartFrom | ||
) |
Get the last index of a media item int he list.
aMediaItem | Media item to search for |
aStartFrom | ben write me |
void sbIMediaList::remove | ( | in sbIMediaItem | aMediaItem | ) |
Remove the first occurrence of the given media item from the list.
aMediaItem | Media item to remove |
void sbIMediaList::removeByIndex | ( | in unsigned long | aIndex | ) |
Remove a media item from the list by index.
aIndex | Index of the item to remove |
void sbIMediaList::removeListener | ( | in sbIMediaListListener | aListener | ) |
Remove a listener from this media list.
aListener | The listener to remove |
void sbIMediaList::removeSome | ( | in nsISimpleEnumerator | aMediaItems | ) |
Removed media items suppled by the provided enumerator.
aMediaItems | An enumerator returning sbIMediaItem objects |
void sbIMediaList::runInBatchMode | ( | in sbIMediaListBatchCallback | aCallback, |
[optional] in nsISupports | aUserData | ||
) |
Runs the given callback with the given user data in batch mode.
const unsigned short sbIMediaList::CONTENTTYPE_AUDIO = 1 |
Definition at line 207 of file sbIMediaList.idl.
const unsigned short sbIMediaList::CONTENTTYPE_MIX = 3 |
Definition at line 211 of file sbIMediaList.idl.
const unsigned short sbIMediaList::CONTENTTYPE_NONE = 0 |
These flags specify the contentType of the media list.
Const: CONTENTTYPE_NONE Special list type: Download for example.
Const: CONTENTTYPE_AUDIO Only audio items in the lists or empty lists.
Const: CONTENTTYPE_VIDEO Only video items in the lists.
Const: CONTENTTYPE_MIX Both audio and video items in the lists.
Definition at line 205 of file sbIMediaList.idl.
const unsigned short sbIMediaList::CONTENTTYPE_VIDEO = 2 |
Definition at line 209 of file sbIMediaList.idl.
const unsigned short sbIMediaList::ENUMERATIONTYPE_LOCKING = 1 |
This flag means that the list is protected from changes by other threads during the enumeration.
Use this flag if you need to be certain that the contents of the list are not changed during enumeration. Note that all other threads will block until the enumeration is complete. Furthermore, changes made to list from the listener are not permitted until the listener has received the onEnumerationEnd notification.
Definition at line 187 of file sbIMediaList.idl.
const unsigned short sbIMediaList::ENUMERATIONTYPE_SNAPSHOT = 0 |
This flag means that the list being enumerated is a copy that may become out of date.
Use this flag if you don't care whether or not other threads change the list's contents. The listener may make changes to the list at any time but those changes will not be reflected in the enumeration sequence.
Definition at line 149 of file sbIMediaList.idl.
readonly attribute boolean sbIMediaList::isEmpty |
Is the list empty?
Definition at line 341 of file sbIMediaList.idl.
readonly attribute unsigned long sbIMediaList::length |
Returns the length of the list.
Definition at line 300 of file sbIMediaList.idl.
const unsigned long sbIMediaList::LISTENER_FLAGS_AFTERITEMREMOVED = 1 << 2 |
Definition at line 1148 of file sbIMediaList.idl.
const unsigned long sbIMediaList::LISTENER_FLAGS_ALL = 0xffffffff |
Definition at line 1155 of file sbIMediaList.idl.
const unsigned long sbIMediaList::LISTENER_FLAGS_BATCHBEGIN = 1 << 6 |
Definition at line 1152 of file sbIMediaList.idl.
const unsigned long sbIMediaList::LISTENER_FLAGS_BATCHEND = 1 << 7 |
Definition at line 1153 of file sbIMediaList.idl.
const unsigned long sbIMediaList::LISTENER_FLAGS_BEFOREITEMREMOVED = 1 << 1 |
Definition at line 1147 of file sbIMediaList.idl.
const unsigned long sbIMediaList::LISTENER_FLAGS_BEFORELISTCLEARED = 1 << 4 |
Definition at line 1150 of file sbIMediaList.idl.
const unsigned long sbIMediaList::LISTENER_FLAGS_ITEMADDED = 1 << 0 |
Definition at line 1146 of file sbIMediaList.idl.
const unsigned long sbIMediaList::LISTENER_FLAGS_ITEMMOVED = 1 << 8 |
Definition at line 1154 of file sbIMediaList.idl.
const unsigned long sbIMediaList::LISTENER_FLAGS_ITEMUPDATED = 1 << 3 |
Definition at line 1149 of file sbIMediaList.idl.
const unsigned long sbIMediaList::LISTENER_FLAGS_LISTCLEARED = 1 << 5 |
Definition at line 1151 of file sbIMediaList.idl.
attribute AString sbIMediaList::name |
The name of the media list.
Definition at line 241 of file sbIMediaList.idl.
readonly attribute AString sbIMediaList::type |
The type of media list (eg "simple")
Definition at line 267 of file sbIMediaList.idl.
readonly attribute boolean sbIMediaList::userEditableContent |
True if the user should be allowed to edit the content of this media list.
Definition at line 386 of file sbIMediaList.idl.