Bug 241082 exthandler should require just nsITransfer, not nsIDownload patch by Zbigniew Braniecki <gandalf@firefox.pl> r=biesi sr=darin

This commit is contained in:
cbiesinger@web.de 2007-08-13 18:12:12 -07:00
parent 83ced735f8
commit b0626e63bf
2 changed files with 40 additions and 107 deletions

View File

@ -36,7 +36,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsITransfer.idl"
interface nsIURI;
interface nsILocalFile;
@ -45,88 +45,7 @@ interface nsIWebBrowserPersist;
interface nsIWebProgressListener;
interface nsIMIMEInfo;
[scriptable, uuid(6ce8aba0-b159-411a-b14e-d1ae80b6aa9d)]
interface nsITransfer : nsISupports {
/**
* Initializes the transfer with certain properties. This function must
* be called prior to accessing any properties on this interface.
*
* @param aSource The source URI of the transfer.
*
* @param aTarget The target URI of the transfer.
*
* @param aDisplayName The user-readable description of the transfer.
*
* @param aMIMEInfo The MIME info associated with the target,
* including MIME type and helper app when appropriate.
* This parameter is optional.
*
* @param aPersist The "persist" used for this transfer. If set,
* the manager will set its listener to the transfer item
* and use it for cancellation. If not set, the client
* is expected to set the transfer item as the listener on
* whatever transfer component is being used, and to
* set an observer on the transfer item that listens for
* the "oncancel" topic and cancels the transfer.
*/
void init(in nsIURI aSource,
in nsIURI aTarget,
in wstring aDisplayName,
in nsIMIMEInfo aMIMEInfo,
in long long startTime,
in nsIWebBrowserPersist aPersist);
/**
* The source of the transfer.
*/
readonly attribute nsIURI source;
/**
* The target of the transfer.
*/
readonly attribute nsIURI target;
/**
* Optional. If set, it will be used for cancellation, and the transfer
* will be set as its listener. If not, |observer| should be set to listen
* and respond accordingly to topics like oncancel, and the client promises
* to set the transfer item as the listener for whatever transfer component
* is being used.
*/
readonly attribute nsIWebBrowserPersist persist;
/**
* The user-readable description of the transfer.
*/
attribute wstring displayName;
/**
* The time a transfer was started.
*/
readonly attribute long long startTime;
/**
* Optional. If set, it will contain the target's relevant MIME information.
* This includes it's MIME Type, helper app, and whether that helper should be
* executed.
*/
readonly attribute nsIMIMEInfo MIMEInfo;
/**
* Optional; transferring information is passed to this listener and used to
* update client UI.
*/
attribute nsIWebProgressListener listener;
/**
* If set, receives notifications of events like cancel ("oncancel").
* Must be set if no persist object is specified (see above).
*/
attribute nsIObserver observer;
};
[scriptable, uuid(0332d825-f3dd-4f15-abaa-e2958d396a52)]
[scriptable, uuid(4584178b-ebbd-4d5e-91d3-aa676c2291d2)]
interface nsIDownload : nsITransfer {
/**
@ -150,31 +69,45 @@ interface nsIDownload : nsITransfer {
* Unknown size is represented by 0.
*/
readonly attribute PRUint64 size;
/**
* The source of the transfer.
*/
readonly attribute nsIURI source;
/**
* The target of the transfer.
*/
readonly attribute nsIURI target;
/**
* Optional. If set, it will be used for cancellation, and the transfer
* will be set as its listener. If not, |observer| should be set to listen
* and respond accordingly to topics like oncancel, and the client promises
* to set the transfer item as the listener for whatever transfer component
* is being used.
*/
readonly attribute nsIWebBrowserPersist persist;
/**
* The user-readable description of the transfer.
*/
readonly attribute wstring displayName;
/**
* The time a transfer was started.
*/
readonly attribute long long startTime;
/**
* Optional. If set, it will contain the target's relevant MIME information.
* This includes it's MIME Type, helper app, and whether that helper should be
* executed.
*/
readonly attribute nsIMIMEInfo MIMEInfo;
};
%{C++
/**
* A component with this contract ID will be created each time a download is
* started, and Init will be called on it and an observer will be set.
*
* Notifications of the download progress will happen via
* nsIWebProgressListener.
*
* If nsIObserver is implemented, the component may get a notification with
* topic "temp-file" and an nsILocalFile instance as subject, which indicates
* the location of a temporary file; i.e. a file in which the received data will
* be stored, but which is not equal to the target file.
*
* INTERFACES THAT NEED TO BE IMPLEMENTED:
* nsITransfer
* nsIDownload
* nsIWebProgressListener
*
* INTERFACES THAT MAY BE IMPLEMENTED:
* nsIObserver
*/
#define NS_DOWNLOAD_CONTRACTID "@mozilla.org/download;1"
// {E3FA9D0A-1DD1-11B2-BDEF-8C720B597445}
#define NS_DOWNLOAD_CID \
{ 0xe3fa9d0a, 0x1dd1, 0x11b2, { 0xbd, 0xef, 0x8c, 0x72, 0x0b, 0x59, 0x74, 0x45 } }

View File

@ -62,8 +62,8 @@ interface nsIDOMWindow;
* not need to hold a reference to it.
*/
[scriptable, uuid(1915c4f1-ee57-4684-b46a-0d9f695403b4)]
interface nsIProgressDialog : nsITransfer {
[scriptable, uuid(80183bd3-b9e8-45a6-a2ee-1449bc0d4253)]
interface nsIProgressDialog : nsIDownload {
/**
* Open the dialog
*