24 #ifndef __TDEFILEDIALOG_H__
25 #define __TDEFILEDIALOG_H__
29 #include <kdialogbase.h>
32 #include <kmimetype.h>
33 #include <tdeio/jobclasses.h>
42 class TDEActionCollection;
46 class KFileFilterCombo;
53 struct KFileDialogPrivate;
118 KFileDialog(
const TQString& startDir,
const TQString& filter,
119 TQWidget *parent,
const char *name,
158 KFileDialog(
const TQString& startDir,
const TQString& filter,
159 TQWidget *parent,
const char *name,
160 bool modal, TQWidget* widget);
171 KURL selectedURL()
const;
176 KURL::List selectedURLs()
const;
181 KURL baseURL()
const;
187 TQString selectedFile()
const;
192 TQStringList selectedFiles()
const;
201 void setURL(
const KURL &url,
bool clearforward =
true);
208 void setSelection(
const TQString& name);
236 OperationMode operationMode()
const;
249 void setKeepLocation(
bool keep );
255 bool keepsLocation()
const;
291 void setFilter(
const TQString& filter);
300 TQString currentFilter()
const;
312 void setFilterMimeType(
const TQString &label,
const KMimeType::List &types,
const KMimeType::Ptr &defaultType) TDE_DEPRECATED;
322 KMimeType::Ptr currentFilterMimeType();
335 void setMimeFilter(
const TQStringList& types,
336 const TQString& defaultType = TQString::null );
346 TQString currentMimeFilter()
const;
367 void setPreviewWidget(
const TQWidget *w) TDE_DEPRECATED;
407 static TQString getOpenFileName(
const TQString& startDir= TQString::null,
408 const TQString& filter= TQString::null,
410 const TQString& caption = TQString::null);
421 static TQString getOpenFileNameWId(
const TQString& startDir,
422 const TQString& filter,
423 WId parent_id,
const TQString& caption);
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);
482 static KURL getOpenURL(
const TQString& startDir = TQString::null,
483 const TQString& filter= TQString::null,
485 const TQString& caption = TQString::null);
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);
548 static TQString getSaveFileName(
const TQString& startDir= TQString::null,
549 const TQString& filter= TQString::null,
551 const TQString& caption = TQString::null);
559 static TQString getSaveFileNameWId(
const TQString& dir,
const TQString& filter,
561 const TQString& caption);
590 static KURL getSaveURL(
const TQString& startDir= TQString::null,
591 const TQString& filter= TQString::null,
593 const TQString& caption = TQString::null);
614 static TQString getExistingDirectory(
const TQString & startDir = TQString::null,
615 TQWidget * parent = 0,
616 const TQString& caption= TQString::null);
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 );
692 void setMode(
unsigned int m );
707 void setLocationLabel(
const TQString& text);
721 TDEToolBar *
toolBar()
const {
return toolbar; }
727 KPushButton *okButton()
const;
733 KPushButton *cancelButton()
const;
756 TDEActionCollection *actionCollection()
const;
762 int pathComboIndex();
776 static KURL getStartURL(
const TQString& startDir, TQString& recentDirClass );
782 static void setStartDir(
const KURL& directory );
824 static KURL *lastDirectory;
828 KFileFilterCombo *filterWidget;
833 virtual void keyPressEvent( TQKeyEvent *e );
839 void init(
const TQString& startDir,
const TQString& filter, TQWidget* widget);
845 virtual void initGUI();
851 void multiSelectionChanged();
856 virtual void readConfig( TDEConfig *,
const TQString& group = TQString::null );
861 virtual void writeConfig( TDEConfig *,
const TQString& group = TQString::null );
866 virtual void readRecentFiles( TDEConfig * );
871 virtual void saveRecentFiles( TDEConfig * );
879 KURL::List tokenize(
const TQString& line)
const;
885 KURL getCompleteURL(
const TQString&);
893 TQString currentFilterExtension();
903 void updateAutoSelectExtension();
907 void urlEntered(
const KURL& );
908 void enterURL(
const KURL& url );
909 void enterURL(
const TQString& url );
910 void locationActivated(
const TQString& url );
916 void toolbarCallback(
int);
921 void pathComboChanged(
const TQString& );
926 void dirCompletion(
const TQString& );
928 void slotFilterChanged();
929 void fileHighlighted(
const KFileItem *i);
930 void fileSelected(
const KFileItem *i);
931 void slotStatResult(TDEIO::Job* job);
932 void slotLoadingFinished();
934 void fileCompletion(
const TQString& );
938 void toggleSpeedbar(
bool );
943 void toggleBookmarks(
bool show);
948 virtual void updateStatusLine(
int dirs,
int files);
950 virtual void slotOk();
951 virtual void accept();
952 virtual void slotCancel();
954 void slotAutoSelectExtClicked();
955 void addToRecentDocuments();
959 void slotLocationChanged(
const TQString& text );
965 void setLocationText(
const TQString& text );
966 void updateLocationWhatsThis();
968 void appendExtension(KURL &url);
969 void updateLocationEditExtension(
const TQString &);
972 static void initStatic();
974 void setNonExtSelection();
978 bool autoDirectoryFollowing;
980 KURL::List& parseSelectedURLs()
const;
983 virtual void virtual_hook(
int id,
void* data );
985 KFileDialogPrivate *d;
This widget works as a network transparent filebrowser.
Provides a user (and developer) friendly way to select files and directories.
void filterChanged(const TQString &filter)
Emitted when the filter changed, i.e.
void fileHighlighted(const TQString &)
Emitted when the user highlights a file.
void selectionChanged()
Emitted when the user hilights one or more files in multiselection mode.
OperationMode
Defines some default behavior of the filedialog.
void fileSelected(const TQString &)
Emitted when the user selects a file.
TDEToolBar * toolBar() const
Returns a pointer to the toolbar.
This class defines an interface to all file views.
Mode
Modes of operation for the dialog.
KURLBar is a widget that displays icons together with a description.
This combobox shows a number of recent URLs/directories, as well as some default directories.