21 #ifndef TDEFILEICONVIEW_H
22 #define TDEFILEICONVIEW_H
26 #include <kiconview.h>
27 #include <kiconloader.h>
28 #include <tdefileview.h>
29 #include <kmimetyperesolver.h>
44 const TQPixmap &pixmap,
46 : TDEIconViewItem( parent, text, pixmap ), inf( fi ) {}
51 : TDEIconViewItem( parent ), inf( fi ) {}
66 class KFileIconViewItemPrivate;
67 KFileIconViewItemPrivate *d;
91 virtual TQWidget *
widget() {
return this; }
93 virtual void setAutoUpdate(
bool ) {}
102 virtual void setSelectionMode( KFile::SelectionMode sm );
105 virtual bool isSelected(
const KFileItem *i)
const;
112 virtual KFileItem * firstFileItem()
const;
113 virtual KFileItem * nextItem(
const KFileItem * )
const;
114 virtual KFileItem * prevItem(
const KFileItem * )
const;
119 void setIconSize(
int size );
124 void setPreviewSize(
int size );
133 void setIgnoreMaximumSize(
bool ignoreSize=
true);
142 virtual void setSorting(TQDir::SortSpec sort);
144 virtual void readConfig( TDEConfig *,
const TQString& group = TQString::null );
145 virtual void writeConfig( TDEConfig *,
const TQString& group = TQString::null);
148 void mimeTypeDeterminationFinished();
150 TQScrollView *scrollWidget()
const {
return (TQScrollView*)
this; }
151 void setAcceptDrops(
bool b)
153 TDEIconView::setAcceptDrops(b);
154 viewport()->setAcceptDrops(b);
174 virtual void arrangeItemsInGrid(
bool updated =
true );
180 virtual void keyPressEvent( TQKeyEvent * );
185 virtual void hideEvent( TQHideEvent * );
188 virtual void showEvent( TQShowEvent * );
190 virtual bool eventFilter( TQObject *o, TQEvent *e );
193 virtual TQDragObject *dragObject();
194 virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
195 virtual void contentsDragMoveEvent( TQDragMoveEvent *e );
196 virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e );
197 virtual void contentsDropEvent( TQDropEvent *ev );
200 bool acceptDrag(TQDropEvent* e )
const;
203 void selected( TQIconViewItem *item );
204 void slotActivate( TQIconViewItem * );
205 void highlighted( TQIconViewItem *item );
206 void showToolTip( TQIconViewItem *item );
207 void removeToolTip();
208 void slotActivateMenu( TQIconViewItem *,
const TQPoint& );
209 void slotSelectionChanged();
211 void slotSmallColumns();
212 void slotLargeRows();
213 void slotPreviewsToggled(
bool );
215 void slotPreviewResult( TDEIO::Job * );
216 void gotPreview(
const KFileItem *item,
const TQPixmap& pix );
226 void dropped(TQDropEvent *event, KFileItem *fileItem);
233 void dropped(TQDropEvent *event,
const KURL::List &urls,
const KURL &url);
236 KMimeTypeResolver<KFileIconViewItem,KFileIconView> *m_resolver;
242 virtual void insertItem(TQIconViewItem *a, TQIconViewItem *b) { TDEIconView::insertItem(a, b); }
243 virtual void setSelectionMode(TQIconView::SelectionMode m) { TDEIconView::setSelectionMode(m); }
244 virtual void setSelected(TQIconViewItem *i,
bool a,
bool b) { TDEIconView::setSelected(i, a, b); }
246 bool canPreview(
const KFileItem * )
const;
258 bool updateTextAndPixmap );
261 virtual void virtual_hook(
int id,
void* data );
263 class KFileIconViewPrivate;
264 KFileIconViewPrivate *d;
267 #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.