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 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Blake Ross <blaker@netscape.com>
00024  *   Ben Goodger <ben@netscape.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 // Keeps track of ongoing downloads, in the form of nsIDownload's. 
00041 
00042 #include "nsISupports.idl"
00043 
00044 interface nsIDOMWindow;
00045 interface nsIURI;
00046 interface nsILocalFile;
00047 interface nsIDownload;
00048 interface nsICancelable;
00049 interface nsIMIMEInfo;
00050 interface nsIRDFDataSource;
00051 interface nsIDownloadProgressListener;
00052 interface nsISupportsArray;
00053 
00054 [scriptable, uuid(1f280341-30f4-4009-bb0d-a78f2936d1fb)]
00055 interface nsIDownloadManager : nsISupports {
00056   // Download States
00057   const short DOWNLOAD_NOTSTARTED       = -1;
00058   const short DOWNLOAD_DOWNLOADING      = 0;
00059   const short DOWNLOAD_FINISHED         = 1;
00060   const short DOWNLOAD_FAILED           = 2;
00061   const short DOWNLOAD_CANCELED         = 3;
00062   const short DOWNLOAD_PAUSED           = 4;
00063 
00064   const short DOWNLOAD_TYPE_DOWNLOAD    = 0;
00065 
00066   // Methods called by clients to carry out various managing functions
00067 
00095   nsIDownload addDownload(in short aDownloadType, 
00096                           in nsIURI aSource,
00097                           in nsIURI aTarget,
00098                           in AString aDisplayName,
00099                           in AString aIconURL,
00100                           in nsIMIMEInfo aMIMEInfo,
00101                           in PRTime aStartTime,
00102                           in nsILocalFile aTempFile,
00103                           in nsICancelable aCancelable);
00104 
00116   nsIDownload getDownload(in wstring aPersistentDescriptor);
00117 
00126   void cancelDownload(in wstring aPersistentDescriptor);
00127 
00136   void removeDownload(in wstring aPersistentDescriptor);
00137 
00141   void pauseDownload(in wstring aPersistentDescriptor);
00142 
00146   void resumeDownload(in wstring aPersistentDescriptor);
00147 
00148   // Front end and Front end update methods. 
00149 
00159   void open(in nsIDOMWindow aParent, in wstring aPersistentDescriptor);
00160 
00164   attribute nsIDownloadProgressListener listener;
00165 
00170   void startBatchUpdate();
00171   
00176   void endBatchUpdate();
00177 
00178   // Downloads list book-keeping
00179 
00184   readonly attribute boolean canCleanUp;
00185 
00189   void cleanUp();
00190 
00194   readonly attribute long activeDownloadCount;
00195 
00199   readonly attribute nsISupportsArray activeDownloads;
00200 
00204   void saveState();
00205 
00209   void flush();
00210 
00211   readonly attribute nsIRDFDataSource datasource;
00212 };
00213 
00214