• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdefile
 

tdeio/tdefile

  • tdeio
  • tdefile
tdefiledialog.h
1/* This file is part of the KDE libraries
2 Copyright (C) 1997, 1998 Richard Moore <rich@kde.org>
3 1998 Stephan Kulow <coolo@kde.org>
4 1998 Daniel Grana <grana@ie.iwi.unibe.ch>
5 2000,2001 Carsten Pfeiffer <pfeiffer@kde.org>
6 2001 Frerich Raabe <raabe@kde.org>
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
17
18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
22*/
23
24#ifndef __TDEFILEDIALOG_H__
25#define __TDEFILEDIALOG_H__
26
27#include <tqstring.h>
28
29#include <kdialogbase.h>
30#include <tdefile.h>
31#include <kurl.h>
32#include <kmimetype.h>
33#include <tdeio/jobclasses.h>
34
35class TQCheckBox;
36class TQHBoxLayout;
37class TQGridLayout;
38class TQLabel;
39class TQPopupMenu;
40class TQVBoxLayout;
41
42class TDEActionCollection;
43class KDirOperator;
44class KURLBar;
45class KURLComboBox;
46class KFileFilterCombo;
47class KFileView;
48class KFileItem;
49class KPushButton;
50class TDEToolBar;
51class KPreviewWidgetBase;
52
53struct KFileDialogPrivate;
54
76class TDEIO_EXPORT KFileDialog : public KDialogBase
77{
78 TQ_OBJECT
79
80public:
81
93 enum OperationMode { Other = 0, Opening, Saving };
94
118 KFileDialog(const TQString& startDir, const TQString& filter,
119 TQWidget *parent, const char *name,
120 bool modal);
121
158 KFileDialog(const TQString& startDir, const TQString& filter,
159 TQWidget *parent, const char *name,
160 bool modal, TQWidget* widget);
161
162
166 ~KFileDialog();
167
171 KURL selectedURL() const;
172
176 KURL::List selectedURLs() const;
177
181 KURL baseURL() const;
182
187 TQString selectedFile() const;
188
192 TQStringList selectedFiles() const;
193
201 void setURL(const KURL &url, bool clearforward = true);
202
208 void setSelection(const TQString& name);
209
227 void setOperationMode( KFileDialog::OperationMode );
228
236 OperationMode operationMode() const;
237
249 void setKeepLocation( bool keep );
250
255 bool keepsLocation() const;
256
291 void setFilter(const TQString& filter);
292
300 TQString currentFilter() const;
301
312 void setFilterMimeType(const TQString &label, const KMimeType::List &types, const KMimeType::Ptr &defaultType) TDE_DEPRECATED;
313
322 KMimeType::Ptr currentFilterMimeType();
323
335 void setMimeFilter( const TQStringList& types,
336 const TQString& defaultType = TQString::null );
337
346 TQString currentMimeFilter() const;
347
351 void clearFilter();
352
367 void setPreviewWidget(const TQWidget *w) TDE_DEPRECATED;
368
380 void setPreviewWidget(const KPreviewWidgetBase *w);
381
407 static TQString getOpenFileName(const TQString& startDir= TQString::null,
408 const TQString& filter= TQString::null,
409 TQWidget *parent= 0,
410 const TQString& caption = TQString::null);
411
412
421 static TQString getOpenFileNameWId(const TQString& startDir,
422 const TQString& filter,
423 WId parent_id, const TQString& caption);
424
450 static TQStringList getOpenFileNames(const TQString& startDir= TQString::null,
451 const TQString& filter= TQString::null,
452 TQWidget *parent = 0,
453 const TQString& caption= TQString::null);
454
455
456
482 static KURL getOpenURL(const TQString& startDir = TQString::null,
483 const TQString& filter= TQString::null,
484 TQWidget *parent= 0,
485 const TQString& caption = TQString::null);
486
487
488
514 static KURL::List getOpenURLs(const TQString& startDir= TQString::null,
515 const TQString& filter= TQString::null,
516 TQWidget *parent = 0,
517 const TQString& caption= TQString::null);
518
519
520
548 static TQString getSaveFileName(const TQString& startDir= TQString::null,
549 const TQString& filter= TQString::null,
550 TQWidget *parent= 0,
551 const TQString& caption = TQString::null);
552
553
559 static TQString getSaveFileNameWId(const TQString& dir, const TQString& filter,
560 WId parent_id,
561 const TQString& caption);
562
590 static KURL getSaveURL(const TQString& startDir= TQString::null,
591 const TQString& filter= TQString::null,
592 TQWidget *parent= 0,
593 const TQString& caption = TQString::null);
594
595
614 static TQString getExistingDirectory(const TQString & startDir = TQString::null,
615 TQWidget * parent = 0,
616 const TQString& caption= TQString::null);
617
640 static KURL getExistingURL(const TQString & startDir = TQString::null,
641 TQWidget * parent = 0,
642 const TQString& caption= TQString::null);
661 static KURL getImageOpenURL( const TQString& startDir = TQString::null,
662 TQWidget *parent = 0,
663 const TQString& caption = TQString::null );
664 virtual void show();
665
669 void setMode( KFile::Mode m );
670
692 void setMode( unsigned int m );
693
698 KFile::Mode mode() const;
699
707 void setLocationLabel(const TQString& text);
708
721 TDEToolBar *toolBar() const { return toolbar; }
722
727 KPushButton *okButton() const;
728
733 KPushButton *cancelButton() const;
734
750 KURLBar *speedBar();
751
756 TDEActionCollection *actionCollection() const;
757
762 int pathComboIndex();
763
776 static KURL getStartURL( const TQString& startDir, TQString& recentDirClass );
777
782 static void setStartDir( const KURL& directory );
783
784signals:
792 void fileSelected(const TQString&);
793
797 void fileHighlighted(const TQString&);
798
807 void selectionChanged();
808
819 void filterChanged( const TQString& filter );
820
821protected:
822 TDEToolBar *toolbar;
823
824 static KURL *lastDirectory;
825
826 KURLComboBox *locationEdit;
827
828 KFileFilterCombo *filterWidget;
829
833 virtual void keyPressEvent( TQKeyEvent *e );
834
839 void init(const TQString& startDir, const TQString& filter, TQWidget* widget);
840
845 virtual void initGUI();
846
851 void multiSelectionChanged();
852
856 virtual void readConfig( TDEConfig *, const TQString& group = TQString::null );
857
861 virtual void writeConfig( TDEConfig *, const TQString& group = TQString::null );
862
866 virtual void readRecentFiles( TDEConfig * );
867
871 virtual void saveRecentFiles( TDEConfig * );
872
879 KURL::List tokenize(const TQString& line) const;
880
885 KURL getCompleteURL(const TQString&);
886
893 TQString currentFilterExtension();
894
903 void updateAutoSelectExtension();
904
905
906protected slots:
907 void urlEntered( const KURL& );
908 void enterURL( const KURL& url );
909 void enterURL( const TQString& url );
910 void locationActivated( const TQString& url );
911
915 // ### remove in KDE4
916 void toolbarCallback(int);
920 // ### remove in KDE4
921 void pathComboChanged( const TQString& );
925 // ### remove in KDE4
926 void dirCompletion( const TQString& );
927
928 void slotFilterChanged();
929 void fileHighlighted(const KFileItem *i);
930 void fileSelected(const KFileItem *i);
931 void slotStatResult(TDEIO::Job* job);
932 void slotLoadingFinished();
933
934 void fileCompletion( const TQString& );
938 void toggleSpeedbar( bool );
939
943 void toggleBookmarks(bool show);
944
948 virtual void updateStatusLine(int dirs, int files);
949
950 virtual void slotOk();
951 virtual void accept();
952 virtual void slotCancel();
953
954 void slotAutoSelectExtClicked();
955 void addToRecentDocuments();
956 void initSpeedbar();
957
958private slots:
959 void slotLocationChanged( const TQString& text );
960
961private:
962 KFileDialog(const KFileDialog&);
963 KFileDialog operator=(const KFileDialog&);
964
965 void setLocationText( const TQString& text );
966 void updateLocationWhatsThis();
967
968 void appendExtension(KURL &url);
969 void updateLocationEditExtension(const TQString &);
970 void updateFilter();
971
972 static void initStatic();
973
974 void setNonExtSelection();
975
976protected:
977 KDirOperator *ops;
978 bool autoDirectoryFollowing;
979
980 KURL::List& parseSelectedURLs() const;
981
982protected:
983 virtual void virtual_hook( int id, void* data );
984private:
985 KFileDialogPrivate *d;
986};
987
988#endif
KDirOperator
This widget works as a network transparent filebrowser.
Definition: tdediroperator.h:97
KFileDialog
Provides a user (and developer) friendly way to select files and directories.
Definition: tdefiledialog.h:77
KFileDialog::toolBar
TDEToolBar * toolBar() const
Returns a pointer to the toolbar.
Definition: tdefiledialog.h:721
KFileDialog::filterChanged
void filterChanged(const TQString &filter)
Emitted when the filter changed, i.e.
KFileDialog::fileHighlighted
void fileHighlighted(const TQString &)
Emitted when the user highlights a file.
KFileDialog::selectionChanged
void selectionChanged()
Emitted when the user hilights one or more files in multiselection mode.
KFileDialog::OperationMode
OperationMode
Defines some default behavior of the filedialog.
Definition: tdefiledialog.h:93
KFileDialog::fileSelected
void fileSelected(const TQString &)
Emitted when the user selects a file.
KFileView
This class defines an interface to all file views.
Definition: tdefileview.h:97
KFile::Mode
Mode
Modes of operation for the dialog.
Definition: tdefile.h:42
KPreviewWidgetBase
Abstract baseclass for all preview widgets which shall be used via KFileDialog::setPreviewWidget(cons...
Definition: kpreviewwidgetbase.h:45
KURLBar
KURLBar is a widget that displays icons together with a description.
Definition: kurlbar.h:231
KURLComboBox
This combobox shows a number of recent URLs/directories, as well as some default directories.
Definition: kurlcombobox.h:42

tdeio/tdefile

Skip menu "tdeio/tdefile"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeio/tdefile

Skip menu "tdeio/tdefile"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdefile by doxygen 1.9.4
This website is maintained by Timothy Pearson.