Implemented by
[scriptable, uuid(80faf095-c807-4558-a2cc-185ed70754ea)]
interface nsIFilePicker : nsISupports
Constants
const
short
modeOpen = 0
const
short
modeSave = 1
const
short
modeGetFolder = 2
const
short
modeOpenMultiple = 3
const
short
returnOK = 0
const
short
returnCancel = 1
const
short
returnReplace = 2
const
long
filterAll = 1
const
long
filterHTML = 2
const
long
filterText = 4
const
long
filterImages = 8
const
long
filterXML = 16
const
long
filterXUL = 32
const
long
filterApps = 64
Attributes
The extension that should be associated with files of the type we want to work with. On some platforms, this extension will be automatically appended to filenames the user enters, if needed.
attribute
AString
defaultExtension
The filename that should be suggested to the user as a default. @throws NS_ERROR_FAILURE on attempts to get
attribute
AString
defaultString
Set the directory that the file open/save dialog initially displays @param displayDirectory the name of the directory
attribute
nsILocalFile
displayDirectory
Get the nsILocalFile for the file or directory. @return Returns the file currently selected
readonly attribute
nsILocalFile
file
Get the enumerator for the selected files only works in the modeOpenMultiple mode @return Returns the files currently selected
readonly attribute
nsISimpleEnumerator
files
Get the nsIFileURL for the file or directory. @return Returns the file currently selected
readonly attribute
nsIFileURL
fileURL
The filter which is currently selected in the File Picker dialog @return Returns the index (0 based) of the selected filter in the filter list.
attribute
long
filterIndex
Methods
Add a filter @param title name of the filter @param filter extensions to filter -- semicolon and space separated
void
appendFilter(in AString title, in AString filter)
Append to the filter list with things from the predefined list @param filters mask of filters i.e. (filterAll | filterHTML)
void
appendFilters(in long filterMask)
Initialize the file picker widget. The file picker is not valid until this
method is called.
@param parent nsIDOMWindow parent. This dialog will be dependent
on this parent. parent must be non-null.
@param title The title for the file widget
@param mode load, save, or get folder
void
init(in nsIDOMWindow parent, in AString title, in short mode)
Show File Dialog. The dialog is displayed modally. @return returnOK if the user selects OK, returnCancel if the user selects cancel
short
show()
Compare to: