• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

Classes | Public Member Functions | Static Public Member Functions | List of all members
KEncodingFileDialog Class Reference

#include <kencodingfiledialog.h>

Inheritance diagram for KEncodingFileDialog:
KFileDialog KDialog QDialog

Classes

class  Result
 

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)
 
 ~KEncodingFileDialog ()
 
QString selectedEncoding () const
 
- Public Member Functions inherited from KFileDialog
 KFileDialog (const KUrl &startDir, const QString &filter, QWidget *parent, QWidget *widget=0)
 
 ~KFileDialog ()
 
KActionCollection * actionCollection () const
 
KUrl baseUrl () const
 
KPushButton * cancelButton () const
 
void clearFilter ()
 
QString currentFilter () const
 
KMimeType::Ptr currentFilterMimeType ()
 
QString currentMimeFilter () const
 
KAbstractFileWidget * fileWidget ()
 
KFileFilterCombo * filterWidget () const
 
bool keepsLocation () const
 
KUrlComboBox * locationEdit () const
 
KFile::Modes mode () const
 
KPushButton * okButton () const
 
OperationMode operationMode () const
 
QString selectedFile () const
 
QStringList selectedFiles () const
 
KUrl selectedUrl () const
 
KUrl::List selectedUrls () const
 
void setConfirmOverwrite (bool enable)
 
void setFilter (const QString &filter)
 
void setInlinePreviewShown (bool show)
 
void setKeepLocation (bool keep)
 
void setLocationLabel (const QString &text)
 
void setMimeFilter (const QStringList &types, const QString &defaultType=QString())
 
void setMode (KFile::Modes m)
 
void setOperationMode (KFileDialog::OperationMode)
 
void setPreviewWidget (KPreviewWidgetBase *w)
 
void setSelection (const QString &name)
 
void setUrl (const KUrl &url, bool clearforward=true)
 
virtual QSize sizeHint () const
 
KToolBar * toolBar () const
 
- Public Member Functions inherited from KDialog
 KDialog (QWidget *parent=0, Qt::WindowFlags flags=0)
 
 ~KDialog ()
 
KPushButton * button (ButtonCode id) const
 
KIcon buttonIcon (ButtonCode id) const
 
QString buttonText (ButtonCode id) const
 
QString buttonToolTip (ButtonCode id) const
 
QString buttonWhatsThis (ButtonCode id) const
 
ButtonCode defaultButton () const
 
QString helpLinkText () const
 
void incrementInitialSize (const QSize &size)
 
bool isButtonEnabled (ButtonCode id) const
 
QWidget * mainWidget ()
 
virtual QSize minimumSizeHint () const
 
void restoreDialogSize (const KConfigGroup &config)
 
void saveDialogSize (KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal) const
 
void setButtonFocus (ButtonCode id)
 
void setButtonGuiItem (ButtonCode id, const KGuiItem &item)
 
void setButtonIcon (ButtonCode id, const KIcon &icon)
 
void setButtonMenu (ButtonCode id, QMenu *menu, ButtonPopupMode popupmode=InstantPopup)
 
void setButtons (ButtonCodes buttonMask)
 
void setButtonsOrientation (Qt::Orientation orientation)
 
void setButtonText (ButtonCode id, const QString &text)
 
void setButtonToolTip (ButtonCode id, const QString &text)
 
void setButtonWhatsThis (ButtonCode id, const QString &text)
 
void setDefaultButton (ButtonCode id)
 
void setEscapeButton (ButtonCode id)
 
void setInitialSize (const QSize &size)
 
void setMainWidget (QWidget *widget)
 
void showButton (ButtonCode id, bool state)
 
void showButtonSeparator (bool state)
 
virtual QSize sizeHint () const
 

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())
 
- Static Public Member Functions inherited from KFileDialog
static QString getExistingDirectory (const KUrl &startDir=KUrl(), QWidget *parent=0, const QString &caption=QString())
 
static KUrl getExistingDirectoryUrl (const KUrl &startDir=KUrl(), QWidget *parent=0, const QString &caption=QString())
 
static KUrl getImageOpenUrl (const KUrl &startDir=KUrl(), QWidget *parent=0, const QString &caption=QString())
 
static QString getOpenFileName (const KUrl &startDir=KUrl(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
 
static QStringList getOpenFileNames (const KUrl &startDir=KUrl(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
 
static QString getOpenFileNameWId (const KUrl &startDir, const QString &filter, WId parent_id, const QString &caption)
 
static KUrl getOpenUrl (const KUrl &startDir=KUrl(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
 
static KUrl::List getOpenUrls (const KUrl &startDir=KUrl(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
 
static QString getSaveFileName (const KUrl &startDir, const QString &filter, QWidget *parent, const QString &caption, Options options)
 
static QString getSaveFileName (const KUrl &startDir=KUrl(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
 
static QString getSaveFileNameWId (const KUrl &startDir, const QString &filter, WId parent_id, const QString &caption)
 
static QString getSaveFileNameWId (const KUrl &startDir, const QString &filter, WId parent_id, const QString &caption, Options options)
 
static KUrl getSaveUrl (const KUrl &startDir, const QString &filter, QWidget *parent, const QString &caption, Options options)
 
static KUrl getSaveUrl (const KUrl &startDir=KUrl(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
 
static KUrl getStartUrl (const KUrl &startDir, QString &recentDirClass)
 
static void setStartDir (const KUrl &directory)
 
- Static Public Member Functions inherited from KDialog
static bool avoidArea (QWidget *widget, const QRect &area, int screen=-1)
 
static void centerOnScreen (QWidget *widget, int screen=-1)
 
static int groupSpacingHint ()
 
static QString makeStandardCaption (const QString &userCaption, QWidget *window=0, CaptionFlags flags=HIGCompliantCaption)
 
static int marginHint ()
 
static void resizeLayout (QLayout *lay, int margin, int spacing)
 
static void resizeLayout (QWidget *widget, int margin, int spacing)
 
static void setAllowEmbeddingInGraphicsView (bool allowEmbedding)
 
static int spacingHint ()
 

Additional Inherited Members

- Public Types inherited from KFileDialog
enum  OperationMode { Other = 0 , Opening , Saving }
 
enum  Option { ConfirmOverwrite = 0x01 , ShowInlinePreview = 0x02 }
 
- Public Types inherited from KDialog
enum  ButtonCode
 
enum  ButtonPopupMode
 
enum  CaptionFlag
 
- Public Slots inherited from KFileDialog
int exec ()
 
- Public Slots inherited from KDialog
void delayedDestruct ()
 
void enableButton (ButtonCode id, bool state)
 
void enableButtonApply (bool state)
 
void enableButtonCancel (bool state)
 
void enableButtonOk (bool state)
 
void enableLinkedHelp (bool state)
 
bool isDetailsWidgetVisible () const
 
virtual void setCaption (const QString &caption)
 
virtual void setCaption (const QString &caption, bool modified)
 
void setDetailsWidget (QWidget *detailsWidget)
 
void setDetailsWidgetVisible (bool visible)
 
void setHelp (const QString &anchor, const QString &appname=QString())
 
void setHelpLinkText (const QString &text)
 
virtual void setPlainCaption (const QString &caption)
 
- Signals inherited from KFileDialog
void fileHighlighted (const KUrl &)
 
QT_MOC_COMPAT void fileHighlighted (const QString &)
 
void fileSelected (const KUrl &)
 
QT_MOC_COMPAT void fileSelected (const QString &)
 
void filterChanged (const QString &filter)
 
void selectionChanged ()
 
- Signals inherited from KDialog
void aboutToShowDetails ()
 
void applyClicked ()
 
void buttonClicked (KDialog::ButtonCode button)
 
void cancelClicked ()
 
void closeClicked ()
 
void defaultClicked ()
 
void finished ()
 
void helpClicked ()
 
void hidden ()
 
void layoutHintChanged ()
 
void noClicked ()
 
void okClicked ()
 
void resetClicked ()
 
void tryClicked ()
 
void user1Clicked ()
 
void user2Clicked ()
 
void user3Clicked ()
 
void yesClicked ()
 
- Public Attributes inherited from KDialog
 Apply
 
 AppNameCaption
 
 Cancel
 
 Close
 
 Default
 
 DelayedPopup
 
 Details
 
 Help
 
 HIGCompliantCaption
 
 InstantPopup
 
 ModifiedCaption
 
 No
 
 NoCaptionFlags
 
 NoDefault
 
 None
 
 Ok
 
 Reset
 
 Try
 
 User1
 
 User2
 
 User3
 
 Yes
 
- Protected Slots inherited from KFileDialog
virtual void accept ()
 
virtual void slotCancel ()
 
virtual void slotOk ()
 
- Protected Slots inherited from KDialog
virtual void slotButtonClicked (int button)
 
void updateGeometry ()
 
- Protected Member Functions inherited from KFileDialog
virtual void hideEvent (QHideEvent *event)
 
virtual void keyPressEvent (QKeyEvent *e)
 
- Protected Member Functions inherited from KDialog
 KDialog (KDialogPrivate &dd, QWidget *parent, Qt::WindowFlags flags=0)
 
virtual void closeEvent (QCloseEvent *e)
 
virtual void hideEvent (QHideEvent *)
 
virtual void keyPressEvent (QKeyEvent *)
 
- Protected Attributes inherited from KDialog
KDialogPrivate *const d_ptr
 

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.

Constructor & Destructor Documentation

◆ KEncodingFileDialog()

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
startDirThis 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.
encodingThe encoding shown in the encoding combo. If it's QString(), the global default encoding will be shown.
filterA 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.
captionThe caption of the dialog
typeThis can either be
  • Opening (open dialog, the default setting)
  • Saving
parentThe parent widget of this dialog

Definition at line 39 of file kencodingfiledialog.cpp.

◆ ~KEncodingFileDialog()

KEncodingFileDialog::~KEncodingFileDialog ( )

Destructs the file dialog.

Definition at line 85 of file kencodingfiledialog.cpp.

Member Function Documentation

◆ getOpenFileNameAndEncoding()

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
encodingThe encoding shown in the encoding combo.
startDirThis 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.
filterA 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.
parentThe widget the dialog will be centered on initially.
captionThe name of the dialog widget.

Definition at line 100 of file kencodingfiledialog.cpp.

◆ getOpenFileNamesAndEncoding()

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
encodingThe encoding shown in the encoding combo.
startDirThis 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.
filterA 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.
parentThe widget the dialog will be centered on initially.
captionThe name of the dialog widget.

Definition at line 118 of file kencodingfiledialog.cpp.

◆ getOpenUrlAndEncoding()

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
encodingThe encoding shown in the encoding combo.
startDirThis 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.
filterA 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.
parentThe widget the dialog will be centered on initially.
captionThe name of the dialog widget.

Definition at line 135 of file kencodingfiledialog.cpp.

◆ getOpenUrlsAndEncoding()

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
encodingThe encoding shown in the encoding combo.
startDirThis 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.
filterA 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.
parentThe widget the dialog will be centered on initially.
captionThe name of the dialog widget.

Definition at line 151 of file kencodingfiledialog.cpp.

◆ getSaveFileNameAndEncoding()

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
encodingThe encoding shown in the encoding combo.
startDirThis 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.
filterA 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.
parentThe widget the dialog will be centered on initially.
captionThe name of the dialog widget.

Definition at line 170 of file kencodingfiledialog.cpp.

◆ getSaveUrlAndEncoding()

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
encodingThe encoding shown in the encoding combo.
startDirThis 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.
filterA 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.
parentThe widget the dialog will be centered on initially.
captionThe name of the dialog widget.

Definition at line 193 of file kencodingfiledialog.cpp.

◆ selectedEncoding()

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

Definition at line 91 of file kencodingfiledialog.cpp.


The documentation for this class was generated from the following files:
  • kencodingfiledialog.h
  • kencodingfiledialog.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal