sbIFileDownloader.idl
Go to the documentation of this file.
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 :miv */
3 /*
4  *=BEGIN SONGBIRD GPL
5  *
6  * This file is part of the Songbird web player.
7  *
8  * Copyright(c) 2005-2010 POTI, Inc.
9  * http://www.songbirdnest.com
10  *
11  * This file may be licensed under the terms of of the
12  * GNU General Public License Version 2 (the ``GPL'').
13  *
14  * Software distributed under the License is distributed
15  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
16  * express or implied. See the GPL for the specific language
17  * governing rights and limitations.
18  *
19  * You should have received a copy of the GPL along with this
20  * program. If not, go to http://www.gnu.org/licenses/gpl.html
21  * or write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23  *
24  *=END SONGBIRD GPL
25  */
26 
27 #include "nsISupports.idl"
28 
38 interface nsIFile;
39 interface nsIRequest;
40 interface nsIURI;
42 interface sbITemporaryFileFactory;
43 
44 [scriptable, uuid(7a497d5c-1dd2-11b2-8c68-a37686c9bb01)]
46 {
51  readonly attribute unsigned long long bytesToDownload;
52 
53 
58  readonly attribute unsigned long long bytesDownloaded;
59 
60 
65  readonly attribute unsigned long percentComplete;
66 
67 
72  readonly attribute boolean complete;
73 
74 
80  readonly attribute boolean succeeded;
81 
82 
88 
89 
94  attribute nsIURI sourceURI;
95 
96 
101  attribute AString sourceURISpec;
102 
103 
109  attribute nsIFile destinationFile;
110 
111 
117  attribute AString destinationFileExtension;
118 
124 
125 
132  void start();
133 
134 
139  void cancel();
140 
146  readonly attribute nsIRequest request;
147 };
148 
149 
156 [scriptable, uuid(3267334a-a1ef-4bf3-b6e5-8c8ae5f19f44)]
158 {
163  void onProgress();
164 
165 
170  void onComplete();
171 };
172 
173 
174 //
175 // C++ defs.
176 //
177 
178 %{C++
179 #define SB_FILEDOWNLOADER_CONTRACTID \
180  "@songbirdnest.com/Songbird/FileDownloader;1"
181 %}C++
182 
void onProgress()
Called when progress is made on file download.
void cancel()
Cancel file download.
attribute AString destinationFileExtension
Destination file extension. If a temporary file is created, set its file extension to destinationFile...
readonly attribute boolean succeeded
True if file downloaded successfully. Will be false if download is cancelled.
readonly attribute boolean complete
True if file download has completed, whether successful or not.
var uuid
readonly attribute unsigned long percentComplete
Percentage (0-100) of bytes of file that have been downloaded.
void start()
Start file download from source URI to destination file. If source URI is not specified, use source URI spec. If destination file is not specified, create a temporary one.
readonly attribute unsigned long long bytesDownloaded
Number of bytes in file that have been downloaded.
function C(H)
attribute sbIFileDownloaderListener listener
Listener for download events.
readonly attribute nsIRequest request
The request object used during the file download.
attribute nsIURI sourceURI
URI of source of file.
attribute AString sourceURISpec
URI spec of source of file.
readonly attribute unsigned long long bytesToDownload
Number of bytes in file being downloaded.
attribute nsIFile destinationFile
Destination file. If not set when download is started, a temporary file will be created and set in de...
attribute sbITemporaryFileFactory temporaryFileFactory
Temporary file factory to use for any temporary files.
void onComplete()
Called when download has completed.