20 #ifndef TDEDIROPERATOR_H_
21 #define TDEDIROPERATOR_H_
24 #include <tqptrstack.h>
26 #include <tdeaction.h>
27 #include <kcompletion.h>
28 #include <kdirlister.h>
29 #include <tdefileview.h>
30 #include <tdefileitem.h>
38 class TDEToggleAction;
39 class TDEActionSeparator;
118 TQWidget *parent = 0,
const char* name = 0);
140 virtual bool close(
bool alsoDelete ) {
return TQWidget::close( alsoDelete ); }
149 void setNameFilter(
const TQString& filter);
155 const TQString&
nameFilter()
const {
return dir->nameFilter(); }
174 void setMimeFilter(
const TQStringList& mimetypes );
179 TQStringList
mimeFilter()
const {
return dir->mimeFilters(); }
201 void setURL(
const KURL& url,
bool clearforward);
207 void setCurrentItem(
const TQString& filename );
232 TQWidget *
viewWidget()
const {
return m_fileView ? m_fileView->widget() : 0L; }
239 void setView(KFile::FileView view);
244 void setSorting( TQDir::SortSpec );
249 TQDir::SortSpec
sorting()
const {
return mySorting; }
254 bool isRoot()
const {
return url().path() == TQChar(
'/'); }
265 KProgress * progressBar()
const;
291 void setPreviewWidget(
const TQWidget *w);
298 return ( m_fileView ? m_fileView->selectedItems() : 0L );
305 return ( m_fileView ? m_fileView->isSelected( item ) :
false );
318 int numFiles()
const;
329 return const_cast<TDECompletion *
>( &myCompletion );
341 return const_cast<TDECompletion *
>( &myDirCompletion );
409 void setViewConfig( TDEConfig *config,
const TQString& group );
418 TDEConfig *viewConfig();
427 TQString viewConfigGroup()
const;
442 virtual void readConfig( TDEConfig *,
const TQString& group = TQString::null );
450 virtual void writeConfig( TDEConfig *,
const TQString& group = TQString::null );
463 void setOnlyDoubleClickSelectsFiles(
bool enable );
470 bool onlyDoubleClickSelectsFiles()
const;
481 bool mkdir(
const TQString& directory,
bool enterDirectory =
true );
491 TDEIO::DeleteJob * del(
const KFileItemList& items,
492 bool ask =
true,
bool showProgress =
true );
504 TDEIO::DeleteJob * del(
const KFileItemList& items, TQWidget *parent,
505 bool ask =
true,
bool showProgress =
true );
523 void setEnableDirHighlighting(
bool enable );
531 bool dirHighlighting()
const;
539 static bool dirOnlyMode( uint mode ) {
540 return ( (mode & KFile::Directory) &&
541 (mode & (KFile::File | KFile::Files)) == 0 );
548 void setupMenu(
int whichActions);
554 virtual void setAcceptDrops(
bool b);
562 void setDropOptions(
int options);
574 TDEIO::CopyJob * trash(
const KFileItemList& items, TQWidget *parent,
575 bool ask =
true,
bool showProgress =
true );
592 virtual KFileView* createView( TQWidget* parent, KFile::FileView view );
597 void setDirLister( KDirLister *lister );
599 virtual void resizeEvent( TQResizeEvent * );
611 void updateSortActions();
617 void updateViewActions();
633 void prepareCompletionObjects();
640 bool checkPreviewSupport();
688 void deleteSelected();
695 void updateSelectionDependentActions();
700 TQString makeCompletion(
const TQString&);
705 TQString makeDirCompletion(
const TQString&);
712 void trashSelected(TDEAction::ActivationReason, TQt::ButtonState);
731 void insertNewFiles(
const KFileItemList &newone);
737 void itemDeleted(KFileItem *);
743 void selectDir(
const KFileItem *item );
748 void selectFile(
const KFileItem *item);
758 virtual void activatedMenu(
const KFileItem *,
const TQPoint& pos );
778 void sortReversed() { reverseAction->setChecked( !reverseAction->isChecked() ); }
783 void toggleDirsFirst() { dirsFirstAction->setChecked( !dirsFirstAction->isChecked() ); }
788 void toggleIgnoreCase() { caseInsensitiveAction->setChecked( !caseInsensitiveAction->isChecked() ); }
794 void slotCompletionMatch(
const TQString& match);
797 void urlEntered(
const KURL& );
798 void updateInformation(
int files,
int dirs);
799 void completion(
const TQString&);
800 void finishedLoading();
815 void dirActivated(
const KFileItem *item );
816 void fileSelected(
const KFileItem *item );
825 void dropped(
const KFileItem *item, TQDropEvent*event,
const KURL::List&urls);
830 TQPtrStack<KURL> backStack;
835 TQPtrStack<KURL> forwardStack;
840 TDECompletion myCompletion;
841 TDECompletion myDirCompletion;
842 bool myCompleteListDirty;
843 TQDir::SortSpec mySorting;
849 bool checkPreviewInternal()
const;
855 void checkPath(
const TQString& txt,
bool takeFiles =
false);
859 bool openURL(
const KURL& url,
bool keep =
false,
bool reload =
false );
862 KFileItemList pendingMimeTypes;
871 const TQWidget *myPreview;
875 TDEActionMenu *actionMenu;
877 TDEAction *backAction;
878 TDEAction *forwardAction;
879 TDEAction *homeAction;
881 TDEAction *reloadAction;
882 TDEActionSeparator *actionSeparator;
883 TDEAction *mkdirAction;
885 TDEActionMenu *sortActionMenu;
886 TDERadioAction *byNameAction;
887 TDERadioAction *byDateAction;
888 TDERadioAction *bySizeAction;
889 TDEToggleAction *reverseAction;
890 TDEToggleAction *dirsFirstAction;
891 TDEToggleAction *caseInsensitiveAction;
893 TDEActionMenu *viewActionMenu;
894 TDERadioAction *shortAction;
895 TDERadioAction *detailedAction;
896 TDEToggleAction *showHiddenAction;
897 TDEToggleAction *separateDirsAction;
899 TDEActionCollection *myActionCollection;
900 TDEActionCollection *viewActionCollection;
906 void slotDetailedView();
907 void slotSimpleView();
908 void slotToggleHidden(
bool );
910 void slotSeparateDirs();
911 void slotDefaultPreview();
912 void togglePreview(
bool );
914 void slotSortByName();
915 void slotSortBySize();
916 void slotSortByDate();
917 void slotSortReversed();
918 void slotToggleDirsFirst();
919 void slotToggleIgnoreCase();
922 void slotProgress(
int );
923 void slotShowProgress();
924 void slotIOFinished();
926 void slotRedirected(
const KURL& );
928 void slotViewActionAdded( TDEAction * );
929 void slotViewActionRemoved( TDEAction * );
930 void slotViewSortingChanged( TQDir::SortSpec );
932 void slotClearView();
933 void slotRefreshItems(
const KFileItemList& items );
935 void slotProperties();
937 void insertViewDependentActions();
940 bool eventFilter(TQObject *obj, TQEvent *ev);
943 static bool isReadable(
const KURL& url );
946 virtual void virtual_hook(
int id,
void* data );
948 class KDirOperatorPrivate;
949 KDirOperatorPrivate *d;
This widget works as a network transparent filebrowser.
const TQString & nameFilter() const
void dropped(const KFileItem *item, TQDropEvent *event, const KURL::List &urls)
Emitted when files are dropped.
void sortByDate()
Changes sorting to sort by date.
void setShowHiddenFiles(bool s)
Enables/disables showing hidden files.
void sortReversed()
Changes sorting to reverse sorting.
ActionTypes
The various action types.
TQStringList mimeFilter() const
void toggleIgnoreCase()
Toggles case sensitive / case insensitive sorting.
TQWidget * viewWidget() const
Returns the widget of the current view.
void toggleDirsFirst()
Toggles showing directories first / having them sorted like files.
TDECompletion * dirCompletionObject() const
void sortByName()
Changes sorting to sort by name.
bool isSelected(const KFileItem *item) const
bool showHiddenFiles() const
KDirLister * dirLister() const
void fileHighlighted(const KFileItem *item)
Emitted when a file is highlighted or generally the selection changes in multiselection mode.
virtual bool close(bool alsoDelete)
Reimplemented to avoid "hidden virtual" warnings.
const KFileItemList * selectedItems() const
TDEActionCollection * actionCollection() const
an accessor to a collection of all available Actions.
TQDir::SortSpec sorting() const
TDECompletion * completionObject() const
void sortBySize()
Changes sorting to sort by size.
void viewChanged(KFileView *newView)
Emitted whenever the current fileview is changed, either by an explicit call to setView() or by the u...
void highlightFile(const KFileItem *i)
Emits fileHighlighted( i )
This class defines an interface to all file views.
Mode
Modes of operation for the dialog.