KEncodingFileDialog Class Reference

`#include <kencodingfiledialog.h>`

Inheritance diagram for KEncodingFileDialog:

## Public Member Functions

| KEncodingFileDialog (const QString &startDir=QString::null, const QString &encoding=QString::null, const QString &filter=QString::null, const QString &caption=QString::null, KFileDialog::OperationMode type=KFileDialog::Opening, QWidget *parent=0, const char *name="", bool modal=true)
| ~KEncodingFileDialog ()
QString | selectedEncoding () const
Public Member Functions inherited from KFileDialog
| 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) KDE_DEPRECATED
KMimeType::Ptr | currentFilterMimeType ()
void | setMimeFilter (const QStringList &types, const QString &defaultType=QString::null)
QString | currentMimeFilter () const
void | clearFilter ()
void | setPreviewWidget (const QWidget *w) KDE_DEPRECATED
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
KURLBar * | speedBar ()
KActionCollection * | actionCollection () const
int | pathComboIndex ()

## Static Public Member Functions

static Result | getOpenFileNameAndEncoding (const QString &encoding=QString::null, const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static Result | getOpenFileNamesAndEncoding (const QString &encoding=QString::null, const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static Result | getOpenURLAndEncoding (const QString &encoding=QString::null, const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static Result | getOpenURLsAndEncoding (const QString &encoding=QString::null, const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static Result | getSaveFileNameAndEncoding (const QString &encoding=QString::null, const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static Result | getSaveURLAndEncoding (const QString &encoding=QString::null, const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
Static Public Member Functions inherited from KFileDialog
static QString | getOpenFileName (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static QString | getOpenFileNameWId (const QString &startDir, const QString &filter, WId parent_id, const QString &caption)
static QStringList | getOpenFileNames (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static KURL | getOpenURL (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static KURL::List | getOpenURLs (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static QString | getSaveFileName (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static QString | getSaveFileNameWId (const QString &dir, const QString &filter, WId parent_id, const QString &caption)
static KURL | getSaveURL (const QString &startDir=QString::null, const QString &filter=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static QString | getExistingDirectory (const QString &startDir=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static KURL | getExistingURL (const QString &startDir=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static KURL | getImageOpenURL (const QString &startDir=QString::null, QWidget *parent=0, const QString &caption=QString::null)
static KURL | getStartURL (const QString &startDir, QString &recentDirClass)
static void | setStartDir (const KURL &directory)

## Protected Member Functions

virtual void | virtual_hook (int id, void *data)
Protected Member Functions inherited from KFileDialog
virtual void | keyPressEvent (QKeyEvent *e)
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
KURL | getCompleteURL (const QString &)
QString | currentFilterExtension ()
void | updateAutoSelectExtension ()
KURL::List & | parseSelectedURLs () const

## Additional Inherited Members

Public Types inherited from KFileDialog
enum | OperationMode { Other = 0, Opening, Saving }
Signals inherited from KFileDialog
void | fileSelected (const QString &)
void | fileHighlighted (const QString &)
void | selectionChanged ()
void | filterChanged (const QString &filter)
Protected Slots inherited from KFileDialog
void | urlEntered (const KURL &)
void | enterURL (const KURL &url)
void | enterURL (const QString &url)
void | locationActivated (const QString &url)
void | toolbarCallback (int)
void | pathComboChanged (const QString &)
void | dirCompletion (const QString &)
void | slotFilterChanged ()
void | fileHighlighted (const KFileItem *i)
void | fileSelected (const KFileItem *i)
void | slotStatResult (KIO::Job *job)
void | slotLoadingFinished ()
void | fileCompletion (const QString &)
void | toggleSpeedbar (bool)
void | toggleBookmarks (bool show)
virtual void | updateStatusLine (int dirs, int files)
virtual void | slotOk ()
virtual void | accept ()
virtual void | slotCancel ()
void | slotAutoSelectExtClicked ()
void | addToRecentDocuments ()
void | initSpeedbar ()
Protected Attributes inherited from KFileDialog
KToolBar * | toolbar
KURLComboBox * | locationEdit
KFileFilterCombo * | filterWidget
KDirOperator * | ops
bool | autoDirectoryFollowing
Static Protected Attributes inherited from KFileDialog
static KURL * | lastDirectory

## Detailed Description

Provides a user (and developer) friendly way to select files with support for choosing encoding.

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.

Definition at line 39 of file kencodingfiledialog.h.

## Constructor & Destructor Documentation

KEncodingFileDialog::KEncodingFileDialog | ( | const QString & | startDir = `QString::null`,
|  | const QString & | encoding = `QString::null`,
|  | const QString & | filter = `QString::null`,
|  | const QString & | caption = `QString::null`,
|  | KFileDialog::OperationMode | type = `KFileDialog::Opening`,
|  | QWidget * | parent = `0`,
|  | const char * | name = `""`,
|  | bool | modal = `true`
| ) |  |

Constructs a file dialog for text files with encoding selection possibility.

Parameters

  startDir

  This can either be
  - The URL of the directory to start in.
  - QString::null to start in the current working directory, or the last directory where a file has been selected.
  - ':<keyword>' to start in the directory last used by a filedialog in the same application that specified the same keyword.
  - '::<keyword>' to start in the directory last used by a filedialog in any application that specified the same keyword.

  encoding | The encoding shown in the encoding combo. If it's QString::null, the global default encoding will be shown.
  filter | This is a space separated list of shell globs. You can set the text to be displayed for the glob, and provide multiple globs. See setFilter() for details on how to do this...
  caption | The caption of the dialog

  type

  This can either be
  - Opening (open dialog, the default setting)
  - Saving

  parent | The parent widget of this dialog
  name | The name of this object
  modal | Whether to create a modal dialog or not

Since
  3.2

Definition at line 39 of file kencodingfiledialog.cpp.

KEncodingFileDialog::~KEncodingFileDialog | ( |  | ) |

Destructs the file dialog.

Definition at line 81 of file kencodingfiledialog.cpp.

## Member Function Documentation

KEncodingFileDialog::Result KEncodingFileDialog::getOpenFileNameAndEncoding | ( | const QString & | encoding = `QString::null`,
|  | const QString & | startDir = `QString::null`,
|  | const QString & | filter = `QString::null`,
|  | QWidget * | parent = `0`,
|  | const QString & | caption = `QString::null`
| ) |  |

static

Creates a modal file dialog and return the selected filename or an empty string if none was chosen additionally a chosen encoding value is returned.

Note that with this method the user must select an existing filename.

Parameters

  startDir

  This can either be
  - The URL of the directory to start in.
  - QString::null to start in the current working directory, or the last directory where a file has been selected.
  - ':<keyword>' to start in the directory last used by a filedialog in the same application that specified the same keyword.
  - '::<keyword>' to start in the directory last used by a filedialog in any application that specified the same keyword.

  encoding | The encoding shown in the encoding combo.
  filter | This is a space separated list of shell globs. You can set the text to be displayed for the glob, and provide multiple globs. See setFilter() for details on how to do this...
  parent | The widget the dialog will be centered on initially.
  caption | The name of the dialog widget.

Definition at line 96 of file kencodingfiledialog.cpp.

KEncodingFileDialog::Result KEncodingFileDialog::getOpenFileNamesAndEncoding | ( | const QString & | encoding = `QString::null`,
|  | const QString & | startDir = `QString::null`,
|  | const QString & | filter = `QString::null`,
|  | QWidget * | parent = `0`,
|  | const QString & | caption = `QString::null`
| ) |  |

static

Creates a modal file dialog and returns the selected encoding and the selected filenames or an empty list if none was chosen.

Note that with this method the user must select an existing filename.

Parameters

  startDir

  This can either be
  - The URL of the directory to start in.
  - QString::null to start in the current working directory, or the last directory where a file has been selected.
  - ':<keyword>' to start in the directory last used by a filedialog in the same application that specified the same keyword.
  - '::<keyword>' to start in the directory last used by a filedialog in any application that specified the same keyword.

  encoding | The encoding shown in the encoding combo.
  filter | This is a space separated list of shell globs. You can set the text to be displayed for the glob, and provide multiple globs. See setFilter() for details on how to do this.
  parent | The widget the dialog will be centered on initially.
  caption | The name of the dialog widget.

Definition at line 114 of file kencodingfiledialog.cpp.

KEncodingFileDialog::Result KEncodingFileDialog::getOpenURLAndEncoding | ( | const QString & | encoding = `QString::null`,
|  | const QString & | startDir = `QString::null`,
|  | const QString & | filter = `QString::null`,
|  | QWidget * | parent = `0`,
|  | const QString & | caption = `QString::null`
| ) |  |

static

Creates a modal file dialog and returns the selected encoding and URL or an empty string if none was chosen.

Note that with this method the user must select an existing URL.

Parameters

  startDir

  This can either be
  - The URL of the directory to start in.
  - QString::null to start in the current working directory, or the last directory where a file has been selected.
  - ':<keyword>' to start in the directory last used by a filedialog in the same application that specified the same keyword.
  - '::<keyword>' to start in the directory last used by a filedialog in any application that specified the same keyword.

  encoding | The encoding shown in the encoding combo.
  filter | This is a space separated list of shell globs. You can set the text to be displayed for the glob, and provide multiple globs. See setFilter() for details on how to do this...
  parent | The widget the dialog will be centered on initially.
  caption | The name of the dialog widget.

Definition at line 132 of file kencodingfiledialog.cpp.

KEncodingFileDialog::Result KEncodingFileDialog::getOpenURLsAndEncoding | ( | const QString & | encoding = `QString::null`,
|  | const QString & | startDir = `QString::null`,
|  | const QString & | filter = `QString::null`,
|  | QWidget * | parent = `0`,
|  | const QString & | caption = `QString::null`
| ) |  |

static

Creates a modal file dialog and returns the selected encoding URLs or an empty list if none was chosen.

Note that with this method the user must select an existing filename.

Parameters

  startDir

  This can either be
  - The URL of the directory to start in.
  - QString::null to start in the current working directory, or the last directory where a file has been selected.
  - ':<keyword>' to start in the directory last used by a filedialog in the same application that specified the same keyword.
  - '::<keyword>' to start in the directory last used by a filedialog in any application that specified the same keyword.

  encoding | The encoding shown in the encoding combo.
  filter | This is a space separated list of shell globs. You can set the text to be displayed for the glob, and provide multiple globs. See setFilter() for details on how to do this...
  parent | The widget the dialog will be centered on initially.
  caption | The name of the dialog widget.

Definition at line 148 of file kencodingfiledialog.cpp.

KEncodingFileDialog::Result KEncodingFileDialog::getSaveFileNameAndEncoding | ( | const QString & | encoding = `QString::null`,
|  | const QString & | startDir = `QString::null`,
|  | const QString & | filter = `QString::null`,
|  | QWidget * | parent = `0`,
|  | const QString & | caption = `QString::null`
| ) |  |

static

Creates a modal file dialog and returns the selected encoding and filename or an empty string if none was chosen.

Note that with this method the user need not select an existing filename.

Parameters

  startDir

  This can either be
  - The URL of the directory to start in.
  - a relative path or a filename determining the directory to start in and the file to be selected.
  - QString::null to start in the current working directory, or the last directory where a file has been selected.
  - ':<keyword>' to start in the directory last used by a filedialog in the same application that specified the same keyword.
  - '::<keyword>' to start in the directory last used by a filedialog in any application that specified the same keyword.

  encoding | The encoding shown in the encoding combo.
  filter | This is a space separated list of shell globs. You can set the text to be displayed for the glob, and provide multiple globs. See setFilter() for details on how to do this...
  parent | The widget the dialog will be centered on initially.
  caption | The name of the dialog widget.

Definition at line 167 of file kencodingfiledialog.cpp.

KEncodingFileDialog::Result KEncodingFileDialog::getSaveURLAndEncoding | ( | const QString & | encoding = `QString::null`,
|  | const QString & | startDir = `QString::null`,
|  | const QString & | filter = `QString::null`,
|  | QWidget * | parent = `0`,
|  | const QString & | caption = `QString::null`
| ) |  |

static

Creates a modal file dialog and returns the selected encoding and filename or an empty string if none was chosen.

Note that with this method the user need not select an existing filename.

Parameters

  startDir

  This can either be
  - The URL of the directory to start in.
  - a relative path or a filename determining the directory to start in and the file to be selected.
  - QString::null to start in the current working directory, or the last directory where a file has been selected.
  - ':<keyword>' to start in the directory last used by a filedialog in the same application that specified the same keyword.
  - '::<keyword>' to start in the directory last used by a filedialog in any application that specified the same keyword.

  encoding | The encoding shown in the encoding combo.
  filter | This is a space separated list of shell globs. You can set the text to be displayed for the glob, and provide multiple globs. See setFilter() for details on how to do this...
  parent | The widget the dialog will be centered on initially.
  caption | The name of the dialog widget.

Definition at line 192 of file kencodingfiledialog.cpp.

QString KEncodingFileDialog::selectedEncoding | ( |  | ) | const

Returns
  The selected encoding if the constructor with the encoding parameter was used, otherwise QString::null.

Definition at line 87 of file kencodingfiledialog.cpp.

The documentation for this class was generated from the following files:

- kencodingfiledialog.h
- kencodingfiledialog.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys