Songbird / Development / Songbird Add-Ons API Documentation

sbILibrary Interface Reference

Media library abstraction. More...

import "sbILibrary.idl";

Inheritance diagram for sbILibrary:

sbIMediaList sbIMediaItem sbILibraryResource sbIDeviceLibrary List of all members.

Public Member Functions

nsIChannel resolve (in nsIURI aUri)
 Resolves a songbird schemed URL to a channel. Throws an exception if the item referenced in the URL is not found.
sbIMediaItem createMediaItem (in nsIURI aContentUri,[optional] in sbIPropertyArray aProperties,[optional] in boolean aAllowDuplicates)
 Creates a new media item aContentUri The URI pointing to the content of the new media item. Use sbILibraryUtils.getContentURI or getFileContentURI to produce library content URI's.
boolean createMediaItemIfNotExist (in nsIURI aContentUri,[optional] in sbIPropertyArray aProperties,[optional] out sbIMediaItem aResultItem)
 Create a new media item, disallowing duplicates, and return if it did.
sbIMediaList createMediaList (in AString aType,[optional] in sbIPropertyArray aProperties)
 Creates a new media list.
sbIMediaList copyMediaList (in AString aType, in sbIMediaList aSource)
 Creates a new media list.
sbIMediaItem getMediaItem (in AString aGuid)
 Get a media item.
sbIMediaItem getDuplicate (in sbIMediaItem aMediaItem)
 Search for and return a duplicate of the media item specified by aMediaItem.
void registerMediaListFactory (in sbIMediaListFactory aFactory)
 Register a new media list type at run time.
void optimize ()
 Called when the library should remove unsupported media list types, unknown property types, temporary items, or otherwise optimize its performance or size.
void flush ()
 Called when the library should save any cached data to disk.
nsIArray batchCreateMediaItems (in nsIArray aURIArray,[optional] in nsIArray aPropertyArrayArray,[optional] in boolean aAllowDuplicates)
 Create many media items from a list of URIs, and notify their addition.
void batchCreateMediaItemsAsync (in sbIBatchCreateMediaItemsListener aListener, in nsIArray aURIArray,[optional] in nsIArray aPropertyArrayArray,[optional] in boolean aAllowDuplicates)
 Asychronously create many media items from a list of URIs.

Public Attributes

readonly attribute sbIDevice device
 Reference to the device that this library is stored on.
readonly attribute boolean supportsForeignMediaItems
 Declares if this library will host foreign media items.
readonly attribute nsIPropertyBag2 creationParameters
 Holds the parameters with which this library was created.
readonly attribute sbILibraryFactory factory
 Holds the factory that created this library.
readonly attribute nsIStringEnumerator mediaListTypes
 A list of available media list types.

Detailed Description

Media library abstraction.

The library interface is the primary means of exposing media library data to Songbird. Implementors of this interface must also provide implementations of sbIMediaItem and sbIMediaList.

See also:
sbIMediaItem, sbIMediaList

Definition at line 82 of file sbILibrary.idl.


Member Function Documentation

nsIChannel sbILibrary::resolve ( in nsIURI  aUri  ) 

Resolves a songbird schemed URL to a channel. Throws an exception if the item referenced in the URL is not found.

Parameters:
aUri The nsIURI to a media item to resolve
Returns:
An open channel to the content of the referenced media item

sbIMediaItem sbILibrary::createMediaItem ( in nsIURI  aContentUri,
[optional] in sbIPropertyArray  aProperties,
[optional] in boolean  aAllowDuplicates 
)

Creates a new media item aContentUri The URI pointing to the content of the new media item. Use sbILibraryUtils.getContentURI or getFileContentURI to produce library content URI's.

Parameters:
aProperties Optional initial properties for this new item
aAllowDuplicates If false, an attempt to create a new media item with a content URI that already exists in the library will simply return the existing item rather than creating a new one. If true, a new media item will be created with the specified content URI regardless if it is a duplicate. The default is false.
Returns:
A new, persisted media item

boolean sbILibrary::createMediaItemIfNotExist ( in nsIURI  aContentUri,
[optional] in sbIPropertyArray  aProperties,
[optional] out sbIMediaItem  aResultItem 
)

Create a new media item, disallowing duplicates, and return if it did.

Parameters:
[optional] aResultItem the item that was created (or found)
Returns:
Whether a new media item was created
See also:
createMediaItem

sbIMediaList sbILibrary::createMediaList ( in AString  aType,
[optional] in sbIPropertyArray  aProperties 
)

Creates a new media list.

Parameters:
aType - The type of media list to create.
aProperties Optional initial properties for this new item
Returns:
A new media list.

sbIMediaList sbILibrary::copyMediaList ( in AString  aType,
in sbIMediaList  aSource 
)

Creates a new media list.

Parameters:
aType - The type of media list to create.
aSource - A media list whose items and properties are to be copied.
Returns:
A new media list.

sbIMediaItem sbILibrary::getMediaItem ( in AString  aGuid  ) 

Get a media item.

Parameters:
aGuid Guid of media item to get
Returns:
The requested media item

sbIMediaItem sbILibrary::getDuplicate ( in sbIMediaItem  aMediaItem  ) 

Search for and return a duplicate of the media item specified by aMediaItem.

Parameters:
aMediaItem Media item for which to get duplicate.
Returns:
Duplicate media item or null if no duplicates.

void sbILibrary::registerMediaListFactory ( in sbIMediaListFactory  aFactory  ) 

Register a new media list type at run time.

Parameters:
aFactory - The factory that will create the media list

nsIArray sbILibrary::batchCreateMediaItems ( in nsIArray  aURIArray,
[optional] in nsIArray  aPropertyArrayArray,
[optional] in boolean  aAllowDuplicates 
)

Create many media items from a list of URIs, and notify their addition.

Parameters:
aURIArray nsIArray of nsIURI objects
aPropertyArrayArray Optional array of sbIPropertyArray. If specified, the properties specified at each array index will be used in the creation of the new media item at the same array index.
aAllowDuplicates If false, URIs specified in aURIArray that already exist in the library will not be created and not returned. If true, media items will be created for all of the URIs specified regardless if they already exist. The default is false.
Returns:
nsIArray of the new sbIMediaItem objects

void sbILibrary::batchCreateMediaItemsAsync ( in sbIBatchCreateMediaItemsListener  aListener,
in nsIArray  aURIArray,
[optional] in nsIArray  aPropertyArrayArray,
[optional] in boolean  aAllowDuplicates 
)

Asychronously create many media items from a list of URIs.

Parameters:
aListener Listener to receive progress and complete notifications
aURIArray nsIArray of nsIURI objects
aPropertyArrayArray Optional array of sbIPropertyArray. If specified, the properties specified at each array index will be used in the creation of the new media item at the same array index.
aAllowDuplicates If false, URIs specified in aURIArray that already exist in the library will not be created and not returned. If true, media items will be created for all of the URIs specified regardless if they already exist. The default is false.


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