2002-03-10 05:24:48 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-17 16:52:41 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2002-03-10 05:24:48 +00:00
|
|
|
*
|
2004-04-17 16:52:41 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
2002-03-10 05:24:48 +00:00
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-17 16:52:41 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2002-03-10 05:24:48 +00:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
2004-04-17 16:52:41 +00:00
|
|
|
* Blake Ross <blaker@netscape.com>
|
2002-03-10 05:24:48 +00:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-17 16:52:41 +00:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2002-03-10 05:24:48 +00:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-17 16:52:41 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2002-03-10 05:24:48 +00:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-17 16:52:41 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2002-03-10 05:24:48 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
2005-01-04 13:40:51 +00:00
|
|
|
#include "nsITransfer.idl"
|
2002-03-10 05:24:48 +00:00
|
|
|
|
|
|
|
interface nsIURI;
|
|
|
|
interface nsILocalFile;
|
|
|
|
interface nsIObserver;
|
2005-04-24 21:16:28 +00:00
|
|
|
interface nsICancelable;
|
2002-03-12 22:13:45 +00:00
|
|
|
interface nsIWebProgressListener;
|
2002-06-28 01:35:57 +00:00
|
|
|
interface nsIMIMEInfo;
|
2002-03-10 05:24:48 +00:00
|
|
|
|
2006-02-06 00:34:30 +00:00
|
|
|
[scriptable, uuid(07910093-d70b-4621-9888-b811f42293c3)]
|
2005-01-04 13:40:51 +00:00
|
|
|
interface nsIDownload : nsITransfer {
|
2002-03-10 05:24:48 +00:00
|
|
|
|
2002-03-13 05:20:13 +00:00
|
|
|
/**
|
2005-01-04 13:40:51 +00:00
|
|
|
* The target of a download is always a file on the local file system.
|
|
|
|
*/
|
|
|
|
readonly attribute nsILocalFile targetFile;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The percentage of transfer completed.
|
|
|
|
* If the file size is unknown it'll be -1 here.
|
|
|
|
*/
|
|
|
|
readonly attribute PRInt32 percentComplete;
|
|
|
|
|
|
|
|
/**
|
2005-12-19 15:25:22 +00:00
|
|
|
* The amount of bytes downloaded so far.
|
2002-03-13 05:20:13 +00:00
|
|
|
*/
|
2005-01-04 13:40:51 +00:00
|
|
|
readonly attribute PRUint64 amountTransferred;
|
2002-03-13 05:20:13 +00:00
|
|
|
|
2005-01-04 13:40:51 +00:00
|
|
|
/**
|
2005-12-19 15:25:22 +00:00
|
|
|
* The size of file in bytes.
|
2005-01-04 13:40:51 +00:00
|
|
|
* Unknown size is represented by 0.
|
|
|
|
*/
|
|
|
|
readonly attribute PRUint64 size;
|
|
|
|
|
2002-03-10 05:24:48 +00:00
|
|
|
/**
|
2004-04-17 00:58:23 +00:00
|
|
|
* The source of the transfer.
|
2002-03-10 05:24:48 +00:00
|
|
|
*/
|
|
|
|
readonly attribute nsIURI source;
|
|
|
|
|
|
|
|
/**
|
2004-04-17 00:58:23 +00:00
|
|
|
* The target of the transfer.
|
2002-03-10 05:24:48 +00:00
|
|
|
*/
|
2004-04-17 00:58:23 +00:00
|
|
|
readonly attribute nsIURI target;
|
2002-03-10 05:24:48 +00:00
|
|
|
|
|
|
|
/**
|
2005-04-24 21:16:28 +00:00
|
|
|
* Object that can be used to cancel the download.
|
|
|
|
* Will be null after the download is finished.
|
2002-03-10 05:24:48 +00:00
|
|
|
*/
|
2005-04-24 21:16:28 +00:00
|
|
|
readonly attribute nsICancelable cancelable;
|
2002-03-10 05:24:48 +00:00
|
|
|
|
|
|
|
/**
|
2004-04-17 00:58:23 +00:00
|
|
|
* The user-readable description of the transfer.
|
2002-03-10 05:24:48 +00:00
|
|
|
*/
|
2005-01-04 13:40:51 +00:00
|
|
|
readonly attribute wstring displayName;
|
2002-03-10 05:24:48 +00:00
|
|
|
|
|
|
|
/**
|
2004-04-17 00:58:23 +00:00
|
|
|
* The time a transfer was started.
|
2002-03-10 05:24:48 +00:00
|
|
|
*/
|
2002-03-15 22:58:43 +00:00
|
|
|
readonly attribute long long startTime;
|
2006-02-06 00:34:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The speed of the transfer in bytes/sec.
|
|
|
|
*/
|
|
|
|
readonly attribute double speed;
|
|
|
|
|
2002-03-10 05:24:48 +00:00
|
|
|
/**
|
2004-04-17 00:58:23 +00:00
|
|
|
* Optional. If set, it will contain the target's relevant MIME information.
|
2002-06-28 01:35:57 +00:00
|
|
|
* This includes it's MIME Type, helper app, and whether that helper should be
|
|
|
|
* executed.
|
2002-03-10 05:24:48 +00:00
|
|
|
*/
|
2002-06-28 01:35:57 +00:00
|
|
|
readonly attribute nsIMIMEInfo MIMEInfo;
|
2004-04-17 00:58:23 +00:00
|
|
|
};
|
|
|
|
|
2002-03-10 05:24:48 +00:00
|
|
|
%{C++
|
|
|
|
// {E3FA9D0A-1DD1-11B2-BDEF-8C720B597445}
|
|
|
|
#define NS_DOWNLOAD_CID \
|
|
|
|
{ 0xe3fa9d0a, 0x1dd1, 0x11b2, { 0xbd, 0xef, 0x8c, 0x72, 0x0b, 0x59, 0x74, 0x45 } }
|
2002-06-28 01:35:57 +00:00
|
|
|
%}
|