sbIDevice.idl
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2011 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
29 #include "nsISupports.idl"
30 
31 interface nsIInputStream;
32 interface nsIPropertyBag2;
33 interface nsIURI;
34 interface nsIVariant;
35 
36 interface sbIDeviceCapabilities;
37 interface sbIDeviceContent;
38 interface sbIDeviceLibrary;
39 interface sbIDeviceProperties;
40 interface sbIDeviceParameters;
41 interface sbIDeviceStatus;
42 interface sbILibrary;
43 interface sbILibraryChangeset;
44 interface sbIMediaItem;
45 
46 %{C++
47 
48 #include <nsError.h>
49 
50 // Device related errors
51 #define SB_ERROR_MEDIA_TYPE_NOT_SUPPORTED \
52  NS_ERROR_GENERATE_FAILURE( NS_ERROR_MODULE_GENERAL, 1 )
53 #define SB_ERROR_DOWNLOAD_SIZE_UNAVAILABLE \
54  NS_ERROR_GENERATE_FAILURE( NS_ERROR_MODULE_GENERAL, 2 )
55 #define SB_ERROR_DEVICE_DRM_FAILURE \
56  NS_ERROR_GENERATE_FAILURE( NS_ERROR_MODULE_GENERAL, 3 )
57 #define SB_ERROR_DEVICE_DRM_CERT_FAIL \
58  NS_ERROR_GENERATE_FAILURE( NS_ERROR_MODULE_GENERAL, 4 )
59 
60 %}
61 
67 [scriptable, function, uuid(cf163566-24b2-4ecd-4b9f-2a69725e22ad)]
69 {
70  void onSupportsMediaItem(in sbIMediaItem aMediaItem, in boolean aIsSupported);
71 };
72 
79 [scriptable, uuid(fd0d4015-20e1-45b1-bd8a-a8f81d2bdfd2)]
81 {
85  readonly attribute AString name;
86 
91  readonly attribute AString productName;
92 
96  readonly attribute nsIDPtr controllerId;
97 
101  readonly attribute nsIDPtr id;
102 
106  void connect();
107 
113  void disconnect();
114 
118  readonly attribute boolean connected;
119 
124  readonly attribute boolean threaded;
125 
129  nsIVariant getPreference(in AString aPrefName);
130 
134  void setPreference(in AString aPrefName,
135  in nsIVariant aPrefValue);
136 
141 
145  readonly attribute sbIDeviceContent content;
146 
152 
158  readonly attribute sbIDeviceLibrary primaryLibrary;
159 
163  readonly attribute nsIPropertyBag2 parameters;
164 
168  readonly attribute sbIDeviceProperties properties;
169 
173  readonly attribute boolean isDirectTranscoding;
174 
180  readonly attribute boolean isBusy;
181 
189  readonly attribute boolean canDisconnect;
190 
197  readonly attribute sbIDeviceStatus currentStatus;
198 
203  readonly attribute boolean supportsReformat;
204 
217  attribute unsigned long state;
218  readonly attribute unsigned long previousState;
219 
220  const unsigned long STATE_IDLE = 0; // Not doing anything
221  const unsigned long STATE_SYNCING = 1; // Performing a sync
222  // These are not related to syncing (used for manual mode)
223  const unsigned long STATE_COPYING = 2; // Copying a single file
224  const unsigned long STATE_DELETING = 3; // Deleting a single file
225  const unsigned long STATE_UPDATING = 4; // Updating a single file
226  const unsigned long STATE_MOUNTING = 5; // (un)Mounting the device
227  const unsigned long STATE_DOWNLOADING = 6;
228  const unsigned long STATE_UPLOADING = 7;
229  const unsigned long STATE_DOWNLOAD_PAUSED = 8;
230  const unsigned long STATE_UPLOAD_PAUSED = 9;
231  const unsigned long STATE_DISCONNECTED = 10; // Device is disconnected
232  const unsigned long STATE_BUSY = 11; // Busy with unspecified
233  // operation
234  const unsigned long STATE_CANCEL = 12; // In process of canceling operation
235  const unsigned long STATE_TRANSCODE = 13; // Transcoding a file.
236  const unsigned long STATE_FORMATTING = 14; // Formatting the device.
237  const unsigned long STATE_SYNC_PREPARING = 15; // Preparing to sync
238  const unsigned long STATE_SYNC_PLAYLIST = 16; // Sync playlist
239  const unsigned long STATE_COPY_PREPARING = 17; // Preparing to copy
240  const unsigned long STATE_SYNCING_TYPE = 18; // Syncing types
241  const unsigned long STATE_COPYING_MUSIC = 19; // Copying music
242  const unsigned long STATE_COPYING_VIDEO = 20; // Copying video
243  const unsigned long STATE_IMAGESYNC_PREPARING = 21; // Preparing to sync
244  const unsigned long STATE_COPYING_IMAGE = 22; // Copying image
245 
246  const unsigned long STATE_USER = 0x20000000;
247 
252  const unsigned long REQUEST_FLAG_USER = 0x80000000;
253  const unsigned long REQUEST_FLAG_WRITE = 0x40000000;
254  const unsigned long REQUEST_FLAG_READ = 0x20000000;
255 
256  /* read requests */
257  const unsigned long REQUEST_MOUNT = REQUEST_FLAG_READ + 1;
258  const unsigned long REQUEST_READ = REQUEST_FLAG_READ + 2;
259  const unsigned long REQUEST_EJECT = REQUEST_FLAG_READ + 3;
260  const unsigned long REQUEST_SUSPEND = REQUEST_FLAG_READ + 4;
261 
262  /* write requests */
263  const unsigned long REQUEST_WRITE = REQUEST_FLAG_WRITE + 1;
264  const unsigned long REQUEST_DELETE = REQUEST_FLAG_WRITE + 2;
265  const unsigned long REQUEST_SYNC = REQUEST_FLAG_WRITE + 3;
266  /* delete all files on the device */
267  const unsigned long REQUEST_WIPE = REQUEST_FLAG_WRITE + 4;
268  /* move an item inside one playlist */
269  const unsigned long REQUEST_MOVE = REQUEST_FLAG_WRITE + 5;
270  const unsigned long REQUEST_UPDATE = REQUEST_FLAG_WRITE + 6;
271  const unsigned long REQUEST_NEW_PLAYLIST = REQUEST_FLAG_WRITE + 7;
272 
273  /* reset the device to its factory state */
274  const unsigned long REQUEST_FACTORY_RESET = REQUEST_FLAG_WRITE + 8;
275 
276  /* format the device media */
277  const unsigned long REQUEST_FORMAT = REQUEST_FLAG_WRITE + 9;
278 
279  /* perform image sync */
280  const unsigned long REQUEST_IMAGESYNC = REQUEST_FLAG_WRITE + 10;
281 
282  /* update raw files on the device */
283  const unsigned long REQUEST_WRITE_FILE = REQUEST_FLAG_WRITE + 11;
284  const unsigned long REQUEST_DELETE_FILE = REQUEST_FLAG_WRITE + 12;
285 
286  /* Request indicating that a sync request has completed */
287  const unsigned long REQUEST_SYNC_COMPLETE = REQUEST_FLAG_WRITE + 13;
288 
292  void submitRequest(in unsigned long aRequest, in nsIPropertyBag2 aRequestParameters);
296  void cancelRequests();
297 
301  void syncLibraries();
302 
319  void supportsMediaItem(in sbIMediaItem aMediaItem,
320  in sbIDeviceSupportsItemCallback aCallback);
321 
325  void eject();
326 
330  void format();
331 
332  /* Set the enabled state on a named warning dialog */
333  void setWarningDialogEnabled(in AString aWarning, in boolean aEnabled);
334  /* Get the enabled state on a named warning dialog */
335  boolean getWarningDialogEnabled(in AString aWarning);
336  /* Reset the enabled state of all warning dialogs */
337  void resetWarningDialogs();
338 
354  nsIInputStream openInputStream(in nsIURI aURI);
355 
362  void importFromDevice(in sbILibrary aImportToLibrary,
363  in sbILibraryChangeset aImportChangeset);
364 
371  void exportToDevice(in sbIDeviceLibrary aDevLibrary,
372  in sbILibraryChangeset aExportChangeset);
373 
374 };
375 
const unsigned long REQUEST_FACTORY_RESET
Definition: sbIDevice.idl:274
void exportToDevice(in sbIDeviceLibrary aDevLibrary, in sbILibraryChangeset aExportChangeset)
readonly attribute boolean supportsReformat
Definition: sbIDevice.idl:203
readonly attribute unsigned long previousState
Definition: sbIDevice.idl:218
const unsigned long STATE_DELETING
Definition: sbIDevice.idl:224
void supportsMediaItem(in sbIMediaItem aMediaItem, in sbIDeviceSupportsItemCallback aCallback)
const unsigned long REQUEST_SYNC
Definition: sbIDevice.idl:265
[UNIMPLEMENTED UNTIL AFTER 0.3]
readonly attribute boolean canDisconnect
Definition: sbIDevice.idl:189
readonly attribute sbIDeviceContent content
Definition: sbIDevice.idl:145
const unsigned long STATE_SYNC_PREPARING
Definition: sbIDevice.idl:237
const unsigned long STATE_SYNCING_TYPE
Definition: sbIDevice.idl:240
const unsigned long REQUEST_WIPE
Definition: sbIDevice.idl:267
void eject()
const unsigned long STATE_UPDATING
Definition: sbIDevice.idl:225
readonly attribute sbIDeviceStatus currentStatus
Definition: sbIDevice.idl:197
[UNIMPLEMENTED UNTIL AFTER 0.3]
var uuid
const unsigned long STATE_IMAGESYNC_PREPARING
Definition: sbIDevice.idl:243
readonly attribute boolean isBusy
Definition: sbIDevice.idl:180
const unsigned long REQUEST_SUSPEND
Definition: sbIDevice.idl:260
const unsigned long REQUEST_FLAG_READ
Definition: sbIDevice.idl:254
function C(H)
const unsigned long REQUEST_READ
Definition: sbIDevice.idl:258
const unsigned long STATE_UPLOAD_PAUSED
Definition: sbIDevice.idl:230
readonly attribute sbIDeviceCapabilities capabilities
Definition: sbIDevice.idl:140
const unsigned long STATE_COPY_PREPARING
Definition: sbIDevice.idl:239
void disconnect()
readonly attribute nsIPropertyBag2 parameters
Definition: sbIDevice.idl:163
const unsigned long STATE_UPLOADING
Definition: sbIDevice.idl:228
const unsigned long REQUEST_FLAG_USER
Definition: sbIDevice.idl:252
const unsigned long REQUEST_WRITE
Definition: sbIDevice.idl:263
const unsigned long STATE_DOWNLOADING
Definition: sbIDevice.idl:227
void connect()
const unsigned long REQUEST_DELETE
Definition: sbIDevice.idl:264
void format()
const unsigned long REQUEST_EJECT
Definition: sbIDevice.idl:259
void syncLibraries()
readonly attribute AString name
Definition: sbIDevice.idl:85
const unsigned long STATE_CANCEL
Definition: sbIDevice.idl:234
void submitRequest(in unsigned long aRequest, in nsIPropertyBag2 aRequestParameters)
const unsigned long REQUEST_WRITE_FILE
Definition: sbIDevice.idl:283
const unsigned long STATE_USER
Definition: sbIDevice.idl:246
const unsigned long STATE_COPYING
Definition: sbIDevice.idl:223
const unsigned long REQUEST_SYNC_COMPLETE
Definition: sbIDevice.idl:287
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 "...
const unsigned long STATE_FORMATTING
Definition: sbIDevice.idl:236
const unsigned long STATE_IDLE
Definition: sbIDevice.idl:220
boolean getWarningDialogEnabled(in AString aWarning)
Media library abstraction.
Definition: sbILibrary.idl:82
attribute unsigned long state
Definition: sbIDevice.idl:217
const unsigned long STATE_MOUNTING
Definition: sbIDevice.idl:226
const unsigned long REQUEST_FLAG_WRITE
Definition: sbIDevice.idl:253
readonly attribute sbIDeviceProperties properties
Definition: sbIDevice.idl:168
const unsigned long REQUEST_DELETE_FILE
Definition: sbIDevice.idl:284
nsIVariant getPreference(in AString aPrefName)
void importFromDevice(in sbILibrary aImportToLibrary, in sbILibraryChangeset aImportChangeset)
const unsigned long STATE_TRANSCODE
Definition: sbIDevice.idl:235
const unsigned long REQUEST_MOVE
Definition: sbIDevice.idl:269
const unsigned long STATE_SYNCING
Definition: sbIDevice.idl:221
const unsigned long REQUEST_IMAGESYNC
Definition: sbIDevice.idl:280
readonly attribute nsIDPtr controllerId
Definition: sbIDevice.idl:96
const unsigned long REQUEST_FORMAT
Definition: sbIDevice.idl:277
const unsigned long STATE_SYNC_PLAYLIST
Definition: sbIDevice.idl:238
readonly attribute boolean threaded
Definition: sbIDevice.idl:124
void onSupportsMediaItem(in sbIMediaItem aMediaItem, in boolean aIsSupported)
readonly attribute boolean isDirectTranscoding
Definition: sbIDevice.idl:173
const unsigned long STATE_DOWNLOAD_PAUSED
Definition: sbIDevice.idl:229
const unsigned long STATE_COPYING_MUSIC
Definition: sbIDevice.idl:241
readonly attribute nsIDPtr id
Definition: sbIDevice.idl:101
void setPreference(in AString aPrefName, in nsIVariant aPrefValue)
const unsigned long REQUEST_NEW_PLAYLIST
Definition: sbIDevice.idl:271
void cancelRequests()
attribute sbIDeviceLibrary defaultLibrary
Definition: sbIDevice.idl:151
const unsigned long STATE_COPYING_VIDEO
Definition: sbIDevice.idl:242
Interface that defines a single item of media in the system.
void resetWarningDialogs()
readonly attribute sbIDeviceLibrary primaryLibrary
Definition: sbIDevice.idl:158
const unsigned long STATE_BUSY
Definition: sbIDevice.idl:232
void setWarningDialogEnabled(in AString aWarning, in boolean aEnabled)
readonly attribute boolean connected
Definition: sbIDevice.idl:118
const unsigned long REQUEST_MOUNT
Definition: sbIDevice.idl:257
const unsigned long REQUEST_UPDATE
Definition: sbIDevice.idl:270
readonly attribute AString productName
Definition: sbIDevice.idl:91
const unsigned long STATE_DISCONNECTED
Definition: sbIDevice.idl:231
const unsigned long STATE_COPYING_IMAGE
Definition: sbIDevice.idl:244