• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kio/kfile
 

kio/kfile

  • kio
  • kfile
kfiledialog.h
1 // -*- c++ -*-
2 /* This file is part of the KDE libraries
3  Copyright (C) 1997, 1998 Richard Moore <rich@kde.org>
4  1998 Stephan Kulow <coolo@kde.org>
5  1998 Daniel Grana <grana@ie.iwi.unibe.ch>
6  2000,2001 Carsten Pfeiffer <pfeiffer@kde.org>
7  2001 Frerich Raabe <raabe@kde.org>
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Library General Public
11  License as published by the Free Software Foundation; either
12  version 2 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Library General Public License for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with this library; see the file COPYING.LIB. If not, write to
21  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  Boston, MA 02110-1301, USA.
23 */
24 
25 #ifndef __KFILEDIALOG_H__
26 #define __KFILEDIALOG_H__
27 
28 #include <tqstring.h>
29 
30 #include <kdialogbase.h>
31 #include <kfile.h>
32 #include <kurl.h>
33 #include <kmimetype.h>
34 #include <kio/jobclasses.h>
35 
36 class TQCheckBox;
37 class TQHBoxLayout;
38 class TQGridLayout;
39 class TQLabel;
40 class TQPopupMenu;
41 class TQVBoxLayout;
42 
43 class KActionCollection;
44 class KDirOperator;
45 class KURLBar;
46 class KURLComboBox;
47 class KFileFilterCombo;
48 class KFileView;
49 class KFileItem;
50 class KPushButton;
51 class KToolBar;
52 class KPreviewWidgetBase;
53 
54 struct KFileDialogPrivate;
55 
77 class KIO_EXPORT KFileDialog : public KDialogBase
78 {
79  Q_OBJECT
80 
81 public:
82 
94  enum OperationMode { Other = 0, Opening, Saving };
95 
119  KFileDialog(const TQString& startDir, const TQString& filter,
120  TQWidget *parent, const char *name,
121  bool modal);
122 
159  KFileDialog(const TQString& startDir, const TQString& filter,
160  TQWidget *parent, const char *name,
161  bool modal, TQWidget* widget);
162 
163 
167  ~KFileDialog();
168 
172  KURL selectedURL() const;
173 
177  KURL::List selectedURLs() const;
178 
182  KURL baseURL() const;
183 
188  TQString selectedFile() const;
189 
193  TQStringList selectedFiles() const;
194 
202  void setURL(const KURL &url, bool clearforward = true);
203 
209  void setSelection(const TQString& name);
210 
228  void setOperationMode( KFileDialog::OperationMode );
229 
237  OperationMode operationMode() const;
238 
250  void setKeepLocation( bool keep );
251 
256  bool keepsLocation() const;
257 
292  void setFilter(const TQString& filter);
293 
301  TQString currentFilter() const;
302 
313  void setFilterMimeType(const TQString &label, const KMimeType::List &types, const KMimeType::Ptr &defaultType) KDE_DEPRECATED;
314 
323  KMimeType::Ptr currentFilterMimeType();
324 
336  void setMimeFilter( const TQStringList& types,
337  const TQString& defaultType = TQString::null );
338 
347  TQString currentMimeFilter() const;
348 
352  void clearFilter();
353 
368  void setPreviewWidget(const TQWidget *w) KDE_DEPRECATED;
369 
381  void setPreviewWidget(const KPreviewWidgetBase *w);
382 
408  static TQString getOpenFileName(const TQString& startDir= TQString::null,
409  const TQString& filter= TQString::null,
410  TQWidget *parent= 0,
411  const TQString& caption = TQString::null);
412 
413 
422  static TQString getOpenFileNameWId(const TQString& startDir,
423  const TQString& filter,
424  WId parent_id, const TQString& caption);
425 
451  static TQStringList getOpenFileNames(const TQString& startDir= TQString::null,
452  const TQString& filter= TQString::null,
453  TQWidget *parent = 0,
454  const TQString& caption= TQString::null);
455 
456 
457 
483  static KURL getOpenURL(const TQString& startDir = TQString::null,
484  const TQString& filter= TQString::null,
485  TQWidget *parent= 0,
486  const TQString& caption = TQString::null);
487 
488 
489 
515  static KURL::List getOpenURLs(const TQString& startDir= TQString::null,
516  const TQString& filter= TQString::null,
517  TQWidget *parent = 0,
518  const TQString& caption= TQString::null);
519 
520 
521 
549  static TQString getSaveFileName(const TQString& startDir= TQString::null,
550  const TQString& filter= TQString::null,
551  TQWidget *parent= 0,
552  const TQString& caption = TQString::null);
553 
554 
560  static TQString getSaveFileNameWId(const TQString& dir, const TQString& filter,
561  WId parent_id,
562  const TQString& caption);
563 
591  static KURL getSaveURL(const TQString& startDir= TQString::null,
592  const TQString& filter= TQString::null,
593  TQWidget *parent= 0,
594  const TQString& caption = TQString::null);
595 
596 
615  static TQString getExistingDirectory(const TQString & startDir = TQString::null,
616  TQWidget * parent = 0,
617  const TQString& caption= TQString::null);
618 
641  static KURL getExistingURL(const TQString & startDir = TQString::null,
642  TQWidget * parent = 0,
643  const TQString& caption= TQString::null);
662  static KURL getImageOpenURL( const TQString& startDir = TQString::null,
663  TQWidget *parent = 0,
664  const TQString& caption = TQString::null );
665  virtual void show();
666 
670  void setMode( KFile::Mode m );
671 
693  void setMode( unsigned int m );
694 
699  KFile::Mode mode() const;
700 
708  void setLocationLabel(const TQString& text);
709 
722  KToolBar *toolBar() const { return toolbar; }
723 
728  KPushButton *okButton() const;
729 
734  KPushButton *cancelButton() const;
735 
751  KURLBar *speedBar();
752 
757  KActionCollection *actionCollection() const;
758 
763  int pathComboIndex();
764 
777  static KURL getStartURL( const TQString& startDir, TQString& recentDirClass );
778 
783  static void setStartDir( const KURL& directory );
784 
785 signals:
793  void fileSelected(const TQString&);
794 
798  void fileHighlighted(const TQString&);
799 
808  void selectionChanged();
809 
820  void filterChanged( const TQString& filter );
821 
822 protected:
823  KToolBar *toolbar;
824 
825  static KURL *lastDirectory;
826 
827  KURLComboBox *locationEdit;
828 
829  KFileFilterCombo *filterWidget;
830 
834  virtual void keyPressEvent( TQKeyEvent *e );
835 
840  void init(const TQString& startDir, const TQString& filter, TQWidget* widget);
841 
846  virtual void initGUI();
847 
852  void multiSelectionChanged();
853 
857  virtual void readConfig( KConfig *, const TQString& group = TQString::null );
858 
862  virtual void writeConfig( KConfig *, const TQString& group = TQString::null );
863 
867  virtual void readRecentFiles( KConfig * );
868 
872  virtual void saveRecentFiles( KConfig * );
873 
880  KURL::List tokenize(const TQString& line) const;
881 
886  KURL getCompleteURL(const TQString&);
887 
894  TQString currentFilterExtension();
895 
904  void updateAutoSelectExtension();
905 
906 
907 protected slots:
908  void urlEntered( const KURL& );
909  void enterURL( const KURL& url );
910  void enterURL( const TQString& url );
911  void locationActivated( const TQString& url );
912 
916  // ### remove in KDE4
917  void toolbarCallback(int);
921  // ### remove in KDE4
922  void pathComboChanged( const TQString& );
926  // ### remove in KDE4
927  void dirCompletion( const TQString& );
928 
929  void slotFilterChanged();
930  void fileHighlighted(const KFileItem *i);
931  void fileSelected(const KFileItem *i);
932  void slotStatResult(KIO::Job* job);
933  void slotLoadingFinished();
934 
935  void fileCompletion( const TQString& );
939  void toggleSpeedbar( bool );
940 
944  void toggleBookmarks(bool show);
945 
949  virtual void updateStatusLine(int dirs, int files);
950 
951  virtual void slotOk();
952  virtual void accept();
953  virtual void slotCancel();
954 
955  void slotAutoSelectExtClicked();
956  void addToRecentDocuments();
957  void initSpeedbar();
958 
959 private slots:
960  void slotLocationChanged( const TQString& text );
961 
962 private:
963  KFileDialog(const KFileDialog&);
964  KFileDialog operator=(const KFileDialog&);
965 
966  void setLocationText( const TQString& text );
967  void updateLocationWhatsThis();
968 
969  void appendExtension(KURL &url);
970  void updateLocationEditExtension(const TQString &);
971  void updateFilter();
972 
973  static void initStatic();
974 
975  void setNonExtSelection();
976 
977 protected:
978  KDirOperator *ops;
979  bool autoDirectoryFollowing;
980 
981  KURL::List& parseSelectedURLs() const;
982 
983 protected:
984  virtual void virtual_hook( int id, void* data );
985 private:
986  KFileDialogPrivate *d;
987 };
988 
989 #endif
KURLComboBox
This combobox shows a number of recent URLs/directories, as well as some default directories.
Definition: kurlcombobox.h:41
KFileView
This class defines an interface to all file views.
Definition: kfileview.h:98
KFile::Mode
Mode
Modes of operation for the dialog.
Definition: kfile.h:42
KFileDialog
Provides a user (and developer) friendly way to select files and directories.
Definition: kfiledialog.h:77
KDirOperator
This widget works as a network transparent filebrowser.
Definition: kdiroperator.h:97
KURLBar
KURLBar is a widget that displays icons together with a description.
Definition: kurlbar.h:230
KFileDialog::toolBar
KToolBar * toolBar() const
Returns a pointer to the toolbar.
Definition: kfiledialog.h:722
KFileDialog::OperationMode
OperationMode
Defines some default behavior of the filedialog.
Definition: kfiledialog.h:94
KPreviewWidgetBase
Abstract baseclass for all preview widgets which shall be used via KFileDialog::setPreviewWidget(cons...
Definition: kpreviewwidgetbase.h:44

kio/kfile

Skip menu "kio/kfile"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kio/kfile

Skip menu "kio/kfile"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kfile by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |