Back to index

lightning-sunbird  0.9+nobinonly
nsIDownloadManager.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* vim:set ts=2 sw=2 sts=2 et: */
00003 /* ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is mozilla.org code.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 1998
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Blake Ross <blaker@netscape.com>
00025  *   Ben Goodger <ben@netscape.com>
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either of the GNU General Public License Version 2 or later (the "GPL"),
00029  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 
00041 // Keeps track of ongoing downloads, in the form of nsIDownload's. 
00042 
00043 #include "nsISupports.idl"
00044 
00045 interface nsIDOMWindow;
00046 interface nsIURI;
00047 interface nsILocalFile;
00048 interface nsIDownload;
00049 interface nsICancelable;
00050 interface nsIMIMEInfo;
00051 
00052 [scriptable, uuid(9cdfcea3-fbe4-4ba1-a0fd-fe273097ddfa)]
00053 interface nsIDownloadManager : nsISupports {
00054 
00055   // Methods called by clients to carry out various managing functions
00056 
00084   nsIDownload addDownload(in nsIURI aSource,
00085                           in nsIURI aTarget,
00086                           in AString aDisplayName,
00087                           in nsIMIMEInfo aMIMEInfo,
00088                           in PRTime startTime,
00089                           in nsILocalFile aTempFile,
00090                           in nsICancelable aCancelable);
00091 
00099   nsIDownload getDownload(in AUTF8String aTargetPath);
00100 
00112   void cancelDownload(in AUTF8String aTargetPath);
00113 
00127   void pauseDownload(in nsIDownload aDownload);
00128 
00144   void resumeDownload(in AUTF8String aTargetPath);
00145 
00154   void removeDownload(in AUTF8String aTargetPath);
00155 
00156   // UI-related methods
00157 
00166   void open(in nsIDOMWindow aParent, in nsIDownload aDownload);
00167 
00180   void openProgressDialogFor(in nsIDownload aDownload,
00181                              in nsIDOMWindow aParent,
00182                              in boolean aCancelDownloadOnClose);
00183 
00189   void onClose();
00190   
00195   void startBatchUpdate();
00196   
00201   void endBatchUpdate();
00202 };
00203 
00204 
00205 %{C++
00206 #define NS_DOWNLOADMANAGER_CONTRACTID "@mozilla.org/download-manager;1"
00207 #define NS_DOWNLOADMANAGER_CLASSNAME "Mozilla Download Manager"
00208 // {EDB0490E-1DD1-11B2-83B8-DBF8D85906A6}
00209 #define NS_DOWNLOADMANAGER_CID \
00210     { 0xedb0490e, 0x1dd1, 0x11b2, { 0x83, 0xb8, 0xdb, 0xf8, 0xd8, 0x59, 0x06, 0xa6 } }
00211 %}