sbIDeviceLibraryListener Interface Reference

Interface used to listen to changes to a device library. More...

import"sbIDeviceLibrary.idl";

Inheritance diagram for sbIDeviceLibraryListener:
[legend]
Collaboration diagram for sbIDeviceLibraryListener:
[legend]

Public Member Functions

void onBatchBegin (in sbIMediaList aMediaList)
 Called when the library is about to perform multiple operations at once. More...
 
void onBatchEnd (in sbIMediaList aMediaList)
 Called when the library has finished performing multiple operations at once. More...
 
boolean onItemAdded (in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in unsigned long aIndex)
 Called when a media item is added to a list, through add or addAll. More...
 
boolean onBeforeItemRemoved (in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in unsigned long aIndex)
 Called before a media item is removed from a list, through remove, removeAll or removeByIndex. More...
 
boolean onAfterItemRemoved (in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in unsigned long aIndex)
 Called after a media item has been removed from a list, through remove, removeAll or removeByIndex. More...
 
boolean onBeforeListCleared (in sbIMediaList aMediaList, in boolean aExcludeLists)
 
boolean onListCleared (in sbIMediaList aMediaList, in boolean aExcludeLists)
 
boolean onItemUpdated (in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in sbIPropertyArray aProperties)
 Called when a media item is changed. More...
 
boolean onItemMoved (in sbIMediaList aMediaList, in unsigned long aFromIndex, in unsigned long aToIndex)
 Called when a media item is moved. More...
 
void onItemCopied (in sbIMediaItem aSourceItem, in sbIMediaItem aDestItem)
 Called when a media item has been copied. More...
 
boolean onBeforeCreateMediaItem (in nsIURI aContentUri, [optional] in sbIPropertyArray aProperties, [optional] in boolean aAllowDuplicates)
 Called before a media item is going to be created. More...
 
boolean onBeforeCreateMediaList (in AString aType, [optional] in sbIPropertyArray aProperties)
 Called before a media list is going to be created. More...
 
boolean onBeforeAdd (in sbIMediaItem aMediaItem)
 Called before an item is added. More...
 
boolean onBeforeAddAll (in sbIMediaList aMediaList)
 Called before all item from a list are added. More...
 
boolean onBeforeAddSome (in nsISimpleEnumerator aMediaItems)
 Called before some items are added. More...
 
boolean onBeforeClear ()
 Called before the device is cleared. More...
 

Detailed Description

Interface used to listen to changes to a device library.

Note
Implementations of this interface must be threadsafe.
See Also
sbIDeviceLibrary

Definition at line 46 of file sbIDeviceLibrary.idl.

Member Function Documentation

boolean sbIDeviceLibraryListener::onAfterItemRemoved ( in sbIMediaList  aMediaList,
in sbIMediaItem  aMediaItem,
in unsigned long  aIndex 
)

Called after a media item has been removed from a list, through remove, removeAll or removeByIndex.

Parameters
sbIMediaListaMediaList The list that has changed.
sbIMediaItemaMediaItem The removed media item.
unsignedlong aIndex The index of the removed item
Returns
True if you do not want any further onItemRemoved for the current batch. If there is no current batch, the return value is ignored.
void sbIDeviceLibraryListener::onBatchBegin ( in sbIMediaList  aMediaList)

Called when the library is about to perform multiple operations at once.

This notification can be used to optimize behavior. The consumer may choose to ignore further notifications until the onBatchEnd notification is received.

Parameters
sbIMediaListaMediaList The list that has changed.
void sbIDeviceLibraryListener::onBatchEnd ( in sbIMediaList  aMediaList)

Called when the library has finished performing multiple operations at once.

This notification can be used to optimize behavior. The consumer may choose to stop ignoring notifications after receiving this notification.

Parameters
sbIMediaListaMediaList The list that has changed.
boolean sbIDeviceLibraryListener::onBeforeAdd ( in sbIMediaItem  aMediaItem)

Called before an item is added.

See Also
sbIMediaList::Add
boolean sbIDeviceLibraryListener::onBeforeAddAll ( in sbIMediaList  aMediaList)

Called before all item from a list are added.

See Also
sbIMediaList::AddAll
boolean sbIDeviceLibraryListener::onBeforeAddSome ( in nsISimpleEnumerator  aMediaItems)

