Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsIFilePicker Interface Reference

import "nsIFilePicker.idl";

Inheritance diagram for nsIFilePicker:
Inheritance graph
[legend]
Collaboration diagram for nsIFilePicker:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void init (in nsIDOMWindow parent, in AString title, in short mode)
 Initialize the file picker widget.
void appendFilters (in long filterMask)
 Append to the filter list with things from the predefined list.
void appendFilter (in AString title, in AString filter)
 Add a filter.
short show ()
 Show File Dialog.

Public Attributes

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 = 0x01
const long filterHTML = 0x02
const long filterText = 0x04
const long filterImages = 0x08
const long filterXML = 0x10
const long filterXUL = 0x20
const long filterApps = 0x40
attribute AString defaultString
 The filename that should be suggested to the user as a default.
attribute AString defaultExtension
 The extension that should be associated with files of the type we want to work with.
attribute long filterIndex
 The filter which is currently selected in the File Picker dialog.
attribute nsILocalFile displayDirectory
 Set the directory that the file open/save dialog initially displays.
readonly attribute nsILocalFile file
 Get the nsILocalFile for the file or directory.
readonly attribute nsIFileURL fileURL
 Get the nsIFileURL for the file or directory.
readonly attribute
nsISimpleEnumerator 
files
 Get the enumerator for the selected files only works in the modeOpenMultiple mode.

Detailed Description

Definition at line 48 of file nsIFilePicker.idl.


Member Function Documentation

void nsIFilePicker::appendFilter ( in AString  title,
in AString  filter 
)

Add a filter.

Parameters:
titlename of the filter
filterextensions to filter -- semicolon and space separated

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

Parameters:
filtersmask of filters i.e. (filterAll | filterHTML)
void nsIFilePicker::init ( in nsIDOMWindow  parent,
in AString  title,
in short  mode 
)

Initialize the file picker widget.

The file picker is not valid until this method is called.

Parameters:
parentnsIDOMWindow parent. This dialog will be dependent on this parent. parent must be non-null.
titleThe title for the file widget
modeload, save, or get folder

Show File Dialog.

The dialog is displayed modally.

Returns:
returnOK if the user selects OK, returnCancel if the user selects cancel

Member Data Documentation

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.

Definition at line 109 of file nsIFilePicker.idl.

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

Exceptions:
NS_ERROR_FAILUREon attempts to get

Definition at line 102 of file nsIFilePicker.idl.

Set the directory that the file open/save dialog initially displays.

Parameters:
displayDirectorythe name of the directory

Definition at line 124 of file nsIFilePicker.idl.

Get the nsILocalFile for the file or directory.

Returns:
Returns the file currently selected

Definition at line 132 of file nsIFilePicker.idl.

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

Returns:
Returns the files currently selected

Definition at line 147 of file nsIFilePicker.idl.

Get the nsIFileURL for the file or directory.

Returns:
Returns the file currently selected

Definition at line 139 of file nsIFilePicker.idl.

Definition at line 59 of file nsIFilePicker.idl.

Definition at line 65 of file nsIFilePicker.idl.

Definition at line 60 of file nsIFilePicker.idl.

Definition at line 62 of file nsIFilePicker.idl.

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.

Definition at line 116 of file nsIFilePicker.idl.

Definition at line 61 of file nsIFilePicker.idl.

Definition at line 63 of file nsIFilePicker.idl.

Definition at line 64 of file nsIFilePicker.idl.

Definition at line 52 of file nsIFilePicker.idl.

Definition at line 50 of file nsIFilePicker.idl.

Definition at line 53 of file nsIFilePicker.idl.

Definition at line 51 of file nsIFilePicker.idl.

Definition at line 56 of file nsIFilePicker.idl.

Definition at line 55 of file nsIFilePicker.idl.

Definition at line 57 of file nsIFilePicker.idl.


The documentation for this interface was generated from the following file: