C:/projects/songbird/components/devices/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© 2006 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 
00043 [scriptable, uuid(d38c86bc-67da-442b-95ed-fdc1d21a6594)]
00044 interface sbIDeviceBaseCallback : nsISupports
00045 {
00053   void onDeviceConnect(in AString aDeviceString);
00054 
00062   void onDeviceDisconnect(in AString aDeviceString);
00063 
00072   void onTransferStart(in AString aSourceURL,
00073                        in AString aDestinationURL);
00074 
00084   void onTransferComplete(in AString aSourceURL,
00085                           in AString aDestinationURL,
00086                           in PRInt32 aStatus);
00087 };
00088 
00089 
00090 // XXXben These are left here for the time being so the world doesn't break
00091 
00092 %{ C++
00093 // File format constants
00094 #define kSB_DEVICE_FILE_FORMAT_UNDEFINED  -1
00095 #define kSB_DEVICE_FILE_FORMAT_WAV        0
00096 #define kSB_DEVICE_FILE_FORMAT_MP3        1
00097 #define kSB_DEVICE_FILE_FORMAT_WMA        2
00098 
00099 // Device State constants
00100 #define kSB_DEVICE_STATE_IDLE             0
00101 #define kSB_DEVICE_STATE_BUSY             1
00102 #define kSB_DEVICE_STATE_DOWNLOADING      2
00103 #define kSB_DEVICE_STATE_UPLOADING        3
00104 #define kSB_DEVICE_STATE_DOWNLOAD_PAUSED  4
00105 #define kSB_DEVICE_STATE_UPLOAD_PAUSED    5
00106 #define kSB_DEVICE_STATE_DELETING         6
00107 
00108 %}
00109 
00131 [scriptable, uuid(ba25e1d1-bb6d-43db-b2f1-f5d3d1a41792)]
00132 interface sbIDeviceBase : nsISupports
00133 {
00142   const PRUint32 FILE_FORMAT_UNDEFINED = 9999;
00143   const PRUint32 FILE_FORMAT_WAV       = 0;
00144   const PRUint32 FILE_FORMAT_MP3       = 1;
00145   const PRUint32 FILE_FORMAT_WMA       = 2;
00146 
00157   const PRUint32 STATE_IDLE            = 0;
00158   const PRUint32 STATE_BUSY            = 1;
00159   const PRUint32 STATE_DOWNLOADING     = 2;
00160   const PRUint32 STATE_UPLOADING       = 3;
00161   const PRUint32 STATE_DOWNLOAD_PAUSED = 4;
00162   const PRUint32 STATE_UPLOAD_PAUSED   = 5;
00163   const PRUint32 STATE_DELETING        = 6;
00164 
00170         attribute AString name;
00171 
00179   PRBool initialize();
00180 
00188   PRBool finalize();
00189 
00199   PRBool addCallback(in sbIDeviceBaseCallback aCallback);
00200 
00210   PRBool removeCallback(in sbIDeviceBaseCallback aCallback);
00211 
00219         readonly attribute AString deviceCategory;
00220 
00230         AString getDeviceStringByIndex(in PRUint32 aIndex);
00231 
00239         readonly attribute PRUint32 deviceCount;
00240 
00250         PRUint32 getDestinationCount(in AString aDeviceString); 
00251 
00261         AString getContext(in AString aDeviceString);
00262 
00272   PRUint32 getDeviceState(in AString aDeviceString);
00273 
00295         PRBool makeTransferTable(in AString aDeviceString,
00296                            in AString aContextInput,
00297                            in AString aTableName,
00298                            in AString aFilterColumn,
00299                            in PRUint32 aFilterCount,
00300                            [array, size_is(aFilterCount)] in wstring aFilterValues,
00301                            in AString aSourcePath,
00302                            in AString aDestPath,
00303                            in PRBool aDownloading,
00304                            out AString aTransferTable);
00305   
00316   PRBool downloadTable(in AString aDeviceString,
00317                        in AString aTableName);
00318 
00329   PRBool uploadTable(in AString aDeviceString,
00330                      in AString aTableName);
00331         
00349   PRBool autoDownloadTable(in AString aDeviceString,
00350                            in AString aContextInput,
00351                            in AString aTableName,
00352                            in AString aFilterColumn,
00353                            in PRUint32 aFilterCount,
00354                            [array, size_is(aFilterCount)] in wstring aFilterValues,
00355                            in AString aSourcePath,
00356                            in AString aDestPath,
00357                            out AString aTransferTable);
00358 
00376   PRBool autoUploadTable(in AString aDeviceString,
00377                          in AString aContextInput,
00378                          in AString aTableName,
00379                          in AString aFilterColumn,
00380                          in PRUint32 aFilterCount,
00381                          [array, size_is(aFilterCount)] in wstring aFilterValues,
00382                          in AString aSourcePath,
00383                          in AString aDestPath,
00384                          out AString aTransferTable);
00385         
00386   // XXXben seems like we should be able to turn these all into attributes if
00387   //        we can get rid of the parameter...
00388 
00398   AString getDownloadTable(in AString aDeviceString);
00399 
00409   AString getUploadTable(in AString aDeviceString);
00410 
00420   PRUint32 getDownloadFileType(in AString aDeviceString);
00421 
00432   PRBool setDownloadFileType(in AString aDeviceString,
00433                              in PRUint32 aFileType);
00434 
00444   PRUint32 getUploadFileType(in AString aDeviceString);
00445 
00456   PRBool setUploadFileType(in AString aDeviceString,
00457                            in PRUint32 aFileType);
00458 
00468   PRUint32 getUsedSpace(in AString aDeviceString);
00469 
00479         PRUint32 getAvailableSpace(in AString aDeviceString);
00480 
00492   PRBool getTrackTable(in AString aDeviceString,
00493                        out AString aDBContext,
00494                        out AString aTableName);
00495 
00506   PRBool removeTranferTracks(in AString aDeviceString,
00507                              in PRUint32 aIndex);
00508 
00518         PRBool abortTransfer(in AString aDeviceString);
00519 
00529   PRBool suspendTransfer(in AString aDeviceString);
00530 
00540   PRBool resumeTransfer(in AString aDeviceString);
00541 
00542   // XXXben Again possible to become attributes?
00543 
00553         PRBool isDownloadSupported(in AString aDeviceString);
00554 
00564         PRBool isUploadSupported(in AString aDeviceString);
00565 
00575         PRBool isTransfering(in AString aDeviceString);
00576 
00586         PRUint32 getSupportedFormats(in AString aDeviceString);
00587 
00597         PRBool isDeleteSupported(in AString aDeviceString);
00598 
00610         PRBool deleteTable(in AString aDeviceString,
00611                      in AString aDBContext,
00612                      in AString aTableName);
00613         
00624         PRBool isUpdateSupported(in AString aDeviceString);
00625 
00636   PRBool updateTable(in AString aDeviceString,
00637                      in AString aTableName);
00638         
00648         PRBool isEjectSupported(in AString aDeviceString);
00649 
00660   PRBool ejectDevice(in AString aDeviceString);
00661 };

Generated on Mon Aug 21 21:01:55 2006 for Songbird by  doxygen 1.4.7