• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KIO

KEncodingFileDialog Class Reference

#include <kencodingfiledialog.h>

Inheritance diagram for KEncodingFileDialog:

Inheritance graph
[legend]

List of all members.


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 customize 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.


Public Member Functions

 KEncodingFileDialog (const QString &startDir=QString(), const QString &encoding=QString(), const QString &filter=QString(), const QString &caption=QString(), KFileDialog::OperationMode type=KFileDialog::Opening, QWidget *parent=0)
QString selectedEncoding () const
 ~KEncodingFileDialog ()

Static Public Member Functions

static Result getOpenFileNameAndEncoding (const QString &encoding=QString(), const QString &startDir=QString(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
static Result getOpenFileNamesAndEncoding (const QString &encoding=QString(), const QString &startDir=QString(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
static Result getOpenUrlAndEncoding (const QString &encoding=QString(), const QString &startDir=QString(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
static Result getOpenUrlsAndEncoding (const QString &encoding=QString(), const QString &startDir=QString(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
static Result getSaveFileNameAndEncoding (const QString &encoding=QString(), const QString &startDir=QString(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
static Result getSaveUrlAndEncoding (const QString &encoding=QString(), const QString &startDir=QString(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())

Classes

class  Result

Constructor & Destructor Documentation

KEncodingFileDialog::KEncodingFileDialog ( const QString &  startDir = QString(),
const QString &  encoding = QString(),
const QString &  filter = QString(),
const QString &  caption = QString(),
KFileDialog::OperationMode  type = KFileDialog::Opening,
QWidget *  parent = 0 
)

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() 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(), the global default encoding will be shown.
filter A shell glob or a mime-type-filter that specifies which files to display. The preferred option is to set a list of mimetype names, see setMimeFilter() for details. Otherwise you can set the text to be displayed for the each glob, and provide multiple globs, see setFilter() for details.
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

Definition at line 40 of file kencodingfiledialog.cpp.

KEncodingFileDialog::~KEncodingFileDialog (  ) 

Destructs the file dialog.

Definition at line 86 of file kencodingfiledialog.cpp.


Member Function Documentation

KEncodingFileDialog::Result KEncodingFileDialog::getOpenFileNameAndEncoding ( const QString &  encoding = QString(),
const QString &  startDir = QString(),
const QString &  filter = QString(),
QWidget *  parent = 0,
const QString &  caption = QString() 
) [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() 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 A shell glob or a mime-type-filter that specifies which files to display. The preferred option is to set a list of mimetype names, see setMimeFilter() for details. Otherwise you can set the text to be displayed for the each glob, and provide multiple globs, see setFilter() for details.
parent The widget the dialog will be centered on initially.
caption The name of the dialog widget.

Definition at line 101 of file kencodingfiledialog.cpp.

KEncodingFileDialog::Result KEncodingFileDialog::getOpenFileNamesAndEncoding ( const QString &  encoding = QString(),
const QString &  startDir = QString(),
const QString &  filter = QString(),
QWidget *  parent = 0,
const QString &  caption = QString() 
) [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() 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 A shell glob or a mime-type-filter that specifies which files to display. The preferred option is to set a list of mimetype names, see setMimeFilter() for details. Otherwise you can set the text to be displayed for the each glob, and provide multiple globs, see setFilter() for details.
parent The widget the dialog will be centered on initially.
caption The name of the dialog widget.

Definition at line 119 of file kencodingfiledialog.cpp.

KEncodingFileDialog::Result KEncodingFileDialog::getOpenUrlAndEncoding ( const QString &  encoding = QString(),
const QString &  startDir = QString(),
const QString &  filter = QString(),
QWidget *  parent = 0,
const QString &  caption = QString() 
) [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() 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 A shell glob or a mime-type-filter that specifies which files to display. The preferred option is to set a list of mimetype names, see setMimeFilter() for details. Otherwise you can set the text to be displayed for the each glob, and provide multiple globs, see setFilter() for details.
parent The widget the dialog will be centered on initially.
caption The name of the dialog widget.

Definition at line 136 of file kencodingfiledialog.cpp.

KEncodingFileDialog::Result KEncodingFileDialog::getOpenUrlsAndEncoding ( const QString &  encoding = QString(),
const QString &  startDir = QString(),
const QString &  filter = QString(),
QWidget *  parent = 0,
const QString &  caption = QString() 
) [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() 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 A shell glob or a mime-type-filter that specifies which files to display. The preferred option is to set a list of mimetype names, see setMimeFilter() for details. Otherwise you can set the text to be displayed for the each glob, and provide multiple globs, see setFilter() for details.
parent The widget the dialog will be centered on initially.
caption The name of the dialog widget.

Definition at line 152 of file kencodingfiledialog.cpp.

KEncodingFileDialog::Result KEncodingFileDialog::getSaveFileNameAndEncoding ( const QString &  encoding = QString(),
const QString &  startDir = QString(),
const QString &  filter = QString(),
QWidget *  parent = 0,
const QString &  caption = QString() 
) [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() 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 A shell glob or a mime-type-filter that specifies which files to display. The preferred option is to set a list of mimetype names, see setMimeFilter() for details. Otherwise you can set the text to be displayed for the each glob, and provide multiple globs, see setFilter() for details.
parent The widget the dialog will be centered on initially.
caption The name of the dialog widget.

Definition at line 171 of file kencodingfiledialog.cpp.

KEncodingFileDialog::Result KEncodingFileDialog::getSaveUrlAndEncoding ( const QString &  encoding = QString(),
const QString &  startDir = QString(),
const QString &  filter = QString(),
QWidget *  parent = 0,
const QString &  caption = QString() 
) [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() 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 A shell glob or a mime-type-filter that specifies which files to display. The preferred option is to set a list of mimetype names, see setMimeFilter() for details. Otherwise you can set the text to be displayed for the each glob, and provide multiple globs, see setFilter() for details.
parent The widget the dialog will be centered on initially.
caption The name of the dialog widget.

Definition at line 198 of file kencodingfiledialog.cpp.

QString KEncodingFileDialog::selectedEncoding (  )  const

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

Definition at line 92 of file kencodingfiledialog.cpp.


The documentation for this class was generated from the following files:
  • kencodingfiledialog.h
  • kencodingfiledialog.cpp

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal