kio Library API Documentation

KEncodingFileDialog Class Reference

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

#include <kencodingfiledialog.h>

Inheritance diagram for KEncodingFileDialog:

KFileDialog KDialogBase KDialog QDialog List of all members.

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

Static Public Member Functions

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)
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)
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)
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)
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)
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)

Protected Member Functions

virtual void virtual_hook (int id, void *data)

Detailed Description

Provides a user (and developer) friendly way to select files with support for chosing 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.
caption The caption of the dialog
type This can either be
  • Opening (open dialog, the default setting)
  • Saving
Since:
3.2

Definition at line 39 of file kencodingfiledialog.cpp.

References KGlobal::charsets(), KCharsets::codecForName(), QString::fromLatin1(), KToolBar::getCombo(), KToolBar::idAt(), KToolBar::insertCombo(), QString::isEmpty(), QTextCodec::name(), KDialog::setCaption(), KFileDialog::setOperationMode(), and KFileDialog::toolBar().

KEncodingFileDialog::~KEncodingFileDialog  ) 
 

Destructs the file dialog.

Definition at line 81 of file kencodingfiledialog.cpp.


Member Function Documentation

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.

Referenced by getOpenFileNameAndEncoding(), getOpenFileNamesAndEncoding(), getOpenURLAndEncoding(), getOpenURLsAndEncoding(), getSaveFileNameAndEncoding(), and getSaveURLAndEncoding().

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

References KDirOperator::clearHistory(), QDialog::exec(), QString::isNull(), KFileDialog::ops, selectedEncoding(), KFileDialog::selectedFile(), and KFileDialog::setMode().

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

References KDirOperator::clearHistory(), QDialog::exec(), QString::isNull(), KFileDialog::ops, selectedEncoding(), KFileDialog::selectedFiles(), and KFileDialog::setMode().

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

References KDirOperator::clearHistory(), QDialog::exec(), QString::isNull(), KFileDialog::ops, selectedEncoding(), KFileDialog::selectedURL(), and KFileDialog::setMode().

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

References KDirOperator::clearHistory(), QDialog::exec(), QString::isNull(), KFileDialog::ops, selectedEncoding(), KFileDialog::selectedURLs(), and KFileDialog::setMode().

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

References KRecentDocument::add(), QString::at(), QDialog::exec(), QString::isEmpty(), QString::isNull(), selectedEncoding(), KFileDialog::selectedFile(), and KFileDialog::setSelection().

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

References KRecentDocument::add(), QString::at(), QDialog::exec(), QString::isNull(), KURL::isValid(), selectedEncoding(), KFileDialog::selectedURL(), and KFileDialog::setSelection().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kio Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed May 5 07:16:54 2004 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003