Interface nsIFilePickerType

Hierarchy

Properties

addToRecentDocs: boolean

Controls whether the chosen file(s) should be added to the system's recent documents list. This attribute will be ignored if the system has no "Recent Docs" concept, or if the application is in private browsing mode (in which case the file will not be added). Defaults to true.

capture: nsIFilePicker_CaptureTarget

Implementation of HTMLInputElement's capture property.

Not used by Firefox Desktop.

defaultExtension: string

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.

defaultString: string

The filename that should be suggested to the user as a default. This should include the extension.

Throws

NS_ERROR_FAILURE on attempts to get

displayDirectory: nsIFile

Set the directory that the file open/save dialog initially displays Note that, if displaySpecialDirectory has been already set, this value will be ignored.

Param

the name of the directory

displaySpecialDirectory: string

Set the directory that the file open/save dialog initially displays using one of the special name as such as 'Desk', 'TmpD', and so on. Note that, if displayDirectory has been already set, this value will be ignored.

Param

the name of the special directory

domFileOrDirectory: nsISupports

Get the DOM File or the DOM Directory

Returns

Returns the file or directory currently selected DOM object.

domFileOrDirectoryEnumerator: nsISimpleEnumerator

Get the enumerator for the selected files or directories only works in the modeOpenMultiple mode

Returns

Returns the files/directories currently selected as DOM object.

file: nsIFile

Get the nsIFile for the file or directory.

Returns

Returns the file currently selected

fileURL: nsIURI

Get the nsIURI for the file or directory.

Returns

Returns the file currently selected

files: nsISimpleEnumerator

Get the enumerator for the selected files only works in the modeOpenMultiple mode

Returns

Returns the files currently selected

filterIndex: number

The filter which is currently selected in the File Picker dialog

Returns

Returns the index (0 based) of the selected filter in the filter list.

mode: nsIFilePicker_Mode

The picker's mode, as set by the 'mode' argument passed to init() (one of the modeOpen et. al. constants specified above).

okButtonLabel: string

If set to non-empty string, the nsIFilePicker implementation may use okButtonLabel as the label for the button the user uses to accept file selection.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Add a filter

    Parameters

    • title: string

      name of the filter

    • filter: string

      extensions to filter -- semicolon and space separated

    Returns void

  • Append to the filter list with things from the predefined list

    Parameters

    • filterMask: number

    Returns void

  • Add a raw filter (eg, add a MIME type without transforming it to a list of extensions).

    Parameters

    • filter: string

      a filter taken directly from the accept attribute without processing

    Returns void

  • Initialize the file picker widget. The file picker is not valid until this method is called.

    Parameters

    • parent: mozIDOMWindowProxy

      mozIDOMWindow parent. This dialog will be dependent on this parent. parent must be non-null.

    • title: string

      The title for the file widget

    • mode: nsIFilePicker_Mode

      load, save, or get folder

    Returns void

  • Opens the file dialog asynchrounously. The passed in object's done method will be called upon completion.

    Parameters

    • aFilePickerShownCallback: nsIFilePickerShownCallback

    Returns void

Generated using TypeDoc