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

KIO

kfiledialog.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 /* This file is part of the KDE libraries
00003     Copyright (C) 1997, 1998 Richard Moore <rich@kde.org>
00004                   1998 Stephan Kulow <coolo@kde.org>
00005                   1998 Daniel Grana <grana@ie.iwi.unibe.ch>
00006                   2000,2001 Carsten Pfeiffer <pfeiffer@kde.org>
00007                   2001 Frerich Raabe <raabe@kde.org>
00008                   2007 David Faure <faure@kde.org>
00009 
00010     This library is free software; you can redistribute it and/or
00011     modify it under the terms of the GNU Library General Public
00012     License as published by the Free Software Foundation; either
00013     version 2 of the License, or (at your option) any later version.
00014 
00015     This library is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018     Library General Public License for more details.
00019 
00020     You should have received a copy of the GNU Library General Public License
00021     along with this library; see the file COPYING.LIB.  If not, write to
00022     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00023     Boston, MA 02110-1301, USA.
00024 */
00025 
00026 #ifndef KFILEDIALOG_H
00027 #define KFILEDIALOG_H
00028 
00029 #include <kdialog.h>
00030 #include <kfile.h>
00031 #include <kurl.h>
00032 #include <kmimetype.h>
00033 
00034 class KAbstractFileWidget;
00035 class KFileWidget;
00036 
00037 class KActionCollection;
00038 class KUrlComboBox;
00039 class KFileFilterCombo;
00040 class KPushButton;
00041 class KToolBar;
00042 class KPreviewWidgetBase;
00043 
00044 class KFileDialogPrivate;
00045 
00067 class KIO_EXPORT KFileDialog : public KDialog
00068 {
00069     Q_OBJECT
00070 
00071 public:
00072 
00084     enum OperationMode { Other = 0, Opening, Saving };
00085 
00109     KFileDialog( const KUrl& startDir, const QString& filter,
00110                  QWidget *parent, QWidget* widget = 0 );
00111 
00112 
00116     ~KFileDialog();
00117 
00121     KUrl selectedUrl() const;
00122 
00126     KUrl::List selectedUrls() const;
00127 
00131     KUrl baseUrl() const;
00132 
00137     QString selectedFile() const;
00138 
00142     QStringList selectedFiles() const;
00143 
00151     void setUrl(const KUrl &url, bool clearforward = true);
00152 
00158     void setSelection(const QString& name);
00159 
00177     void setOperationMode( KFileDialog::OperationMode );
00178 
00186     OperationMode operationMode() const;
00187 
00199     void setKeepLocation( bool keep );
00200 
00205     bool keepsLocation() const;
00206 
00241     void setFilter(const QString& filter);
00242 
00250     QString currentFilter() const;
00251 
00260     KMimeType::Ptr currentFilterMimeType();
00261 
00273     void setMimeFilter( const QStringList& types,
00274                         const QString& defaultType = QString() );
00275 
00284     QString currentMimeFilter() const;
00285 
00289     void clearFilter();
00290 
00302     void setPreviewWidget(KPreviewWidgetBase *w);
00303 
00310     void setInlinePreviewShown(bool show);
00311 
00321     void setConfirmOverwrite(bool enable);
00322 
00324     virtual QSize sizeHint() const;
00325 
00345     static QString getOpenFileName( const KUrl& startDir= KUrl(),
00346                                     const QString& filter= QString(),
00347                                     QWidget *parent= 0,
00348                                     const QString& caption = QString() );
00349 
00350 
00357    static QString getOpenFileNameWId( const KUrl& startDir,
00358                                       const QString& filter,
00359                                       WId parent_id, const QString& caption );
00360 
00380     static QStringList getOpenFileNames( const KUrl& startDir= KUrl(),
00381                                          const QString& filter = QString(),
00382                                          QWidget *parent = 0,
00383                                          const QString& caption= QString() );
00384 
00385 
00386 
00406     static KUrl getOpenUrl( const KUrl& startDir = KUrl(),
00407                             const QString& filter = QString(),
00408                             QWidget *parent= 0,
00409                             const QString& caption = QString() );
00410 
00411 
00412 
00432     static KUrl::List getOpenUrls( const KUrl& startDir = KUrl(),
00433                                    const QString& filter = QString(),
00434                                    QWidget *parent = 0,
00435                                    const QString& caption = QString() );
00436 
00437 
00438 
00458     static QString getSaveFileName( const KUrl& startDir = KUrl(),
00459                                     const QString& filter = QString(),
00460                                     QWidget *parent = 0,
00461                                     const QString& caption = QString() );
00462 
00463 
00468     static QString getSaveFileNameWId( const KUrl &startDir, const QString& filter,
00469                                        WId parent_id,
00470                                        const QString& caption );
00471 
00491     static KUrl getSaveUrl( const KUrl& startDir = KUrl(),
00492                             const QString& filter = QString(),
00493                             QWidget *parent = 0,
00494                             const QString& caption = QString() );
00495 
00496 
00510     static QString getExistingDirectory( const KUrl& startDir = KUrl(),
00511                                          QWidget * parent = 0,
00512                                          const QString& caption= QString() );
00513 
00528     static KUrl getExistingDirectoryUrl( const KUrl& startDir = KUrl(),
00529                                          QWidget * parent = 0,
00530                                          const QString& caption= QString() );
00531 
00544     static KUrl getImageOpenUrl( const KUrl& startDir = KUrl(),
00545                                  QWidget *parent = 0,
00546                                  const QString& caption = QString() );
00547 
00569     void setMode( KFile::Modes m );
00570 
00575     KFile::Modes mode() const;
00576 
00584     void setLocationLabel(const QString& text);
00585 
00590     KAbstractFileWidget* fileWidget();
00591 
00604     KToolBar *toolBar() const;
00605 
00610     KPushButton *okButton() const;
00611 
00616     KPushButton *cancelButton() const;
00617 
00622     KUrlComboBox *locationEdit() const;
00623 
00628     KFileFilterCombo *filterWidget() const;
00629 
00633     KActionCollection *actionCollection() const;
00634 
00652     static KUrl getStartUrl( const KUrl& startDir, QString& recentDirClass );
00653 
00658     static void setStartDir( const KUrl& directory );
00659 
00660 #ifdef Q_WS_WIN
00661 public Q_SLOTS:
00662     int exec();
00663 #endif
00664 
00665 Q_SIGNALS:
00673     void fileSelected(const QString&);
00674 
00678     void fileHighlighted(const QString&);
00679 
00688     void selectionChanged();
00689 
00700     void filterChanged( const QString& filter );
00701 
00702 protected:
00706     virtual void keyPressEvent( QKeyEvent *e );
00707 
00711     virtual void hideEvent( QHideEvent *event );
00712 
00713 protected Q_SLOTS:
00714     virtual void slotOk();
00715     virtual void accept();
00716     virtual void slotCancel();
00717 
00718 private:
00719     Q_DISABLE_COPY(KFileDialog)
00720 
00721     KFileDialogPrivate * const d;
00722 };
00723 
00724 #endif

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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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