sbLibraryUtils Class Reference

#include <sbLibraryUtils.h>

Static Public Member Functions

static nsresult GetItemInLibrary (sbIMediaItem *aItem, sbILibrary *aLibrary, sbIMediaItem **_retval)
 
static nsresult FindItemsWithSameURL (sbIMediaItem *aMediaItem, sbIMediaList *aMediaList, nsIMutableArray *aCopies)
 
static nsresult FindCopiesByID (sbIMediaItem *aMediaItem, sbIMediaList *aList, nsIMutableArray *aCopies)
 
static nsresult FindOriginalsByID (sbIMediaItem *aMediaItem, sbIMediaList *aList, nsIMutableArray *aCopies)
 
static nsresult GetOriginItem (sbIMediaItem *aItem, sbIMediaItem **_retval)
 
static nsresult GetContentLength (sbIMediaItem *aItem, PRInt64 *_retval=nsnull)
 
static nsresult SetContentLength (sbIMediaItem *aItem, nsIURI *aURI)
 
static nsresult GetContentURI (nsIURI *aURI, nsIURI **_retval, nsIIOService *aIOService=nsnull)
 Return a library content URI for the URI specified by aURI. A library content URI is a specially formatted URI for use within Songbird libraries and is formatted to facilitate searching for equivalent URI's (e.g., "file:" URI's are all lower case on Windows). URI's provided to createMediaItem and related methods must be library content URI's. More...
 
static nsresult GetMediaListContentType (sbIMediaList *aMediaList, PRUint16 *aListContentType)
 Return a media list content type. More...
 
static nsresult GetFileContentURI (nsIFile *aFile, nsIURI **_retval)
 Return a library content URI for the file specified by aFile. Special processing is required to convert an nsIFile to a library content URI (see bug 6227). getFileContentURI must be used instead of nsIIOService.newFileURI for generating library content URI's. More...
 
static nsresult GetItemsByProperty (sbIMediaList *aMediaList, nsAString const &aPropertyName, nsAString const &aValue, nsCOMArray< sbIMediaItem > &aMediaItems)
 
static nsresult GetMediaListByContentType (sbILibrary *aLibrary, PRUint32 aContentType, nsIArray **aMediaLists)
 
static PRUint32 GetEqualOperator (sbIPropertyOperator **aOperator)
 
static nsresult SuggestUniqueNameForPlaylist (sbILibrary *aLibrary, nsAString const &aListName, nsAString &aName)
 Suggest a unique name for playlist. More...
 
static nsresult LinkCopy (sbIMediaItem *aOriginal, sbIMediaItem *aCopy)
 Links a copy to its original. It will take into account the libraries the items belong to. It will only link from main library to non-main library. And if necessary if the copy is in the main library it will link the original to the copy. More...
 

Detailed Description

Definition at line 96 of file sbLibraryUtils.h.

Member Function Documentation

nsresult sbLibraryUtils::FindCopiesByID ( sbIMediaItem aMediaItem,
sbIMediaList aList,
nsIMutableArray *  aCopies 
)
static

aList is searched for items that have origin ID's that match aMediaItem's ID and items that has the same origin ID's as the aMediaItem's origin ID's

Parameters
aItemThe item to find a copies of
aListThe list to search
Returns
The media items found, or empty array. aCopies may be null in which case the function will return NS_ERROR_NOT_AVAILABLE if no copies are found

Definition at line 276 of file sbLibraryUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbLibraryUtils::FindItemsWithSameURL ( sbIMediaItem aMediaItem,
sbIMediaList aMediaList,
nsIMutableArray *  aCopies 
)
static

This function search for itens in aMediaList with the same URL's. The origin URL of aMediaItem is used, if it doesn't exist then the content URL is used. aMediaList is then search by content and then origin URL

Parameters
aItemThe item to find matches for
aMediaListThe list to search in, can be a library
Returns
The media items found, or empty array. aCopies may be null in which case the function will return NS_ERROR_NOT_AVAILABLE if no copies are found

Definition at line 216 of file sbLibraryUtils.cpp.

Here is the call graph for this function:

nsresult sbLibraryUtils::FindOriginalsByID ( sbIMediaItem aMediaItem,
sbIMediaList aList,
nsIMutableArray *  aCopies 
)
static

Searches aList for items that have ID's that match aMediaItem's origin ID

Parameters
aItemThe item to find a match for
aLibraryThe library to look in
Returns
The media items found, or empty array. aCopies may be null in which case the function will return NS_ERROR_NOT_AVAILABLE if no copies are found

Searches aList for items that have ID's that match aMediaItem's origin ID

Parameters
aItemThe item to find a match for
aLibraryThe library to look in
Returns
The media items found, or null

