#include <kfiledialog.h>
Inheritance diagram for KFileDialog:

Public Types | |
| enum | OperationMode |
Signals | |
| void | fileSelected (const QString &) |
| void | fileHighlighted (const QString &) |
| void | selectionChanged () |
| void | filterChanged (const QString &filter) |
Public Methods | |
| KFileDialog (const QString &startDir, const QString &filter, QWidget *parent, const char *name, bool modal) | |
| KFileDialog (const QString &startDir, const QString &filter, QWidget *parent, const char *name, bool modal, QWidget *widget) | |
| ~KFileDialog () | |
| KURL | selectedURL () const |
| KURL::List | selectedURLs () const |
| KURL | baseURL () const |
| QString | selectedFile () const |
| QStringList | selectedFiles () const |
| void | setURL (const KURL &url, bool clearforward=true) |
| void | setSelection (const QString &name) |
| void | setOperationMode (KFileDialog::OperationMode) |
| OperationMode | operationMode () const |
| void | setKeepLocation (bool keep) |
| bool | keepsLocation () const |
| void | setFilter (const QString &filter) |
| QString | currentFilter () const |
| void | setFilterMimeType (const QString &label, const KMimeType::List &types, const KMimeType::Ptr &defaultType) |
| KMimeType::Ptr | currentFilterMimeType () |
| void | setMimeFilter (const QStringList &types, const QString &defaultType=QString::null) |
| QString | currentMimeFilter () const |
| void | clearFilter () |
| void | setPreviewWidget (const QWidget *w) |
| void | setPreviewWidget (const KPreviewWidgetBase *w) |
| virtual void | show () |
| void | setMode (KFile::Mode m) |
| void | setMode (unsigned int m) |
| KFile::Mode | mode () const |
| void | setLocationLabel (const QString &text) |
| KToolBar * | toolBar () const |
| KPushButton * | okButton () const |
| KPushButton * | cancelButton () const |
| KActionCollection * | actionCollection () const |
| int | pathComboIndex () |
Static Public Methods | |
| QString | getOpenFileName (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null) |
| QStringList | getOpenFileNames (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null) |
| KURL | getOpenURL (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null) |
| KURL::List | getOpenURLs (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null) |
| QString | getSaveFileName (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null) |
| KURL | getSaveURL (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null) |
| QString | getExistingDirectory (const QString &startDir=QString::null, QWidget *parent=0, const QString &caption=QString::null) |
| KURL | getExistingURL (const QString &startDir=QString::null, QWidget *parent=0, const QString &caption=QString::null) |
| KURL | getImageOpenURL (const QString &startDir=QString::null, QWidget *parent=0, const QString &caption=QString::null) |
| KURL | getStartURL (const QString &startDir, QString &recentDirClass) |
Protected Slots | |
| void | toolbarCallback (int) |
| void | toggleSpeedbar (bool) |
| virtual void | updateStatusLine (int dirs, int files) |
| virtual void | slotOk () |
| virtual void | slotCancel () |
Protected Methods | |
| void | addDirEntry (KFileItem *entry, bool disableUpdating) |
| void | init (const QString &startDir, const QString &filter, QWidget *widget) |
| virtual void | initGUI () |
| void | multiSelectionChanged () |
| virtual void | readConfig (KConfig *, const QString &group=QString::null) |
| virtual void | writeConfig (KConfig *, const QString &group=QString::null) |
| virtual void | readRecentFiles (KConfig *) |
| virtual void | saveRecentFiles (KConfig *) |
| KURL::List | tokenize (const QString &line) const |
| virtual void | virtual_hook (int id, void *data) |
Provides a user (and developer) friendly way to select files and directories.
The widget can be used as a drop in replacement for the QFileDialog widget, but has greater functionality and a nicer GUI.
You will usually want to use one of the static methods getOpenFileName(), getSaveFileName(), getOpenURL() or for multiple files getOpenFileNames() or getOpenURLs().
The dialog has been designed to allow applications to customise it by subclassing. It uses geometry management to ensure that subclasses can easily add children that will be incorporated into the layout.
KDE File Dialog
Definition at line 77 of file kfiledialog.h.
|
|
Defines some default behavior of the filedialog. E.g. in mode
Definition at line 93 of file kfiledialog.h. |
|
||||||||||||||||||||||||
|
Constructs a file dialog.
|
|
||||||||||||||||||||||||||||
|
Constructs a file dialog. The parameters here are identical to the first constructor except for the addition of a QWidget parameter. Historical note: The original version of KFileDialog did not have this extra parameter. It was added later, and, in order to maintain binary compatibility, it was placed in a new constructor instead of added to the original one.
|
|
|
Destructs the file dialog. |
|
|
|
|
||||||||||||
|
adds a entry of the current directory. If disableUpdating is set to true, it will care about clever updating |
|
|
|
|
|
|
|
|
Clears any mime- or namefilter. Does not reload the directory. |
|
|
Returns the current filter as entered by the user or one of the predefined set via setFilter().
|
|
|
Returns the mimetype for the desired output format. This is only valid if setFilterMimeType() has been called previously.
|
|
|
The mimetype for the desired output format. This is only valid if setMimeFilter() has been called previously.
|
|
|
Emitted when the user highlights a file. |
|
|
Emitted when the user selects a file. It is only emitted in single- selection mode. The best way to get notified about selected file(s) is to connect to the okClicked() signal inherited from KDialogBase and call selectedFile(), selectedFiles(), selectedURL() or selectedURLs(). |
|
|
Emitted when the filter changed, i.e. the user entered an own filter or chose one of the predefined set via setFilter().
|
|
||||||||||||||||
|
Creates a modal file dialog and returns the selected directory or an empty string if none was chosen.
|
|
||||||||||||||||
|
Creates a modal file dialog and returns the selected directory or an empty string if none was chosen. Contrary to getExistingDirectory(), this method allows the selection of a remote directory.
|
|
||||||||||||||||
|
Creates a modal file dialog with an image previewer and returns the selected url or an empty string if none was chosen.
|
|
||||||||||||||||||||
|
Creates a modal file dialog and return the selected filename or an empty string if none was chosen. Note that with this method the user must select an existing filename.
|
|
||||||||||||||||||||
|
Creates a modal file dialog and returns the selected filenames or an empty list if none was chosen. Note that with this method the user must select an existing filename.
|
|
||||||||||||||||||||
|
Creates a modal file dialog and returns the selected URL or an empty string if none was chosen. Note that with this method the user must select an existing URL.
|
|
||||||||||||||||||||
|
Creates a modal file dialog and returns the selected URLs or an empty list if none was chosen. Note that with this method the user must select an existing filename.
|
|
||||||||||||||||||||
|
Creates a modal file dialog and returns the selected filename or an empty string if none was chosen. Note that with this method the user need not select an existing filename.
|
|
||||||||||||||||||||
|
Creates a modal file dialog and returns the selected filename or an empty string if none was chosen. Note that with this method the user need not select an existing filename.
|
|
||||||||||||
|
This method implements the logic to determine the user's default directory to be listed. E.g. the documents direcory, home directory or a recently used directory.
|
|
||||||||||||||||
|
Perform basic initialization tasks. Called by constructors.
|
|
|
rebuild geometry managment. |
|
|
|
|
|
Returns the mode of the filedialog.
|
|
|
called when an item is highlighted/selected in multiselection mode. handles setting the locationEdit. |
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
Reads configuration and applies it (size, recent directories, ...) |
|
|
Reads the recent used files and inserts them into the location combobox |
|
|
Saves the entries from the location combobox. |
|
|
Returns the full path of the selected file in the local filesystem. (Local files only) |
|
|
Returns a list of all selected local files. |
|
|
|
|
|
|
|
|
Emitted when the user hilights one or more files in multiselection mode. Note: fileHighlighted() or fileSelected() are not emitted in multiselection mode. You may use selectedItems() to ask for the current highlighted items.
|
|
|
Sets the filter to be used to
You can set more filters for the user to select seperated by '
Note: The text to display is not parsed in any way. So, if you want to show the suffix to select by a specific filter, you must repeat it. If the filter contains an unescaped '/', a mimetype-filter is assumed. If you would like a '/' visible in your filter it can be escaped with a '\'. You can specify multiple mimetypes like this (separated with space):
|
|
||||||||||||||||
|
Sets the filter up to specify the output type.
|
|
|
Sets whether the filename/url should be kept when changing directories. This is for example useful when having a predefined filename where the full path for that file is searched. This is implicitly set when operationMode() is KFileDialog::Saving getSaveFileName() and getSaveURL() set this to true by default, so that you can type in the filename and change the directory without having to type the name again. |
|
|
Sets the text to be displayed in front of the selection. The default is "Location". Most useful if you want to make clear what the location is used for. |
|
||||||||||||
|
Sets the filter up to specify the output type.
|
|
|
Sets the mode of the dialog.
The mode is defined as (in kfile.h): |
|
|
|
|
|
Sets the operational mode of the filedialog to
The mode
The default mode is Call this method right after instantiating KFileDialog.
|
|
|
Adds a preview widget and enters the preview mode. In this mode the dialog is split and the right part contains your preview widget. Ownership is transferred to KFileDialog. You need to create the preview-widget with "new", i.e. on the heap.
|
|
|
In this mode the dialog is split and the right part contains your widget. This widget has to inherit QWidget and it has to implement a slot showPreview(const KURL &); which is called every time the file changes. You may want to look at koffice/lib/kofficecore/koFilterManager.cc for some hints :) Ownership is transferred to KFileDialog. You need to create the preview-widget with "new", i.e. on the heap. |
|
|
Sets the file name to preselect to This takes absolute URLs and relative file names. |
|
||||||||||||
|
Sets the directory to view.
|
|
|
@reimplemented |
|
|
Activated when the Cancel button has been clicked. The QDialog::reject() is activated in regular mode and QDialog::done( Cancel ) when in message box mode. Reimplemented from KDialogBase. |
|
|
Activated when the Ok button has been clicked. The QDialog::accept() is activated. Reimplemented from KDialogBase. |
|
|
|
|
|
Parses the string "line" for files. If line doesn't contain any ", the whole line will be interpreted as one file. If the number of " is odd, an empty list will be returned. Otherwise, all items enclosed in " " will be returned as correct urls. |
|
|
Returns a pointer to the toolbar.
You can use this to insert custom items into it, e.g.: Definition at line 695 of file kfiledialog.h. |
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
Saves the current configuration |
1.2.18