sbIDevice Interface Reference

import"sbIDevice.idl";

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

Public Member Functions

void connect ()
 
void disconnect ()
 
nsIVariant getPreference (in AString aPrefName)
 
void setPreference (in AString aPrefName, in nsIVariant aPrefValue)
 
void submitRequest (in unsigned long aRequest, in nsIPropertyBag2 aRequestParameters)
 
void cancelRequests ()
 
void syncLibraries ()
 
void supportsMediaItem (in sbIMediaItem aMediaItem, in sbIDeviceSupportsItemCallback aCallback)
 
void eject ()
 
void format ()
 
void setWarningDialogEnabled (in AString aWarning, in boolean aEnabled)
 
boolean getWarningDialogEnabled (in AString aWarning)
 
void resetWarningDialogs ()
 
nsIInputStream openInputStream (in nsIURI aURI)
 Open an input stream for the URI specified by aURI. The URI may be a generic device URI of the form "x-device:///<device-guid>/<device-library-guid>/path/to/file". Such URI's specify the target device with <device-guid> and the storage volume using the volume's device library with the guid <device-library-guid>. Different device types may also accept device type specific URI's. More...
 
void importFromDevice (in sbILibrary aImportToLibrary, in sbILibraryChangeset aImportChangeset)
 
void exportToDevice (in sbIDeviceLibrary aDevLibrary, in sbILibraryChangeset aExportChangeset)
 

Public Attributes

readonly attribute AString name
 
readonly attribute AString productName
 
readonly attribute nsIDPtr controllerId
 
readonly attribute nsIDPtr id
 
readonly attribute boolean connected
 
readonly attribute boolean threaded
 
readonly attribute
sbIDeviceCapabilities 
capabilities
 
readonly attribute sbIDeviceContent content
 
attribute sbIDeviceLibrary defaultLibrary
 
readonly attribute sbIDeviceLibrary primaryLibrary
 
readonly attribute nsIPropertyBag2 parameters
 
readonly attribute
sbIDeviceProperties 
properties
 
readonly attribute boolean isDirectTranscoding
 
readonly attribute boolean isBusy
 
readonly attribute boolean canDisconnect
 
readonly attribute sbIDeviceStatus currentStatus
 
readonly attribute boolean supportsReformat
 
attribute unsigned long state
 
readonly attribute unsigned long previousState
 
const unsigned long STATE_IDLE = 0
 
const unsigned long STATE_SYNCING = 1
 
const unsigned long STATE_COPYING = 2
 
const unsigned long STATE_DELETING = 3
 
const unsigned long STATE_UPDATING = 4
 
const unsigned long STATE_MOUNTING = 5
 
const unsigned long STATE_DOWNLOADING = 6
 
const unsigned long STATE_UPLOADING = 7
 
const unsigned long STATE_DOWNLOAD_PAUSED = 8
 
const unsigned long STATE_UPLOAD_PAUSED = 9
 
const unsigned long STATE_DISCONNECTED = 10
 
const unsigned long STATE_BUSY = 11
 
const unsigned long STATE_CANCEL = 12
 
const unsigned long STATE_TRANSCODE = 13
 
const unsigned long STATE_FORMATTING = 14
 
const unsigned long STATE_SYNC_PREPARING = 15
 
const unsigned long STATE_SYNC_PLAYLIST = 16
 
const unsigned long STATE_COPY_PREPARING = 17
 
const unsigned long STATE_SYNCING_TYPE = 18
 
const unsigned long STATE_COPYING_MUSIC = 19
 
const unsigned long STATE_COPYING_VIDEO = 20
 
const unsigned long STATE_IMAGESYNC_PREPARING = 21
 
const unsigned long STATE_COPYING_IMAGE = 22
 
const unsigned long STATE_USER = 0x20000000
 
const unsigned long REQUEST_FLAG_USER = 0x80000000
 
const unsigned long REQUEST_FLAG_WRITE = 0x40000000
 
const unsigned long REQUEST_FLAG_READ = 0x20000000
 
const unsigned long REQUEST_MOUNT = REQUEST_FLAG_READ + 1
 
const unsigned long REQUEST_READ = REQUEST_FLAG_READ + 2
 
const unsigned long REQUEST_EJECT = REQUEST_FLAG_READ + 3
 
const unsigned long REQUEST_SUSPEND = REQUEST_FLAG_READ + 4
 
const unsigned long REQUEST_WRITE = REQUEST_FLAG_WRITE + 1
 
const unsigned long REQUEST_DELETE = REQUEST_FLAG_WRITE + 2
 
const unsigned long REQUEST_SYNC = REQUEST_FLAG_WRITE + 3
 
const unsigned long REQUEST_WIPE = REQUEST_FLAG_WRITE + 4
 
const unsigned long REQUEST_MOVE = REQUEST_FLAG_WRITE + 5
 
const unsigned long REQUEST_UPDATE = REQUEST_FLAG_WRITE + 6
 
const unsigned long REQUEST_NEW_PLAYLIST = REQUEST_FLAG_WRITE + 7
 
const unsigned long REQUEST_FACTORY_RESET = REQUEST_FLAG_WRITE + 8
 
const unsigned long REQUEST_FORMAT = REQUEST_FLAG_WRITE + 9
 
const unsigned long REQUEST_IMAGESYNC = REQUEST_FLAG_WRITE + 10
 
const unsigned long REQUEST_WRITE_FILE = REQUEST_FLAG_WRITE + 11
 
const unsigned long REQUEST_DELETE_FILE = REQUEST_FLAG_WRITE + 12
 
const unsigned long REQUEST_SYNC_COMPLETE = REQUEST_FLAG_WRITE + 13
 

Detailed Description

Note
Implementations of this interface must be threadsafe.

The main interface to all device objects

Definition at line 80 of file sbIDevice.idl.

Member Function Documentation

void sbIDevice::cancelRequests ( )

Cancel all current pending requests

void sbIDevice::connect ( )

Called when the device should initialize.

void sbIDevice::disconnect ( )

Called when the device is to finalize.

Device implementations must call sbIDeviceContent::Finalize

void sbIDevice::eject ( )

Eject device.

Here is the caller graph for this function:

void sbIDevice::exportToDevice ( in sbIDeviceLibrary  aDevLibrary,
in sbILibraryChangeset  aExportChangeset 
)

Exports the changes to a device as specified in aExportChangeset

Parameters
aDevLibraryThe device library of the device to export changes to
aExportChangesetThe changes to export
void sbIDevice::format ( )

Format device.

nsIVariant sbIDevice::getPreference ( in AString  aPrefName)

Get a preference stored on the device.

boolean sbIDevice::getWarningDialogEnabled ( in AString  aWarning)
void sbIDevice::importFromDevice ( in sbILibrary  aImportToLibrary,
in sbILibraryChangeset  aImportChangeset 
)

Imports changes from the device as specified in aImportChangeset

Parameters
aImportToLibraryThe library to import the changes to
aImportChangesetThe changes that are to be imported
nsIInputStream sbIDevice::openInputStream ( in nsIURI  aURI)

Open an input stream for the URI specified by aURI. The URI may be a generic device URI of the form "x-device:///<device-guid>/<device-library-guid>/path/to/file". Such URI's specify the target device with <device-guid> and the storage volume using the volume's device library with the guid <device-library-guid>. Different device types may also accept device type specific URI's.

Parameters
aURIURI for which to open input stream.
Returns
Opened input stream.
Exceptions
NS_ERROR_NOT_AVAILABLENo file exists for URI.
void sbIDevice::resetWarningDialogs ( )
void sbIDevice::setPreference ( in AString  aPrefName,
in nsIVariant  aPrefValue 
)

Sets a preference stored on the device.

void sbIDevice::setWarningDialogEnabled ( in AString  aWarning,
in boolean  aEnabled 
)
void sbIDevice::submitRequest ( in unsigned long  aRequest,
in nsIPropertyBag2  aRequestParameters 
)
void sbIDevice::supportsMediaItem ( in sbIMediaItem  aMediaItem,
in sbIDeviceSupportsItemCallback  aCallback 
)

Can this media item be stored on this device?

A supported file is either a) natively supported, or b) transcodable into one, and is either a) not DRM protected, or b) is DRM protected and supported by the device

Parameters
aMediaItemthe item to check
aCallbackthe callback to report to
Note
This method is asynchronous; the callback will be invoked on the main thread.
void sbIDevice::syncLibraries ( )

Call sync() on all libraries attached to this device

Member Data Documentation

readonly attribute boolean sbIDevice::canDisconnect

Whether it is safe to disconnect the device, generally this is when it is not performing a critical operation like copying a file to/from the device. This is also defined by the device as to what states determine the device can be disconnected. Usefull for when the user wants to shutdown the application.

Definition at line 189 of file sbIDevice.idl.

readonly attribute sbIDeviceCapabilities sbIDevice::capabilities

Get the capabilities of the device.

Definition at line 140 of file sbIDevice.idl.

readonly attribute boolean sbIDevice::connected

Whether or not the device is currently connected.

Definition at line 118 of file sbIDevice.idl.

readonly attribute sbIDeviceContent sbIDevice::content

All the device's content.

Definition at line 145 of file sbIDevice.idl.

readonly attribute nsIDPtr sbIDevice::controllerId

The id of the controller that created the device.

Definition at line 96 of file sbIDevice.idl.

readonly attribute sbIDeviceStatus sbIDevice::currentStatus

A more detailed state of the device, with information on what item/list it is currently being worked on and includes possible substates for more complicated states.

See Also
sbIDeviceStatus

Definition at line 197 of file sbIDevice.idl.

attribute sbIDeviceLibrary sbIDevice::defaultLibrary

The default library to use for device operations when no library is specified.

Definition at line 151 of file sbIDevice.idl.

readonly attribute nsIDPtr sbIDevice::id

The id of the device

Definition at line 101 of file sbIDevice.idl.

readonly attribute boolean sbIDevice::isBusy

Whether the device is currently performing a busy operation, like copying or deleting. This is defined by the device as to what states determine the device is busy.

Definition at line 180 of file sbIDevice.idl.

readonly attribute boolean sbIDevice::isDirectTranscoding

Whether the media item is transcoded to the device directly.

Definition at line 173 of file sbIDevice.idl.

readonly attribute AString sbIDevice::name

A human-readable name identifying the device. Optional.

Definition at line 85 of file sbIDevice.idl.

readonly attribute nsIPropertyBag2 sbIDevice::parameters

The parameters with which the device was created

Definition at line 163 of file sbIDevice.idl.

readonly attribute unsigned long sbIDevice::previousState

Definition at line 218 of file sbIDevice.idl.

readonly attribute sbIDeviceLibrary sbIDevice::primaryLibrary

The library representing the primary device storage volume. This is the volume that stores device configuration and information (e.g., device icon, .SBSettings.xml file).

Definition at line 158 of file sbIDevice.idl.

readonly attribute AString sbIDevice::productName

A human-readable name identifying the device product (e.g., vendor and model number). Optional.

Definition at line 91 of file sbIDevice.idl.

readonly attribute sbIDeviceProperties sbIDevice::properties

The device's properties.

Definition at line 168 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_DELETE = REQUEST_FLAG_WRITE + 2

Definition at line 264 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_DELETE_FILE = REQUEST_FLAG_WRITE + 12

Definition at line 284 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_EJECT = REQUEST_FLAG_READ + 3

Definition at line 259 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_FACTORY_RESET = REQUEST_FLAG_WRITE + 8

Definition at line 274 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_FLAG_READ = 0x20000000

Definition at line 254 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_FLAG_USER = 0x80000000

Requests below 0x2000000 are reserved by the sbRequestThreadQueue for internal use

Definition at line 252 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_FLAG_WRITE = 0x40000000

Definition at line 253 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_FORMAT = REQUEST_FLAG_WRITE + 9

Definition at line 277 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_IMAGESYNC = REQUEST_FLAG_WRITE + 10

Definition at line 280 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_MOUNT = REQUEST_FLAG_READ + 1

Definition at line 257 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_MOVE = REQUEST_FLAG_WRITE + 5

Definition at line 269 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_NEW_PLAYLIST = REQUEST_FLAG_WRITE + 7

Definition at line 271 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_READ = REQUEST_FLAG_READ + 2

Definition at line 258 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_SUSPEND = REQUEST_FLAG_READ + 4

Definition at line 260 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_SYNC = REQUEST_FLAG_WRITE + 3

Definition at line 265 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_SYNC_COMPLETE = REQUEST_FLAG_WRITE + 13

Definition at line 287 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_UPDATE = REQUEST_FLAG_WRITE + 6

Definition at line 270 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_WIPE = REQUEST_FLAG_WRITE + 4

Definition at line 267 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_WRITE = REQUEST_FLAG_WRITE + 1

Definition at line 263 of file sbIDevice.idl.

const unsigned long sbIDevice::REQUEST_WRITE_FILE = REQUEST_FLAG_WRITE + 11

Definition at line 283 of file sbIDevice.idl.

attribute unsigned long sbIDevice::state

Whether the device is busy, idle, syncing, mounting, etc.

The state attribute is RW so that the sbDeviceRequestThreadQueue can manage the device's state appropriately should a request be cancelled. Careful consideration should be made before writing to the device's state in other areas.

See Also
sbIDeviceEvent::EVENT_DEVICE_MEDIA_READ_*
sbIDeviceEvent::EVENT_DEVICE_MEDIA_WRITE_*
STATE_*

Definition at line 217 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_BUSY = 11

Definition at line 232 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_CANCEL = 12

Definition at line 234 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_COPY_PREPARING = 17

Definition at line 239 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_COPYING = 2

Definition at line 223 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_COPYING_IMAGE = 22

Definition at line 244 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_COPYING_MUSIC = 19

Definition at line 241 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_COPYING_VIDEO = 20

Definition at line 242 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_DELETING = 3

Definition at line 224 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_DISCONNECTED = 10

Definition at line 231 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_DOWNLOAD_PAUSED = 8

Definition at line 229 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_DOWNLOADING = 6

Definition at line 227 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_FORMATTING = 14

Definition at line 236 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_IDLE = 0

Definition at line 220 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_IMAGESYNC_PREPARING = 21

Definition at line 243 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_MOUNTING = 5

Definition at line 226 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_SYNC_PLAYLIST = 16

Definition at line 238 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_SYNC_PREPARING = 15

Definition at line 237 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_SYNCING = 1

Definition at line 221 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_SYNCING_TYPE = 18

Definition at line 240 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_TRANSCODE = 13

Definition at line 235 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_UPDATING = 4

Definition at line 225 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_UPLOAD_PAUSED = 9

Definition at line 230 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_UPLOADING = 7

Definition at line 228 of file sbIDevice.idl.

const unsigned long sbIDevice::STATE_USER = 0x20000000

Definition at line 246 of file sbIDevice.idl.

readonly attribute boolean sbIDevice::supportsReformat

Does the implementation of this sbIDevice provide support for reformatting the current device?

Definition at line 203 of file sbIDevice.idl.

readonly attribute boolean sbIDevice::threaded

Whether or not the device's events are being processed in additional threads (i.e. off the main UI thread).

Definition at line 124 of file sbIDevice.idl.


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