Songbird / Development / Songbird Add-Ons API Documentation

components/devicesobsolete/base/public/sbIDeviceBase.idl

Go to the documentation of this file.
00001 /*
00002 //
00003 // BEGIN SONGBIRD GPL
00004 // 
00005 // This file is part of the Songbird web player.
00006 //
00007 // Copyright(c) 2005-2008 POTI, Inc.
00008 // http://songbirdnest.com
00009 // 
00010 // This file may be licensed under the terms of of the
00011 // GNU General Public License Version 2 (the "GPL").
00012 // 
00013 // Software distributed under the License is distributed 
00014 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 
00015 // express or implied. See the GPL for the specific language 
00016 // governing rights and limitations.
00017 //
00018 // You should have received a copy of the GPL along with this 
00019 // program. If not, go to http://www.gnu.org/licenses/gpl.html
00020 // or write to the Free Software Foundation, Inc., 
00021 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00022 // 
00023 // END SONGBIRD GPL
00024 //
00025  */
00026 
00033 #include "nsISupports.idl"
00034 
00038 interface nsIArray;
00039 interface nsIStringEnumerator;
00040 interface nsIURI;
00041 
00042 interface sbILibrary;
00043 interface sbIMediaItem;
00044 interface sbIMediaList;
00045 
00053 [scriptable, uuid(c52a5f0f-fd6e-4f41-a681-3ed88c9e5a9f)]
00054 interface sbIDeviceBaseCallback : nsISupports
00055 {
00063   void onDeviceConnect(in AString aDeviceIdentifier);
00064 
00072   void onDeviceDisconnect(in AString aDeviceIdentifier);
00073 
00081   void onTransferStart(in sbIMediaItem aMediaItem);
00082 
00091   void onTransferComplete(in sbIMediaItem aMediaItem,
00092                           in PRInt32 aStatus);
00093 
00100   void onStateChanged(in AString aDeviceIdentifier,
00101                       in unsigned long aState);
00102 };
00103 
00104 
00126 [scriptable, uuid(2964c3bf-18d6-4a72-8ccf-f08b732b4bab)]
00127 interface sbIDeviceBase : nsISupports
00128 {
00137   const PRUint32 FILE_FORMAT_UNDEFINED = 9999;
00138   const PRUint32 FILE_FORMAT_WAV       = 0;
00139   const PRUint32 FILE_FORMAT_MP3       = 1;
00140   const PRUint32 FILE_FORMAT_WMA       = 2;
00141 
00152   const PRUint32 STATE_IDLE            = 0;
00153   const PRUint32 STATE_BUSY            = 1;
00154   const PRUint32 STATE_DOWNLOADING     = 2;
00155   const PRUint32 STATE_UPLOADING       = 3;
00156   const PRUint32 STATE_DOWNLOAD_PAUSED = 4;
00157   const PRUint32 STATE_UPLOAD_PAUSED   = 5;
00158   const PRUint32 STATE_DELETING        = 6;
00159 
00164   const unsigned long OP_UPLOAD    = 1;
00165   const unsigned long OP_DOWNLOAD  = 2;
00166   const unsigned long OP_MOVE      = 3;
00167   
00171         attribute AString name;
00172 
00176   void initialize();
00177 
00184   void finalize();
00185 
00194   void addCallback(in sbIDeviceBaseCallback aCallback);
00195 
00201   void removeCallback(in sbIDeviceBaseCallback aCallback);
00202 
00206         readonly attribute AString deviceCategory;
00207 
00212         readonly attribute nsIStringEnumerator deviceIdentifiers;
00213 
00217         readonly attribute unsigned long deviceCount;
00218 
00226   sbILibrary getLibrary(in AString aDeviceIdentifier);
00227 
00235   unsigned long getDeviceState(in AString aDeviceIdentifier);
00236 
00248   nsIURI getTransferLocation(in AString aDeviceIdentifier,
00249                              in sbIMediaItem aMediaItem);
00250 
00273   unsigned long transferItems(in AString aDeviceIdentifier,
00274                               in nsIArray aMediaItems, 
00275                               in nsIURI aDestionationPath, 
00276                               in unsigned long aDeviceOperation,
00277                               in boolean aBeginTransferNow,
00278                               in sbILibrary aDestinationLibrary);
00279 
00283   unsigned long updateItems(in AString aDeviceIdentifier,
00284                             in nsIArray aMediaItems);
00285 
00294   unsigned long deleteItems(in AString aDeviceIdentifier,
00295                             in nsIArray aMediaItems);
00296 
00297   unsigned long deleteAllItems(in AString aDeviceIdentifier);
00298 
00299   unsigned long createPlaylists(in AString aDeviceIdentifier,
00300                                 in nsIArray aMediaLists);
00301 
00302   unsigned long deletePlaylists(in AString aDeviceIdentifier,
00303                                 in nsIArray aMediaLists);
00304 
00305   unsigned long addToPlaylist(in AString aDeviceIdentifier,
00306                               in sbIMediaList aMediaList,
00307                               in nsIArray aMediaItems,
00308                               in unsigned long aBeforeIndex);
00309                               
00310   unsigned long removeFromPlaylist(in AString aDeviceIdentifier,
00311                                    in sbIMediaList aMediaList,
00312                                    in sbIMediaItem aMediaItem,
00313                                    in unsigned long aIndex);
00314 
00315   unsigned long movePlaylistItem(in AString aDeviceIdentifier,
00316                                  in sbIMediaList aMediaList,
00317                                  in unsigned long aFromIndex,
00318                                  in unsigned long aToIndex);
00319 
00320   unsigned long clearPlaylist(in AString aDeviceIdentifier,
00321                               in sbIMediaList aMediaList);
00326   sbIMediaItem beginTransfer(in AString aDeviceIdentifier);
00327 
00338   unsigned long cancelTransfer(in AString aDeviceIdentifier,
00339                                in nsIArray aMediaItems);
00340 
00350   unsigned long suspendTransfer(in AString aDeviceIdentifier);
00351 
00361   unsigned long resumeTransfer(in AString aDeviceIdentifier);
00362 
00370   long long getUsedSpace(in AString aDeviceIdentifier);
00371 
00379         long long getAvailableSpace(in AString aDeviceIdentifier);
00380 
00390         nsIArray getSupportedFormats(in AString aDeviceIdentifier);
00391 
00399         boolean isDownloadSupported(in AString aDeviceIdentifier);
00400 
00410         boolean isUploadSupported(in AString aDeviceIdentifier);
00411 
00419         boolean isDeleteSupported(in AString aDeviceIdentifier);
00420 
00431         boolean isUpdateSupported(in AString aDeviceIdentifier);
00432 
00440         boolean isEjectSupported(in AString aDeviceIdentifier);
00441 
00449   boolean ejectDevice(in AString aDeviceIdentifier);
00450 };
00451 
00452 // XXXben These are left here for the time being so the world doesn't break
00453 // XXXmig When these are left at the top, doxygen breaks.
00454 %{ C++
00455 // File format constants
00456 #define kSB_DEVICE_FILE_FORMAT_UNDEFINED  -1
00457 #define kSB_DEVICE_FILE_FORMAT_WAV        0
00458 #define kSB_DEVICE_FILE_FORMAT_MP3        1
00459 #define kSB_DEVICE_FILE_FORMAT_WMA        2
00460 
00461 // Device State constants
00462 #define kSB_DEVICE_STATE_IDLE             0
00463 #define kSB_DEVICE_STATE_BUSY             1
00464 #define kSB_DEVICE_STATE_DOWNLOADING      2
00465 #define kSB_DEVICE_STATE_UPLOADING        3
00466 #define kSB_DEVICE_STATE_DOWNLOAD_PAUSED  4
00467 #define kSB_DEVICE_STATE_UPLOAD_PAUSED    5
00468 #define kSB_DEVICE_STATE_DELETING         6
00469 %}
00470 

Generated on Tue Mar 10 14:28:54 2009 for Songbird by  doxygen 1.5.2