1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
23 * Blake Ross <blaker@netscape.com>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 #include
"nsIWebProgressListener2.idl"
42 interface nsICancelable
;
43 interface nsIMIMEInfo
;
44 interface nsILocalFile
;
46 [scriptable
, uuid(23c51569
-e9a1
-4a92
-adeb
-3723db82ef7c
)]
47 interface nsITransfer
: nsIWebProgressListener2
{
50 * Initializes the transfer with certain properties. This function must
51 * be called prior to accessing any properties on this interface.
53 * @param aSource The source URI of the transfer. Must not be null.
55 * @param aTarget The target URI of the transfer. Must not be null.
57 * @param aDisplayName The user-readable description of the transfer.
60 * @param aMIMEInfo The MIME info associated with the target,
61 * including MIME type and helper app when appropriate.
62 * This parameter is optional.
64 * @param startTime Time when the download started (ie, when the first
65 * response from the server was received)
66 * XXX presumably wbp and exthandler do this differently
68 * @param aTempFile The location of a temporary file; i.e. a file in which
69 * the received data will be stored, but which is not
70 * equal to the target file. (will be moved to the real
71 * target by the caller, when the download is finished)
74 * @param aCancelable An object that can be used to abort the download.
76 * Implementations are expected to hold a strong
77 * reference to this object until the download is
78 * finished, at which point they should release the
81 void init
(in nsIURI aSource
,
83 in AString aDisplayName
,
84 in nsIMIMEInfo aMIMEInfo
,
86 in nsILocalFile aTempFile
,
87 in nsICancelable aCancelable
);
92 * A component with this contract ID will be created each time a download is
93 * started, and nsITransfer::Init will be called on it and an observer will be set.
95 * Notifications of the download progress will happen via
96 * nsIWebProgressListener/nsIWebProgressListener2.
98 * INTERFACES THAT MUST BE IMPLEMENTED:
100 * nsIWebProgressListener
101 * nsIWebProgressListener2
103 * XXX move this to nsEmbedCID.h once the interfaces (and the contract ID) are
106 #define NS_TRANSFER_CONTRACTID
"@mozilla.org/transfer;1"