New files for proper progress dialog component; needed for fix for bugs 27609, et al. NOT BUILT YET
authorlaw@netscape.com
Mon, 13 Aug 2007 18:12:05 -0700
changeset 4587 fd843d9a910b
parent 4586 b8c98c50373d
child 4588 6b21cc90948b
push id1
push userbsmedberg@mozilla.com
push date2008-03-20 16:49 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs27609
milestone1.9a8pre
New files for proper progress dialog component; needed for fix for bugs 27609, et al. NOT BUILT YET
xpfe/components/download-manager/public/nsIProgressDialog.idl
new file mode 100644
--- /dev/null
+++ b/xpfe/components/download-manager/public/nsIProgressDialog.idl
@@ -0,0 +1,114 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * The contents of this file are subject to the Netscape 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/NPL/
+ *
+ * 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.
+ *
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation.  Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All
+ * Rights Reserved.
+ *
+ * Contributor(s): 
+ *  Bill Law    law@netscape.com
+ */
+
+#include "nsIWebProgressListener.idl"
+
+interface nsIWebBrowserPersist;
+interface nsIDOMWindow;
+interface nsILocalFile;
+
+/* nsIProgressDialog
+ *
+ * These objects are used to display progress notifications to the user.
+ * They are displayed while files are being saved to disk, for example.
+ * 
+ * Typical usage is to:
+ *   1. Create an instance, via the component manager CreateInstance()
+ *      method.
+ *   2. Set appropriate attributes that control the display and behavior
+ *      of the dialog.
+ *   3. Open the dialog.
+ *   4. Send progress notifications to the dialog, via it's 
+ *      nsIWebProgressListener methods.
+ *   5. Close the dialog when the operation completes, or when the user
+ *      closes it manually.
+ *   6. Release the instance.  The instance will be referenced by
+ *      the dialog itself, so it won't get freed until the dialog closes.
+ *
+ * Important Note: Implementors of this interface must also implement
+ *                 nsISupportsWeakReference.
+ */
+
+[scriptable, uuid(88A478B3-AF65-440a-94DC-ED9B154D2990)]
+interface nsIProgressDialog : nsIWebProgressListener {
+   /**
+    * Open the dialog
+    *
+    * @param aParent  Parent window; optional (if null, then
+    *                 a top-level window is created)
+    * @param aPersist The stream transfer operation that the dialog is
+    *                 to show progress for.  This is optional.  If
+    *                 specified, then the progress dialog will register
+    *                 itself as the listener for that object.  Otherwise,
+    *                 it is the caller's responsibility to connect this
+    *                 object to something that sends out the web progress
+    *                 notifications.
+    */
+   void open( in nsIDOMWindow aParent, in nsIWebBrowserPersist aPersist );
+
+   /**
+    * Set starting time to use in elapsed/remaining time calculations;
+    * this is useful in cases where the download might have started
+    * prior to the dialog opening; the time is specified as
+    * milliseconds, according to the convention for the JavaScript Date 
+    * object getTime function; if not specified, this value will default
+    * to the time at which the progress dialog object is created.
+    */
+   attribute long long startTime;
+
+   /**
+    * URL of the source of the stream transfer that the dialog is 
+    * displaying the progress of.
+    */
+   attribute nsIURI source;
+
+   /**
+    * Target of the stream transfer that the dialog is
+    * displaying the progress of.
+    */
+   attribute nsILocalFile target;
+
+   /**
+    * Set this attribute to indicate that the dialog is being
+    * used to display progress prior to opening a downloaded
+    * file with a helper application.  The application string
+    * specified will appear on the dialog, unless the string
+    * is empty.  This will also cause the "keep this dialog
+    * open after download" checkbox hidden.
+    */
+   attribute wstring openingWith;
+
+   /**
+    * The web browser persist object doing the associated I/O.
+    * May be null.
+    */
+   readonly attribute nsIWebBrowserPersist operation;
+
+   /**
+    * The dialog object itself.  This might be null if the dialog isn't
+    * open yet, or has been closed.
+    */
+   readonly attribute nsIDOMWindow dialog;
+};
+
+