Bug 731307 - IDL change for async file picker. r=roc, sr=mounir
authorBrian R. Bondy <netzen@gmail.com>
Fri, 17 Aug 2012 11:35:00 -0400
changeset 103014 b16ef09f140c65e1a6983e83505b536f14b952c0
parent 103013 314b3a20a88cce6da2d8a439f4cd6d51a795dcc5
child 103015 fccf7aeabfe96647c8155b3e7a4100731cf5556d
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersroc, mounir
bugs731307
milestone17.0a1
Bug 731307 - IDL change for async file picker. r=roc, sr=mounir
widget/nsIFilePicker.idl
--- a/widget/nsIFilePicker.idl
+++ b/widget/nsIFilePicker.idl
@@ -6,17 +6,29 @@
 
 #include "nsISupports.idl"
 
 interface nsIFile;
 interface nsIURI;
 interface nsIDOMWindow;
 interface nsISimpleEnumerator;
 
-[scriptable, uuid(f2c0e216-5d07-4df4-bbcb-37683077ae7e)]
+[scriptable, uuid(0d79adad-b244-49A5-9997-2a8cad93fc44)]
+interface nsIFilePickerShownCallback : nsISupports
+{
+ /**
+  * Callback which is called when a filepicker is shown and a result
+  * is returned.
+  *
+  * @param aResult One of returnOK, returnCancel, or returnReplace
+  */
+  void done(in short aResult);
+};
+
+[scriptable, uuid(60e2dfb6-3fc7-4A2C-8137-16bef44536fc)]
 interface nsIFilePicker : nsISupports
 {
   const short modeOpen        = 0;              // Load a file or directory
   const short modeSave        = 1;              // Save a file or directory
   const short modeGetFolder   = 2;              // Select a folder/directory
   const short modeOpenMultiple= 3;              // Load multiple files
 
   const short returnOK        = 0;              // User hit Ok, process selection
@@ -138,10 +150,18 @@ interface nsIFilePicker : nsISupports
   attribute boolean addToRecentDocs;
 
  /**
   * Show File Dialog. The dialog is displayed modally.
   *
   * @return returnOK if the user selects OK, returnCancel if the user selects cancel
   *
   */
-  short show();
+  [deprecated] short show();
+
+
+ /**
+  * Opens the file dialog asynchrounously.
+  * The passed in object's done method will be called upon completion.
+  */
+  void open(in nsIFilePickerShownCallback aFilePickerShownCallback);
+
 };