25class TDEActionCollection;
29#include "tdefileitem.h"
47 emit dirActivated( item );
49 emit fileSelected( item );
57 void activateMenu(
const KFileItem *i,
const TQPoint& pos ) {
58 emit activatedMenu( i, pos );
61 void changeSorting( TQDir::SortSpec sorting ) {
62 emit sortingChanged( sorting );
65 void dropURLs(
const KFileItem *i, TQDropEvent*e,
const KURL::List&urls) {
66 emit dropped(i, e, urls);
70 void dirActivated(
const KFileItem*);
72 void sortingChanged( TQDir::SortSpec );
79 void fileSelected(
const KFileItem*);
80 void activatedMenu(
const KFileItem *i,
const TQPoint& );
81 void dropped(
const KFileItem *, TQDropEvent*,
const KURL::List&);
97class TDEIO_EXPORT KFileView {
105 virtual ~KFileView();
122 TQWidget *
widget()
const {
return const_cast<KFileView*
>(
this)->
widget(); }
127 void setCurrentItem(
const TQString &filename );
145 virtual void clear();
163 virtual void removeItem(
const KFileItem *item);
176 TQDir::SortSpec
sorting()
const {
return m_sorting; }
192 virtual void setSorting(TQDir::SortSpec sort);
198 bool isReversed()
const {
return (m_sorting & TQDir::Reversed); }
205 uint
count()
const {
return filesNumber + dirsNumber; }
217 virtual void setSelectionMode( KFile::SelectionMode sm );
218 virtual KFile::SelectionMode selectionMode()
const;
223 All = Files | Directories
225 virtual void setViewMode( ViewMode vm );
226 virtual ViewMode viewMode()
const {
return view_mode; }
241 virtual void setParentView(
KFileView *parent);
251 virtual void insertItem( KFileItem *i);
304 const KFileItemList *
items()
const;
306 virtual KFileItem * firstFileItem()
const = 0;
307 virtual KFileItem * nextItem(
const KFileItem * )
const = 0;
308 virtual KFileItem * prevItem(
const KFileItem * )
const = 0;
321 myOnlyDoubleClickSelectsFiles = enable;
330 return myOnlyDoubleClickSelectsFiles;
337 bool updateNumbers(
const KFileItem *i);
344 virtual TDEActionCollection * actionCollection()
const;
348 virtual void readConfig( TDEConfig *,
const TQString& group = TQString::null );
349 virtual void writeConfig( TDEConfig *,
const TQString& group = TQString::null);
367 void setDropOptions(
int options);
389 static TQString sortingKey(
const TQString& value,
bool isDir,
int sortSpec);
397 static TQString sortingKey( TDEIO::filesize_t value,
bool isDir,
int sortSpec);
403 static int autoOpenDelay();
413 static TQDir::SortSpec defaultSortSpec;
414 TQDir::SortSpec m_sorting;
424 KFile::SelectionMode selection_mode;
428 mutable KFileItemList m_itemList;
430 mutable KFileItemList *m_selectedList;
431 bool myOnlyDoubleClickSelectsFiles;
434 virtual void virtual_hook(
int id,
void* data );
436 enum { VIRTUAL_SET_DROP_OPTIONS = 1 };
437 void setDropOptions_impl(
int options);
439 class KFileViewPrivate;
internal class to make easier to use signals possible
void activate(const KFileItem *item)
Call this method when an item is selected (depends on single click / double click configuration).
void highlightFile(const KFileItem *i)
emits the highlighted signal for item.
void fileHighlighted(const KFileItem *)
the item maybe be 0L, indicating that we're in multiselection mode and the selection has changed.
This class defines an interface to all file views.
virtual void clearSelection()=0
Clears any selection, unhighlights everything.
TQString viewName() const
bool onlyDoubleClickSelectsFiles() const
void setViewName(const TQString &name)
Sets the name of the view, which could be displayed somewhere.
virtual void listingCompleted()
This hook is called when all items of the currently listed directory are listed and inserted into the...
const KFileItemList * items() const
bool isReversed() const
Tells whether the current items are in reversed order (shortcut to sorting() & TQDir::Reversed).
DropOptions
Various options for drag and drop support.
void setOnlyDoubleClickSelectsFiles(bool enable)
This is a KFileDialog specific hack: we want to select directories with single click,...
const KFileItemList * selectedItems() const
TQDir::SortSpec sorting() const
Returns the sorting order of the internal list.
virtual KFileItem * currentFileItem() const =0
virtual void updateView(bool f=true)
does a repaint of the view.
virtual TQWidget * widget()=0
a pure virtual function to get a TQWidget, that can be added to other widgets.
virtual void setCurrentItem(const KFileItem *item)=0
Reimplement this to set item the current item in the view, e.g.
virtual void removeItem(const KFileItem *item)
Removes an item from the list; has to be implemented by the view.
TQWidget * widget() const
virtual void ensureItemVisible(const KFileItem *i)=0
pure virtual function, that should be implemented to make item i visible, i.e.
virtual void clear()
Clears the view and all item lists.
virtual void selectAll()
Selects all items.
void addItemList(const KFileItemList &list)
inserts a list of items.
virtual void setSelected(const KFileItem *, bool enable)=0
Tells the view that it should highlight the item.
virtual bool isSelected(const KFileItem *) const =0
virtual void clearView()=0
pure virtual function, that should be implemented to clear the view.
virtual void invertSelection()
Inverts the current selection, i.e.