Called before some items are added.

See Also
sbIMediaList::AddSome
boolean sbIDeviceLibraryListener::onBeforeClear ( )

Called before the device is cleared.

See Also
sbIMediaList::Clear
boolean sbIDeviceLibraryListener::onBeforeCreateMediaItem ( in nsIURI  aContentUri,
[optional] in sbIPropertyArray  aProperties,
[optional] in boolean  aAllowDuplicates 
)

Called before a media item is going to be created.

These are listener functions that will get called before some actions take place, like adding, or creating items in the library.

See Also
sbILibrary::CreateMediaItem
boolean sbIDeviceLibraryListener::onBeforeCreateMediaList ( in AString  aType,
[optional] in sbIPropertyArray  aProperties 
)

Called before a media list is going to be created.

See Also
sbILibrary::CreateMediaList
boolean sbIDeviceLibraryListener::onBeforeItemRemoved ( in sbIMediaList  aMediaList,
in sbIMediaItem  aMediaItem,
in unsigned long  aIndex 
)

Called before a media item is removed from a list, through remove, removeAll or removeByIndex.

Parameters
sbIMediaListsbIMediaList aMediaList The list that has changed.
sbIMediaItemsbIMediaItem aMediaItem The removed media item.
unsignedlong aIndex The index of the item to be removed
Returns
True if you do not want any further onItemRemoved for the current batch. If there is no current batch, the return value is ignored.
boolean sbIDeviceLibraryListener::onBeforeListCleared ( in sbIMediaList  aMediaList,
in boolean  aExcludeLists 
)

Called before a media list is cleared.

Parameters
sbIMediaListaMediaList The list that is about to be cleared.
aExcludeListsIf true, only media items, not media lists, are being cleared.
Returns
True if you do not want any further onBeforeListCleared notifications for the current batch. If there is no current batch, the return value is ignored.
boolean sbIDeviceLibraryListener::onItemAdded ( in sbIMediaList  aMediaList,
in sbIMediaItem  aMediaItem,
in unsigned long  aIndex 
)

Called when a media item is added to a list, through add or addAll.

Listener functions for media list changes (sbIMediaList)

Parameters
sbIMediaListaMediaList The list that has changed.
sbIMediaItemaMediaItem The new media item.
unsignedlong aIndex The index of the new media item
Returns
True if you do not want any further onItemAdded notifications for the current batch. If there is no current batch, the return value is ignored.
void sbIDeviceLibraryListener::onItemCopied ( in sbIMediaItem  aSourceItem,
in sbIMediaItem  aDestItem 
)

Called when a media item has been copied.

Parameters
sbIMediaItemaSourceItem The item that was copied from.
sbIMediaItemaDestItem The item that was copied to.
boolean sbIDeviceLibraryListener::onItemMoved ( in sbIMediaList  aMediaList,
in unsigned long  aFromIndex,
in unsigned long  aToIndex 
)

Called when a media item is moved.

Parameters
sbIMediaListaMediaList The list that contains the item that moved.
aFromIndexIndex of the item that was moved
aToIndexNew index of the moved item
Returns
True if you do not want any further onItemMoved notifications for the current batch. If there is no current batch, the return value is ignored.
boolean sbIDeviceLibraryListener::onItemUpdated ( in sbIMediaList  aMediaList,
in sbIMediaItem  aMediaItem,
in sbIPropertyArray  aProperties 
)

Called when a media item is changed.

Parameters
sbIMediaListaMediaList The list that has changed.
sbIMediaItemaMediaItem The item that has changed.
aPropertiesArray of properties that were updated. Each property's value is the previous value of the property
Returns
True if you do not want any further onItemUpdated notifications for the current batch. If there is no current batch, the return value is ignored.
boolean sbIDeviceLibraryListener::onListCleared ( in sbIMediaList  aMediaList,
in boolean  aExcludeLists 
)

Called when a media list is cleared.

Parameters
sbIMediaListaMediaList The list that was cleared.
aExcludeListsIf true, only media items, not media lists, were cleared.
Returns
True if you do not want any further onListCleared notifications for the current batch. If there is no current batch, the return value is ignored.

The documentation for this interface was generated from the following file: