20 #ifndef TDEFILEICONVIEW_H
21 #define TDEFILEICONVIEW_H
25 #include <kiconview.h>
26 #include <kiconloader.h>
27 #include <tdefileview.h>
28 #include <kmimetyperesolver.h>
43 const TQPixmap &pixmap,
45 : TDEIconViewItem( parent, text, pixmap ), inf( fi ) {}
50 : TDEIconViewItem( parent ), inf( fi ) {}
65 class KFileIconViewItemPrivate;
66 KFileIconViewItemPrivate *d;
90 virtual TQWidget *
widget() {
return this; }
92 virtual void setAutoUpdate(
bool ) {}
101 virtual void setSelectionMode( KFile::SelectionMode sm );
104 virtual bool isSelected(
const KFileItem *i)
const;
111 virtual KFileItem * firstFileItem()
const;
112 virtual KFileItem * nextItem(
const KFileItem * )
const;
113 virtual KFileItem * prevItem(
const KFileItem * )
const;
118 void setIconSize(
int size );
123 void setPreviewSize(
int size );
132 void setIgnoreMaximumSize(
bool ignoreSize=
true);
141 virtual void setSorting(TQDir::SortSpec sort);
143 virtual void readConfig( TDEConfig *,
const TQString& group = TQString::null );
144 virtual void writeConfig( TDEConfig *,
const TQString& group = TQString::null);
147 void mimeTypeDeterminationFinished();
149 TQScrollView *scrollWidget()
const {
return (TQScrollView*)
this; }
150 void setAcceptDrops(
bool b)
152 TDEIconView::setAcceptDrops(b);
153 viewport()->setAcceptDrops(b);
173 virtual void arrangeItemsInGrid(
bool updated =
true );
179 virtual void keyPressEvent( TQKeyEvent * );
184 virtual void hideEvent( TQHideEvent * );
187 virtual void showEvent( TQShowEvent * );
189 virtual bool eventFilter( TQObject *o, TQEvent *e );
192 virtual TQDragObject *dragObject();
193 virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
194 virtual void contentsDragMoveEvent( TQDragMoveEvent *e );
195 virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e );
196 virtual void contentsDropEvent( TQDropEvent *ev );
199 bool acceptDrag(TQDropEvent* e )
const;
202 void selected( TQIconViewItem *item );
203 void slotActivate( TQIconViewItem * );
204 void highlighted( TQIconViewItem *item );
205 void showToolTip( TQIconViewItem *item );
206 void removeToolTip();
207 void slotActivateMenu( TQIconViewItem *,
const TQPoint& );
208 void slotSelectionChanged();
210 void slotSmallColumns();
211 void slotLargeRows();
212 void slotPreviewsToggled(
bool );
214 void slotPreviewResult( TDEIO::Job * );
215 void gotPreview(
const KFileItem *item,
const TQPixmap& pix );
225 void dropped(TQDropEvent *event, KFileItem *fileItem);
232 void dropped(TQDropEvent *event,
const KURL::List &urls,
const KURL &url);
235 KMimeTypeResolver<KFileIconViewItem,KFileIconView> *m_resolver;
241 virtual void insertItem(TQIconViewItem *a, TQIconViewItem *b) { TDEIconView::insertItem(a, b); }
242 virtual void setSelectionMode(TQIconView::SelectionMode m) { TDEIconView::setSelectionMode(m); }
243 virtual void setSelected(TQIconViewItem *i,
bool a,
bool b) { TDEIconView::setSelected(i, a, b); }
245 bool canPreview(
const KFileItem * )
const;
257 bool updateTextAndPixmap );
260 virtual void virtual_hook(
int id,
void* data );
262 class KFileIconViewPrivate;
263 KFileIconViewPrivate *d;
266 #endif // TDEFILESIMPLEVIEW_H
virtual void insertItem(KFileItem *i)
The derived view must implement this function to add the file in the widget.
virtual void listingCompleted()
This hook is called when all items of the currently listed directory are listed and inserted into the...
virtual void updateView(bool f=true)
does a repaint of the view.
KFileItem * fileInfo() const
virtual void setSorting(TQDir::SortSpec sort)
Sets the sorting order of the view.
This class defines an interface to all file views.
virtual bool isSelected(const KFileItem *) const =0
virtual void invertSelection()
Inverts the current selection, i.e.
virtual void clearView()=0
pure virtual function, that should be implemented to clear the view.
virtual KFileItem * currentFileItem() const =0
An icon-view capable of showing KFileItem's.
virtual void removeItem(const KFileItem *item)
Removes an item from the list; has to be implemented by the view.
virtual void setSelected(const KFileItem *, bool enable)=0
Tells the view that it should highlight the item.
void setCurrentItem(const TQString &filename)
Sets filename the current item in the view, if available.
An item for the iconview, that has a reference to its corresponding KFileItem.
virtual void ensureItemVisible(const KFileItem *i)=0
pure virtual function, that should be implemented to make item i visible, i.e.
virtual TQWidget * widget()
a pure virtual function to get a TQWidget, that can be added to other widgets.
KFileIconViewItem(TQIconView *parent, KFileItem *fi)
virtual void selectAll()
Selects all items.
virtual void clearSelection()=0
Clears any selection, unhighlights everything.