#include <sbLocalDatabaseSimpleMediaList.h>
Public Member Functions | |
NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSICLASSINFO NS_DECL_SBILOCALDATABASESIMPLEMEDIALIST NS_DECL_SBIORDERABLEMEDIALIST | sbLocalDatabaseSimpleMediaList () |
virtual | ~sbLocalDatabaseSimpleMediaList () |
nsresult | Init (sbLocalDatabaseLibrary *aLibrary, const nsAString &aGuid) |
NS_IMETHOD | GetType (nsAString &aType) |
NS_IMETHOD | GetItemByGuid (const nsAString &aGuid, sbIMediaItem **_retval) |
NS_IMETHOD | Contains (sbIMediaItem *aMediaItem, PRBool *_retval) |
NS_IMETHOD | Add (sbIMediaItem *aMediaItem) |
NS_IMETHOD | AddItem (sbIMediaItem *aMediaItem, sbIMediaItem **aNewMediaItem) |
NS_IMETHOD | AddAll (sbIMediaList *aMediaList) |
NS_IMETHOD | AddSome (nsISimpleEnumerator *aMediaItems) |
NS_IMETHOD | AddMediaItems (nsISimpleEnumerator *aMediaItems, sbIAddMediaItemsListener *aListener, PRBool aAsync) |
NS_IMETHOD | Remove (sbIMediaItem *aMediaItem) |
NS_IMETHOD | RemoveByIndex (PRUint32 aIndex) |
NS_IMETHOD | RemoveSome (nsISimpleEnumerator *aMediaItems) |
NS_IMETHOD | Clear () |
NS_IMETHOD | CreateView (sbIMediaListViewState *aState, sbIMediaListView **_retval) |
NS_IMETHOD | GetDefaultSortProperty (nsAString &aProperty) |
nsresult | AddSomeAsyncInternal (nsISimpleEnumerator *aMediaItems, nsISupports *aListener, PRUint32 aStartingIndex, nsAString &aStartingOrdinal) |
Public Member Functions inherited from sbLocalDatabaseMediaListBase | |
NS_DECL_ISUPPORTS_INHERITED NS_DECL_SBIMEDIALIST | sbLocalDatabaseMediaListBase () |
virtual | ~sbLocalDatabaseMediaListBase () |
nsresult | Init (sbLocalDatabaseLibrary *aLibrary, const nsAString &aGuid, PRBool aOwnsLibrary=PR_TRUE) |
already_AddRefed < sbLocalDatabaseLibrary > | GetNativeLibrary () |
sbILocalDatabaseGUIDArray * | GetArray () |
nsresult | AddListener (sbIMediaListListener *aListener, PRBool aOwnsWeak=PR_FALSE, PRUint32 aFlags=0) |
void | SetCachedListContentType (PRUint16 aContentType) |
void | BeginUpdateBatch () |
void | EndUpdateBatch () |
Public Member Functions inherited from sbLocalDatabaseMediaItem | |
NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSICLASSINFO NS_DECL_SBILIBRARYRESOURCE NS_DECL_SBILOCALDATABASEMEDIAITEM NS_DECL_SBIMEDIAITEM | sbLocalDatabaseMediaItem () |
virtual | ~sbLocalDatabaseMediaItem () |
nsresult | Init (sbLocalDatabaseLibrary *aLibrary, const nsAString &aGuid, PRBool aOwnsLibrary=PR_TRUE) |
Initializes the media item. More... | |
Public Member Functions inherited from sbSupportsWeakReference | |
sbSupportsWeakReference () | |
Public Member Functions inherited from sbILocalDatabaseMediaItem | |
void | SetSuppressNotifications (in boolean aSuppress) |
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 Member Functions inherited from sbLocalDatabaseMediaListListener | |
sbLocalDatabaseMediaListListener () | |
virtual | ~sbLocalDatabaseMediaListListener () |
Public Member Functions inherited from sbIMediaList | |
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 sbILocalDatabaseSimpleMediaList | |
unsigned long | getIndexByOrdinal (in AString aOrdinal) |
Get the index of an item in this list by its ordinal. More... | |
void | invalidate (in boolean aInvalidateLength) |
Tell the list that its underlying datasource has changed. More... | |
void | notifyListenersItemUpdated (in sbIMediaItem aItem, in unsigned long aIndex, in sbIPropertyArray aProperties) |
Notify this simple media list's listeners that an item has been updated. More... | |
void | notifyListenersBeforeItemRemoved (in sbIMediaList aList, in sbIMediaItem aItem, in unsigned long aIndex) |
Notify this simple media list's listeners that an item is about to be removed. More... | |
void | notifyListenersAfterItemRemoved (in sbIMediaList aList, in sbIMediaItem aItem, in unsigned long aIndex) |
Notify this simple media list's listeners that an item has been removed. More... | |
void | notifyListenersBeforeListCleared (in sbIMediaList aList, in boolean aExcludeLists) |
Notify the simple media list's listeners that it has about to be cleared. More... | |
void | notifyListenersListCleared (in sbIMediaList aList, in boolean aExcludeLists) |
Notify the simple media list's listeners that it has been cleared. More... | |
void | notifyListenersBatchBegin (in sbIMediaList aList) |
Notify the simple media list's listeners that a batch has begun. More... | |
void | notifyListenersBatchEnd (in sbIMediaList aList) |
Notify the simple media list's listeners that a batch has ended. More... | |
void | notifyContentChanged () |
Notify the simple media list that its content was changed via an operation that bypassed listeners (ie, direct write to db) More... | |
Public Member Functions inherited from sbIOrderableMediaList | |
void | insertBefore (in unsigned long aIndex, in sbIMediaItem aMediaItem) |
Insert a media item before the specified media item. More... | |
void | insertAllBefore (in unsigned long aIndex, in sbIMediaList aMediaList) |
Insert a media list before the specified media item. More... | |
void | moveBefore (in unsigned long aFromIndex, in unsigned long aToIndex) |
Move a media item from one position to another in the list. More... | |
void | moveLast (in unsigned long aIndex) |
Move a media item to the end of the list. More... | |
void | insertSomeBefore (in unsigned long aIndex, in nsISimpleEnumerator aMediaItems) |
Insert many media items before the specified media item. More... | |
void | insertSomeBeforeAsync (in unsigned long aIndex, in nsISimpleEnumerator aMediaItems, in sbIMediaListAsyncListener aListener) |
Insert many media items before the specified media item asynchronously. More... | |
void | moveSomeBefore ([array, size_is(aFromIndexArrayCount)] in unsigned long aFromIndexArray, in unsigned long aFromIndexArrayCount, in unsigned long aToIndex) |
Move a list of media items from one position to another in the list. More... | |
void | moveSomeLast ([array, size_is(aIndexArrayCount)] in unsigned long aIndexArray, in unsigned long aIndexArrayCount) |
Move a list of media items to the end of the list. More... | |
Friends | |
class | sbSimpleMediaListInsertingEnumerationListener |
class | sbSimpleMediaListRemovingEnumerationListener |
Additional Inherited Members | |
Public Attributes inherited from sbILocalDatabaseMediaItem | |
readonly attribute unsigned long | mediaItemId |
attribute sbILocalDatabaseResourcePropertyBag | propertyBag |
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... | |
Public Attributes inherited from sbIMediaList | |
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 sbILocalDatabaseSimpleMediaList | |
attribute sbILocalDatabaseMediaListCopyListener | copyListener |
Protected Member Functions inherited from sbLocalDatabaseMediaListBase | |
nsresult | MakeStandardQuery (sbIDatabaseQuery **_retval) |
nsresult | GetFilteredPropertiesForNewItem (sbIPropertyArray *aProperties, sbIPropertyArray **_retval) |
nsresult | GetOriginProperties (sbIMediaItem *aSourceItem, sbIMutablePropertyArray *aProperties) |
void | SetArray (sbILocalDatabaseGUIDArray *aArray) |
Protected Member Functions inherited from sbSupportsWeakReference | |
~sbSupportsWeakReference () | |
void | ClearWeakReferences () |
PRBool | HasWeakReferences () const |
Protected Member Functions inherited from sbLocalDatabaseMediaListListener | |
nsresult | Init () |
nsresult | AddListener (sbLocalDatabaseMediaListBase *aList, sbIMediaListListener *aListener, PRBool aOwnsWeak=PR_FALSE, PRUint32 aFlags=sbIMediaList::LISTENER_FLAGS_ALL, sbIPropertyArray *aPropertyFilter=nsnull) |
nsresult | RemoveListener (sbLocalDatabaseMediaListBase *aList, sbIMediaListListener *aListener) |
PRUint32 | ListenerCount () |
void | NotifyListenersItemAdded (sbIMediaList *aList, sbIMediaItem *aItem, PRUint32 aIndex) |
Notifies all listeners that an item has been added to the list. More... | |
void | NotifyListenersBeforeItemRemoved (sbIMediaList *aList, sbIMediaItem *aItem, PRUint32 aIndex) |
Notifies all listeners that an item is about to be removed from the list. More... | |
void | NotifyListenersAfterItemRemoved (sbIMediaList *aList, sbIMediaItem *aItem, PRUint32 aIndex) |
Notifies all listeners that an item has been removed from the list. More... | |
void | NotifyListenersItemUpdated (sbIMediaList *aList, sbIMediaItem *aItem, sbIPropertyArray *aProperties) |
Notifies all listeners that an item has been updated. More... | |
void | NotifyListenersItemMoved (sbIMediaList *aList, PRUint32 aFromIndex, PRUint32 aToIndex) |
Notifies all listeners that an item has been moved. More... | |
void | NotifyListenersBeforeListCleared (sbIMediaList *aList, PRBool aExcludeLists) |
Notifies all listeners before the list has been cleared. More... | |
void | NotifyListenersListCleared (sbIMediaList *aList, PRBool aExcludeLists) |
Notifies all listeners that the list has been cleared. More... | |
void | NotifyListenersBatchBegin (sbIMediaList *aList) |
Notifies all listeners that multiple items are about to be changed. More... | |
void | NotifyListenersBatchEnd (sbIMediaList *aList) |
Notifies all listeners that multiple items have been changed. More... | |
Protected Attributes inherited from sbLocalDatabaseMediaListBase | |
PRMonitor * | mFullArrayMonitor |
PRUint16 | mListContentType |
PRBool | mLockedEnumerationActive |
nsTHashtable< nsStringHashKey > | mFilteredProperties |
Protected Attributes inherited from sbLocalDatabaseMediaItem | |
PRUint32 | mMediaItemId |
PRBool | mOwnsLibrary |
sbLocalDatabaseLibrary * | mLibrary |
nsString | mGuid |
PRBool | mSuppressNotifications |
nsCOMPtr< sbIMediaItemController > | mItemController |
PRBool | mItemControllerFetched |
Definition at line 51 of file sbLocalDatabaseSimpleMediaList.h.
sbLocalDatabaseSimpleMediaList::sbLocalDatabaseSimpleMediaList | ( | ) |
Definition at line 795 of file sbLocalDatabaseSimpleMediaList.cpp.
|
virtual |
Definition at line 806 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::Add | ( | sbIMediaItem * | aMediaItem | ) |
Definition at line 933 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::AddAll | ( | sbIMediaList * | aMediaList | ) |
Definition at line 976 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::AddItem | ( | sbIMediaItem * | aMediaItem, |
sbIMediaItem ** | aNewMediaItem | ||
) |
Definition at line 939 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::AddMediaItems | ( | nsISimpleEnumerator * | aMediaItems, |
sbIAddMediaItemsListener * | aListener, | ||
PRBool | aAsync | ||
) |
Definition at line 1041 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::AddSome | ( | nsISimpleEnumerator * | aMediaItems | ) |
Definition at line 1035 of file sbLocalDatabaseSimpleMediaList.cpp.
nsresult sbLocalDatabaseSimpleMediaList::AddSomeAsyncInternal | ( | nsISimpleEnumerator * | aMediaItems, |
nsISupports * | aListener, | ||
PRUint32 | aStartingIndex, | ||
nsAString & | aStartingOrdinal | ||
) |
Definition at line 1127 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::Clear | ( | void | ) |
Definition at line 1566 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::Contains | ( | sbIMediaItem * | aMediaItem, |
PRBool * | _retval | ||
) |
Definition at line 912 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::CreateView | ( | sbIMediaListViewState * | aState, |
sbIMediaListView ** | _retval | ||
) |
Definition at line 1661 of file sbLocalDatabaseSimpleMediaList.cpp.
|
virtual |
Implements sbLocalDatabaseMediaListBase.
Definition at line 2520 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::GetItemByGuid | ( | const nsAString & | aGuid, |
sbIMediaItem ** | _retval | ||
) |
Definition at line 887 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::GetType | ( | nsAString & | aType | ) |
Definition at line 880 of file sbLocalDatabaseSimpleMediaList.cpp.
nsresult sbLocalDatabaseSimpleMediaList::Init | ( | sbLocalDatabaseLibrary * | aLibrary, |
const nsAString & | aGuid | ||
) |
Definition at line 812 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::Remove | ( | sbIMediaItem * | aMediaItem | ) |
Definition at line 1459 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::RemoveByIndex | ( | PRUint32 | aIndex | ) |
Definition at line 1483 of file sbLocalDatabaseSimpleMediaList.cpp.
NS_IMETHODIMP sbLocalDatabaseSimpleMediaList::RemoveSome | ( | nsISimpleEnumerator * | aMediaItems | ) |
Definition at line 1531 of file sbLocalDatabaseSimpleMediaList.cpp.
|
friend |
Definition at line 56 of file sbLocalDatabaseSimpleMediaList.h.
|
friend |
Definition at line 57 of file sbLocalDatabaseSimpleMediaList.h.