Definition at line 345 of file sbLibraryUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbLibraryUtils::GetContentLength ( sbIMediaItem aItem,
PRInt64 *  _retval = nsnull 
)
static

Attempt to get the content length of the media item. If the content length property is not set, attempt to determine the content legnth from the content source and update the content length property.

Parameters
aItemThe item to look up
Returns
The content length of the item (or throw an exception)

Definition at line 385 of file sbLibraryUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbLibraryUtils::GetContentURI ( nsIURI *  aURI,
nsIURI **  _retval,
nsIIOService *  aIOService = nsnull 
)
static

Return a library content URI for the URI specified by aURI. A library content URI is a specially formatted URI for use within Songbird libraries and is formatted to facilitate searching for equivalent URI's (e.g., "file:" URI's are all lower case on Windows). URI's provided to createMediaItem and related methods must be library content URI's.

Parameters
aURIURI for which to get content URI.
aIOServiceOptional IO service object
Returns
Library content URI.

Definition at line 512 of file sbLibraryUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbLibraryUtils::GetEqualOperator ( sbIPropertyOperator **  aOperator)
static

Returns the equality operator for the content property

Returns
The equal operator

Returns the equality operator for the content property

Definition at line 814 of file sbLibraryUtils.cpp.

Here is the caller graph for this function:

nsresult sbLibraryUtils::GetFileContentURI ( nsIFile *  aFile,
nsIURI **  _retval 
)
static

Return a library content URI for the file specified by aFile. Special processing is required to convert an nsIFile to a library content URI (see bug 6227). getFileContentURI must be used instead of nsIIOService.newFileURI for generating library content URI's.

Parameters
aFileFile for which to get content URI.
Returns
Library content URI.

Definition at line 617 of file sbLibraryUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbLibraryUtils::GetItemInLibrary ( sbIMediaItem aItem,
sbILibrary aLibrary,
sbIMediaItem **  _retval 
)
static

Given an item and a library, attempt to locate a matching item in the library. Returns null (and success) if not found.

Parameters
aItemThe item to find; not necessarily owned by aLibrary
aLibraryThe library to look in
Returns
The found item, or null

Definition at line 171 of file sbLibraryUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbLibraryUtils::GetItemsByProperty ( sbIMediaList aMediaList,
nsAString const &  aPropertyName,
nsAString const &  aValue,
nsCOMArray< sbIMediaItem > &  aMediaItems 
)
static

Definition at line 690 of file sbLibraryUtils.cpp.

Here is the caller graph for this function:

nsresult sbLibraryUtils::GetMediaListByContentType ( sbILibrary aLibrary,
PRUint32  aContentType,
nsIArray **  aMediaLists 
)
static

Returns the media lists matching the content type

Parameters
aLibrarythe library to look for playlists
aContentTypeThe content type to filter by
aMediaListsthe returned collection of media lists

Definition at line 775 of file sbLibraryUtils.cpp.

nsresult sbLibraryUtils::GetMediaListContentType ( sbIMediaList aMediaList,
PRUint16 *  aListContentType 
)
static

Return a media list content type.

Parameters
aMediaListMedia list for while to get the content type.
Returns
Media list content type.

Definition at line 594 of file sbLibraryUtils.cpp.

nsresult sbLibraryUtils::GetOriginItem ( sbIMediaItem aItem,
sbIMediaItem **  _retval 
)
static

Return the origin media item for the media item specified by aItem.

Parameters
aItemThe item for which to get the origin media item.
Returns
The origin media item.

Definition at line 470 of file sbLibraryUtils.cpp.

Here is the caller graph for this function:

nsresult sbLibraryUtils::LinkCopy ( sbIMediaItem aOriginal,
sbIMediaItem aCopy 
)
static

Links a copy to its original. It will take into account the libraries the items belong to. It will only link from main library to non-main library. And if necessary if the copy is in the main library it will link the original to the copy.

Parameters
aOriginalThe original to link aCopy to
aCopyThe copy to be linked

Definition at line 907 of file sbLibraryUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbLibraryUtils::SetContentLength ( sbIMediaItem aItem,
nsIURI *  aURI 
)
static

Set the content length of the media item

Parameters
aItemThe item to set the content length to
aURIThe URI to retrive the content length from

Definition at line 441 of file sbLibraryUtils.cpp.

nsresult sbLibraryUtils::SuggestUniqueNameForPlaylist ( sbILibrary aLibrary,
nsAString const &  aListName,
nsAString &  aName 
)
static

Suggest a unique name for playlist.

Parameters
aLibraryan sbILibrary.
aListNamethe playlist name to append id to.
Returns
a unique playlist name.

Suggest a unique name for playlist.

Definition at line 841 of file sbLibraryUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: