sbIDeviceBase.idl
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25  */
26 
33 #include "nsISupports.idl"
34 
38 interface nsIArray;
39 interface nsIStringEnumerator;
40 interface nsIURI;
41 
42 interface sbILibrary;
43 interface sbIMediaItem;
44 interface sbIMediaList;
45 
53 [scriptable, uuid(c52a5f0f-fd6e-4f41-a681-3ed88c9e5a9f)]
55 {
63  void onDeviceConnect(in AString aDeviceIdentifier);
64 
72  void onDeviceDisconnect(in AString aDeviceIdentifier);
73 
81  void onTransferStart(in sbIMediaItem aMediaItem);
82 
91  void onTransferComplete(in sbIMediaItem aMediaItem,
92  in PRInt32 aStatus);
93 
100  void onStateChanged(in AString aDeviceIdentifier,
101  in unsigned long aState);
102 };
103 
104 
126 [scriptable, uuid(2964c3bf-18d6-4a72-8ccf-f08b732b4bab)]
128 {
137  const PRUint32 FILE_FORMAT_UNDEFINED = 9999;
138  const PRUint32 FILE_FORMAT_WAV = 0;
139  const PRUint32 FILE_FORMAT_MP3 = 1;
140  const PRUint32 FILE_FORMAT_WMA = 2;
141 
152  const PRUint32 STATE_IDLE = 0;
153  const PRUint32 STATE_BUSY = 1;
154  const PRUint32 STATE_DOWNLOADING = 2;
155  const PRUint32 STATE_UPLOADING = 3;
156  const PRUint32 STATE_DOWNLOAD_PAUSED = 4;
157  const PRUint32 STATE_UPLOAD_PAUSED = 5;
158  const PRUint32 STATE_DELETING = 6;
159 
164  const unsigned long OP_UPLOAD = 1;
165  const unsigned long OP_DOWNLOAD = 2;
166  const unsigned long OP_MOVE = 3;
167 
171  attribute AString name;
172 
176  void initialize();
177 
184  void finalize();
185 
194  void addCallback(in sbIDeviceBaseCallback aCallback);
195 
201  void removeCallback(in sbIDeviceBaseCallback aCallback);
202 
206  readonly attribute AString deviceCategory;
207 
213 
217  readonly attribute unsigned long deviceCount;
218 
226  sbILibrary getLibrary(in AString aDeviceIdentifier);
227 
235  unsigned long getDeviceState(in AString aDeviceIdentifier);
236 
248  nsIURI getTransferLocation(in AString aDeviceIdentifier,
249  in sbIMediaItem aMediaItem);
250 
273  unsigned long transferItems(in AString aDeviceIdentifier,
274  in nsIArray aMediaItems,
275  in nsIURI aDestionationPath,
276  in unsigned long aDeviceOperation,
277  in boolean aBeginTransferNow,
278  in sbILibrary aDestinationLibrary);
279 
283  unsigned long updateItems(in AString aDeviceIdentifier,
284  in nsIArray aMediaItems);
285 
294  unsigned long deleteItems(in AString aDeviceIdentifier,
295  in nsIArray aMediaItems);
296 
297  unsigned long deleteAllItems(in AString aDeviceIdentifier);
298 
299  unsigned long createPlaylists(in AString aDeviceIdentifier,
300  in nsIArray aMediaLists);
301 
302  unsigned long deletePlaylists(in AString aDeviceIdentifier,
303  in nsIArray aMediaLists);
304 
305  unsigned long addToPlaylist(in AString aDeviceIdentifier,
306  in sbIMediaList aMediaList,
307  in nsIArray aMediaItems,
308  in unsigned long aBeforeIndex);
309 
310  unsigned long removeFromPlaylist(in AString aDeviceIdentifier,
311  in sbIMediaList aMediaList,
312  in sbIMediaItem aMediaItem,
313  in unsigned long aIndex);
314 
315  unsigned long movePlaylistItem(in AString aDeviceIdentifier,
316  in sbIMediaList aMediaList,
317  in unsigned long aFromIndex,
318  in unsigned long aToIndex);
319 
320  unsigned long clearPlaylist(in AString aDeviceIdentifier,
321  in sbIMediaList aMediaList);
326  sbIMediaItem beginTransfer(in AString aDeviceIdentifier);
327 
338  unsigned long cancelTransfer(in AString aDeviceIdentifier,
339  in nsIArray aMediaItems);
340 
350  unsigned long suspendTransfer(in AString aDeviceIdentifier);
351 
361  unsigned long resumeTransfer(in AString aDeviceIdentifier);
362 
370  long long getUsedSpace(in AString aDeviceIdentifier);
371 
379  long long getAvailableSpace(in AString aDeviceIdentifier);
380 
390  nsIArray getSupportedFormats(in AString aDeviceIdentifier);
391 
399  boolean isDownloadSupported(in AString aDeviceIdentifier);
400 
410  boolean isUploadSupported(in AString aDeviceIdentifier);
411 
419  boolean isDeleteSupported(in AString aDeviceIdentifier);
420 
431  boolean isUpdateSupported(in AString aDeviceIdentifier);
432 
440  boolean isEjectSupported(in AString aDeviceIdentifier);
441 
449  boolean ejectDevice(in AString aDeviceIdentifier);
450 };
451 
452 // XXXben These are left here for the time being so the world doesn't break
453 // XXXmig When these are left at the top, doxygen breaks.
454 %{ C++
455 // File format constants
456 #define kSB_DEVICE_FILE_FORMAT_UNDEFINED -1
457 #define kSB_DEVICE_FILE_FORMAT_WAV 0
458 #define kSB_DEVICE_FILE_FORMAT_MP3 1
459 #define kSB_DEVICE_FILE_FORMAT_WMA 2
460 
461 // Device State constants
462 #define kSB_DEVICE_STATE_IDLE 0
463 #define kSB_DEVICE_STATE_BUSY 1
464 #define kSB_DEVICE_STATE_DOWNLOADING 2
465 #define kSB_DEVICE_STATE_UPLOADING 3
466 #define kSB_DEVICE_STATE_DOWNLOAD_PAUSED 4
467 #define kSB_DEVICE_STATE_UPLOAD_PAUSED 5
468 #define kSB_DEVICE_STATE_DELETING 6
469 %}
470 
const unsigned long OP_UPLOAD
Device Operation Constants.
unsigned long movePlaylistItem(in AString aDeviceIdentifier, in sbIMediaList aMediaList, in unsigned long aFromIndex, in unsigned long aToIndex)
unsigned long resumeTransfer(in AString aDeviceIdentifier)
Resume pending transfers.
void addCallback(in sbIDeviceBaseCallback aCallback)
Add a device category handler callback.
unsigned long createPlaylists(in AString aDeviceIdentifier, in nsIArray aMediaLists)
unsigned long cancelTransfer(in AString aDeviceIdentifier, in nsIArray aMediaItems)
Cancel a transfer by removing it from the queue.
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)
const unsigned long OP_MOVE
boolean isUpdateSupported(in AString aDeviceIdentifier)
Is it possible to update items directly on the device?
unsigned long suspendTransfer(in AString aDeviceIdentifier)
Suspend all transfers.
const PRUint32 FILE_FORMAT_WAV
var uuid
A brief description of the contents of this interface.
attribute AString name
The name of the device category handler.
[SOON TO BE DEPRECATED AFTER 0.3] The callback class for sbIDeviceBase
unsigned long deleteAllItems(in AString aDeviceIdentifier)
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.
const PRUint32 STATE_BUSY
void finalize()
Finalize usage of the device category handler.
function C(H)
unsigned long removeFromPlaylist(in AString aDeviceIdentifier, in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in unsigned long aIndex)
[SOON TO BE DEPRECATED AFTER 0.3] Base interface for all supported devices.
void removeCallback(in sbIDeviceBaseCallback aCallback)
Remove a device category handler callback.
void onTransferComplete(in sbIMediaItem aMediaItem, in PRInt32 aStatus)
<TODO:Brief>.
long long getUsedSpace(in AString aDeviceIdentifier)
Get the amount of used space from a device.
long long getAvailableSpace(in AString aDeviceIdentifier)
Get the amount of available space from a device.
const PRUint32 STATE_IDLE
boolean isEjectSupported(in AString aDeviceIdentifier)
Is eject or unmount supported by the device?.
const PRUint32 STATE_DELETING
sbILibrary getLibrary(in AString aDeviceIdentifier)
Get the device library representing the content available on the device.
const PRUint32 FILE_FORMAT_MP3
readonly attribute unsigned long deviceCount
Get the number of devices currently connected.
Media library abstraction.
Definition: sbILibrary.idl:82
readonly attribute AString deviceCategory
Device category name for this class of devices.
void onDeviceConnect(in AString aDeviceIdentifier)
<TODO:Brief>.
nsIArray getSupportedFormats(in AString aDeviceIdentifier)
Returns a list of file extensions representing the formats supported by a specific device...
unsigned long getDeviceState(in AString aDeviceIdentifier)
Get the device's current state.
nsIURI getTransferLocation(in AString aDeviceIdentifier, in sbIMediaItem aMediaItem)
Get preferred transfer location for item.
const PRUint32 FILE_FORMAT_WMA
const PRUint32 STATE_DOWNLOADING
boolean ejectDevice(in AString aDeviceIdentifier)
Eject or unmount the device from the system.
void onDeviceDisconnect(in AString aDeviceIdentifier)
<TODO:Brief>.
const PRUint32 FILE_FORMAT_UNDEFINED
boolean isUploadSupported(in AString aDeviceIdentifier)
Is uploading supported on this device?
void onStateChanged(in AString aDeviceIdentifier, in unsigned long aState)
Called when the device state has changed.
readonly attribute nsIStringEnumerator deviceIdentifiers
Contains nsISupportsStrings representing the device unique identifiers for all connected devices of t...
unsigned long deleteItems(in AString aDeviceIdentifier, in nsIArray aMediaItems)
Delete items from the device.
const PRUint32 STATE_DOWNLOAD_PAUSED
Interface that defines a single item of media in the system.
void onTransferStart(in sbIMediaItem aMediaItem)
<TODO:Brief>.
unsigned long clearPlaylist(in AString aDeviceIdentifier, in sbIMediaList aMediaList)
const PRUint32 STATE_UPLOAD_PAUSED
boolean isDownloadSupported(in AString aDeviceIdentifier)
Download is to copy a track from the device to the host.
const PRUint32 STATE_UPLOADING
const unsigned long OP_DOWNLOAD
restoreWindow aState
unsigned long updateItems(in AString aDeviceIdentifier, in nsIArray aMediaItems)
Update items on the device.
boolean isDeleteSupported(in AString aDeviceIdentifier)
Is it possible to delete items from the device?
void initialize()
Initialize the device category handler.
sbIMediaItem beginTransfer(in AString aDeviceIdentifier)
Begin transfer operations.