LibreOffice LibreOffice 25.2 SDK API Reference

Public Member Functions | List of all members
XFilePicker Interface Referencepublished

Specifies an interface for a FilePicker. More...

`import"XFilePicker.idl";`

Inheritance diagram for XFilePicker:

## Public Member Functions
void | setMultiSelectionMode ([in] boolean bMode)
| Enable/disable multi-selection mode. More...
void | setDefaultName ([in] string aName)
| Sets the default string that appears in the file name box of a FilePicker. More...
void | setDisplayDirectory ([in] string aDirectory) raises ( ::com::sun::star::lang::IllegalArgumentException )
| Sets the directory that the file dialog initially displays. More...
string | getDisplayDirectory ()
| Returns the directory that the file dialog is currently showing or was last showing before closing the dialog with Ok. More...
sequence< string > | getFiles ()
| Returns a sequence of the selected files including path information in URL format, conforming to Rfc1738. More...
Public Member Functions inherited from XExecutableDialog
void | setTitle ([in] string aTitle)
| Sets the title of the dialog. More...
short | execute ()
| Executes (shows) the dialog. More...
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object. More...
void | acquire ()
| increases the reference counter by one. More...
void | release ()
| decreases the reference counter by one. More...

## Detailed Description

Specifies an interface for a FilePicker.

## Member Function Documentation

## ◆ getDisplayDirectory()

string getDisplayDirectory | ( |  | ) |

Returns the directory that the file dialog is currently showing or was last showing before closing the dialog with Ok.

If the user did cancel the dialog, the returned value is undefined.

Returns
  The directory in URL format, must conform to Rfc1738.

## ◆ getFiles()

sequence< string > getFiles | ( |  | ) |

Returns a sequence of the selected files including path information in URL format, conforming to Rfc1738.

If the user closed the dialog with cancel an empty sequence will be returned.

If the dialog is in execution mode and a single file is selected the complete URL of this file will be returned.

If the dialog is in execution mode and the selected file name is false or any other error occurs an empty sequence will be returned.

Returns

The complete path of the file or directory currently selected in URL format. This always returns only the first entry of the sequence.

Notes for the implementation of a FileSave dialog:If there exists a checkbox "Automatic File Extension" which is checked and a valid filter is currently selected the dialog may automatically add an extension to the selected file name.

Deprecated:
  use com::sun::star::ui::dialogs::XFilePicker2::getSelectedFiles instead

## ◆ setDefaultName()

void setDefaultName | ( | [in] string | aName | ) |

Sets the default string that appears in the file name box of a FilePicker.

Parameters

  aName |

Specifies the default file name, displayed when the FilePicker is shown. The implementation may accept any string, and does not have to check for a valid file name or if the file really exists.

## ◆ setDisplayDirectory()

void setDisplayDirectory | ( | [in] string | aDirectory | ) |
raises | ( | ::com::sun::star::lang::IllegalArgumentException
| ) |  |

Sets the directory that the file dialog initially displays.

Parameters

  aDirectory | Specifies the initial directory in URL format. The given URL must conform to Rfc1738).

Exceptions

  com::sun::star::lang::IllegalArgumentException | if the URL is invalid (doesn't conform to Rfc1738).

## ◆ setMultiSelectionMode()

void setMultiSelectionMode | ( | [in] boolean | bMode | ) |

Enable/disable multi-selection mode.

If the multi-selection mode is enabled, multiple files may be selected by the user else only one file selection at a time is possible

Parameters

  bMode |

A value of `TRUE` enables the multi-selection mode.

A value of `FALSE` disables the multi-selection mode, this is the default.

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

- com/sun/star/ui/dialogs/XFilePicker.idl