sbDownloadDevice Class Reference

#include <DownloadDevice.h>

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

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
NS_DECL_SBIDEVICEBASE
NS_DECL_SBIDOWNLOADDEVICE
NS_DECL_SBIMEDIALISTLISTENER 
sbDownloadDevice ()
 
virtual ~sbDownloadDevice ()
 
- Public Member Functions inherited from sbIDownloadDevice
void clearCompletedItems ()
 Clear all completed items from download device. More...
 
- Public Member Functions inherited from sbIDeviceBase
void initialize ()
 Initialize the device category handler. More...
 
void finalize ()
 Finalize usage of the device category handler. More...
 
void addCallback (in sbIDeviceBaseCallback aCallback)
 Add a device category handler callback. More...
 
void removeCallback (in sbIDeviceBaseCallback aCallback)
 Remove a device category handler callback. More...
 
sbILibrary getLibrary (in AString aDeviceIdentifier)
 Get the device library representing the content available on the device. More...
 
unsigned long getDeviceState (in AString aDeviceIdentifier)
 Get the device's current state. More...
 
nsIURI getTransferLocation (in AString aDeviceIdentifier, in sbIMediaItem aMediaItem)
 Get preferred transfer location for item. More...
 
unsigned long transferItems (in AString aDeviceIdentifier, in nsIArray aMediaItems, in nsIURI aDestionationPath, in unsigned long aDeviceOperation, in boolean aBeginTransferNow, in sbILibrary aDestinationLibrary)
 Transfer items to a library or destination. More...
 
unsigned long updateItems (in AString aDeviceIdentifier, in nsIArray aMediaItems)
 Update items on the device. More...
 
unsigned long deleteItems (in AString aDeviceIdentifier, in nsIArray aMediaItems)
 Delete items from the device. More...
 
unsigned long deleteAllItems (in AString aDeviceIdentifier)
 
unsigned long createPlaylists (in AString aDeviceIdentifier, in nsIArray aMediaLists)
 
unsigned long deletePlaylists (in AString aDeviceIdentifier, in nsIArray aMediaLists)
 
unsigned long addToPlaylist (in AString aDeviceIdentifier, in sbIMediaList aMediaList, in nsIArray aMediaItems, in unsigned long aBeforeIndex)
 
unsigned long removeFromPlaylist (in AString aDeviceIdentifier, in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in unsigned long aIndex)
 
unsigned long movePlaylistItem (in AString aDeviceIdentifier, in sbIMediaList aMediaList, in unsigned long aFromIndex, in unsigned long aToIndex)
 
unsigned long clearPlaylist (in AString aDeviceIdentifier, in sbIMediaList aMediaList)
 
sbIMediaItem beginTransfer (in AString aDeviceIdentifier)
 Begin transfer operations. More...
 
unsigned long cancelTransfer (in AString aDeviceIdentifier, in nsIArray aMediaItems)
 Cancel a transfer by removing it from the queue. More...
 
unsigned long suspendTransfer (in AString aDeviceIdentifier)
 Suspend all transfers. More...
 
unsigned long resumeTransfer (in AString aDeviceIdentifier)
 Resume pending transfers. More...
 
long long getUsedSpace (in AString aDeviceIdentifier)
 Get the amount of used space from a device. More...
 
long long getAvailableSpace (in AString aDeviceIdentifier)
 Get the amount of available space from a device. More...
 
nsIArray getSupportedFormats (in AString aDeviceIdentifier)
 Returns a list of file extensions representing the formats supported by a specific device. More...
 
boolean isDownloadSupported (in AString aDeviceIdentifier)
 Download is to copy a track from the device to the host. More...
 
boolean isUploadSupported (in AString aDeviceIdentifier)
 Is uploading supported on this device? More...
 
boolean isDeleteSupported (in AString aDeviceIdentifier)
 Is it possible to delete items from the device? More...
 
boolean isUpdateSupported (in AString aDeviceIdentifier)
 Is it possible to update items directly on the device? More...
 
boolean isEjectSupported (in AString aDeviceIdentifier)
 Is eject or unmount supported by the device?. More...
 
boolean ejectDevice (in AString aDeviceIdentifier)
 Eject or unmount the device from the system. More...
 
- Public Member Functions inherited from sbDeviceBase
 sbDeviceBase ()
 
virtual ~sbDeviceBase ()
 
nsresult Init ()
 Initialize the base device class for use. More...
 
nsresult CreateDeviceLibrary (const nsAString &aDeviceIdentifier, nsIURI *aDeviceDatabaseURI, sbIDeviceBase *aDevice)
 Create a library for a device instance. More...
 
nsresult RemoveDeviceLibrary (const nsAString &aDeviceIdentifier)
 Remove a library for a device instance. More...
 
nsresult GetLibraryForDevice (const nsAString &aDeviceIdentifier, sbILibrary **aDeviceLibrary)
 Get the library instance for a device. More...
 
nsresult RegisterDeviceLibrary (sbILibrary *aDeviceLibrary)
 Register a device library with the library manager. More...
 
nsresult UnregisterDeviceLibrary (sbILibrary *aDeviceLibrary)
 Unregister a device library with the library manager. More...
 
nsresult CreateTransferQueue (const nsAString &aDeviceIdentifier)
 Create an internal transfer queue for a device instance. More...
 
nsresult RemoveTransferQueue (const nsAString &aDeviceIdentifier)
 Remove an internal transfer queue for a device instance. More...
 
nsresult AddItemToTransferQueue (const nsAString &aDeviceIdentifier, sbIMediaItem *aMediaItem)
 Add an item to the internal transfer queue. More...
 
nsresult RemoveItemFromTransferQueue (const nsAString &aDeviceIdentifier, sbIMediaItem *aMediaItem)
 Remove an item from the internal transfer queue. More...
 
nsresult GetNextItemFromTransferQueue (const nsAString &aDeviceIdentifier, sbIMediaItem **aMediaItem)
 Get the next item in the transfer queue. More...
 
nsresult GetItemByIndexFromTransferQueue (const nsAString &aDeviceIdentifier, PRUint32 aItemIndex, sbIMediaItem **aMediaItem)
 Get an item from the transfer queue by index. More...
 
nsresult GetTransferQueue (const nsAString &aDeviceIdentifier, nsIMutableArray **aTransferQueue)
 Get the internnal transfer queue for a device instance. More...
 
nsresult ClearTransferQueue (const nsAString &aDeviceIdentifier)
 Clear the entire transfer queue. More...
 
nsresult IsTransferQueueEmpty (const nsAString &aDeviceIdentifier, PRBool &aEmpty)
 
nsresult AddCallback (sbIDeviceBaseCallback *aCallback)
 
nsresult RemoveCallback (sbIDeviceBaseCallback *aCallback)
 
void DoTransferStartCallback (sbIMediaItem *aMediaItem)
 
void DoTransferCompleteCallback (sbIMediaItem *aMediaItem, PRInt32 aStatus)
 
void DoDeviceConnectCallback (const nsAString &aDeviceIdentifier)
 
void DoDeviceDisconnectCallback (const nsAString &aDeviceIdentifier)
 
void DoStateChangedCallback (const nsAString &aDeviceIdentifier, PRUint32 aState)
 
nsresult GetDeviceState (const nsAString &aDeviceIdentifier, PRUint32 *aDeviceState)
 
nsresult SetDeviceState (const nsAString &aDeviceIdentifier, PRUint32 aDeviceState)
 
nsresult InitDeviceState (const nsAString &aDeviceIdentifier)
 
nsresult ClearDeviceState (const nsAString &aDeviceIdentifier)
 
nsresult SetListenerForDeviceLibrary (const nsAString &aDeviceIdentifier, sbIMediaListListener *aMediaListListener)
 
nsresult GetListenerForDeviceLibrary (const nsAString &aDeviceIdentifier, sbIMediaListListener **aMediaListListener)
 
nsresult RemoveListenerForDeviceLibrary (const nsAString &aDeviceIdentifier)
 
- Public Member Functions inherited from sbIMediaListListener
boolean onItemAdded (in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in unsigned long aIndex)
 Called when a media item is added to the list. More...
 
boolean onBeforeItemRemoved (in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in unsigned long aIndex)
 Called before a media item is removed from the list. More...
 
boolean onAfterItemRemoved (in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in unsigned long aIndex)
 Called after a media item is removed from the list. More...
 
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...
 
boolean onBeforeListCleared (in sbIMediaList aMediaList, in boolean aExcludeLists)
 
boolean onListCleared (in sbIMediaList aMediaList, in boolean aExcludeLists)
 
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...
 

Friends

class sbDownloadSession
 

Additional Inherited Members

- Public Attributes inherited from sbIDownloadDevice
readonly attribute sbIMediaList downloadMediaList
 The media list containing items for download. More...
 
readonly attribute unsigned long completedItemCount
 The number of completed download items. More...
 
- Public Attributes inherited from sbIDeviceBase
const PRUint32 FILE_FORMAT_UNDEFINED = 9999
 
const PRUint32 FILE_FORMAT_WAV = 0
 
const PRUint32 FILE_FORMAT_MP3 = 1
 
const PRUint32 FILE_FORMAT_WMA = 2
 
const PRUint32 STATE_IDLE = 0
 
const PRUint32 STATE_BUSY = 1
 
const PRUint32 STATE_DOWNLOADING = 2
 
const PRUint32 STATE_UPLOADING = 3
 
const PRUint32 STATE_DOWNLOAD_PAUSED = 4
 
const PRUint32 STATE_UPLOAD_PAUSED = 5
 
const PRUint32 STATE_DELETING = 6
 
const unsigned long OP_UPLOAD = 1
 Device Operation Constants. More...
 
const unsigned long OP_DOWNLOAD = 2
 
const unsigned long OP_MOVE = 3
 
attribute AString name
 The name of the device category handler. More...
 
readonly attribute AString deviceCategory
 Device category name for this class of devices. More...
 
readonly attribute
nsIStringEnumerator 
deviceIdentifiers
 Contains nsISupportsStrings representing the device unique identifiers for all connected devices of this category. More...
 
readonly attribute unsigned long deviceCount
 Get the number of devices currently connected. More...
 
- Protected Attributes inherited from sbDeviceBase
nsInterfaceHashtableMT
< nsStringHashKey, sbILibrary
mDeviceLibraries
 
nsInterfaceHashtableMT
< nsStringHashKey,
nsIMutableArray > 
mDeviceQueues
 
nsRefPtrHashtableMT
< nsISupportsHashKey,
sbDeviceBaseCallbackProxy
mDeviceCallbacks
 
nsDataHashtableMT
< nsStringHashKey, PRUint32 > 
mDeviceStates
 
nsInterfaceHashtableMT
< nsStringHashKey,
sbIMediaListListener
mDeviceLibraryListeners
 

Detailed Description

Definition at line 110 of file DownloadDevice.h.

Constructor & Destructor Documentation

NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER NS_DECL_SBIDEVICEBASE NS_DECL_SBIDOWNLOADDEVICE NS_DECL_SBIMEDIALISTLISTENER sbDownloadDevice::sbDownloadDevice ( )
sbDownloadDevice::~sbDownloadDevice ( )
virtual

Definition at line 527 of file DownloadDevice.cpp.

Friends And Related Function Documentation

friend class sbDownloadSession
friend

Definition at line 121 of file DownloadDevice.h.


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