20 #ifndef TDEFILEDETAILVIEW_H
21 #define TDEFILEDETAILVIEW_H
27 #include <tdelistview.h>
28 #include <kmimetyperesolver.h>
30 #include "tdefileview.h"
40 const TQPixmap &icon, KFileItem *fi )
41 : TDEListViewItem( parent, text ), inf( fi ) {
50 : TDEListViewItem( parent ), inf( fi ) {
55 const TQPixmap &icon, KFileItem *fi,
56 TQListViewItem *after)
57 : TDEListViewItem( parent, after ), inf( fi ) {
62 inf->removeExtraData( listView() );
72 virtual TQString key(
int ,
bool )
const {
76 void setKey(
const TQString& key ) { m_key = key; }
80 TQRect r = listView()->itemRect(
this);
81 return TQRect( listView()->viewportToContents( r.topLeft() ),
82 TQSize( r.width(), r.height() ) );
95 class KFileListViewItemPrivate;
96 KFileListViewItemPrivate *d;
116 virtual TQWidget *
widget() {
return this; }
118 virtual void setAutoUpdate(
bool ) {}
120 virtual void setSelectionMode( KFile::SelectionMode sm );
128 virtual bool isSelected(
const KFileItem *i)
const;
135 virtual KFileItem * firstFileItem()
const;
136 virtual KFileItem * nextItem(
const KFileItem * )
const;
137 virtual KFileItem * prevItem(
const KFileItem * )
const;
147 void mimeTypeDeterminationFinished();
149 TQScrollView *scrollWidget()
const {
return (TQScrollView*)
this; }
151 virtual void readConfig( TDEConfig *,
const TQString& group = TQString::null );
152 virtual void writeConfig( TDEConfig *,
const TQString& group = TQString::null);
161 void dropped(TQDropEvent *event, KFileItem *fileItem);
168 void dropped(TQDropEvent *event,
const KURL::List &urls,
const KURL &url);
171 virtual void keyPressEvent( TQKeyEvent * );
174 virtual TQDragObject *dragObject();
175 virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
176 virtual void contentsDragMoveEvent( TQDragMoveEvent *e );
177 virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e );
178 virtual void contentsDropEvent( TQDropEvent *ev );
179 virtual bool acceptDrag(TQDropEvent* e )
const;
184 void slotSelectionChanged();
187 void slotSortingChanged(
int );
188 void selected( TQListViewItem *item );
189 void slotActivate( TQListViewItem *item );
190 void highlighted( TQListViewItem *item );
191 void slotActivateMenu ( TQListViewItem *item,
const TQPoint& pos );
195 virtual void insertItem(TQListViewItem *i) { TDEListView::insertItem(i); }
196 virtual void setSorting(
int i,
bool b) { TDEListView::setSorting(i, b); }
197 virtual void setSelected(TQListViewItem *i,
bool b) { TDEListView::setSelected(i, b); }
208 bool m_blockSortingSignal;
209 KMimeTypeResolver<KFileListViewItem,KFileDetailView> *m_resolver;
212 virtual void virtual_hook(
int id,
void* data );
214 class KFileDetailViewPrivate;
215 KFileDetailViewPrivate *d;
218 #endif // TDEFILEDETAILVIEW_H
void setCurrentItem(const TQString &filename)
Sets filename the current item in the view, if available.
virtual TQWidget * widget()
a pure virtual function to get a TQWidget, that can be added to other widgets.
virtual void insertItem(KFileItem *i)
The derived view must implement this function to add the file in the widget.
This class defines an interface to all file views.
virtual void clearSelection()=0
Clears any selection, unhighlights everything.
virtual void selectAll()
Selects all items.
virtual KFileItem * currentFileItem() const =0
virtual void setSelected(const KFileItem *, bool enable)=0
Tells the view that it should highlight the item.
KFileListViewItem(TQListView *parent, KFileItem *fi)
virtual bool isSelected(const KFileItem *) const =0
virtual void removeItem(const KFileItem *item)
Removes an item from the list; has to be implemented by the view.
virtual void invertSelection()
Inverts the current selection, i.e.
virtual void setSorting(TQDir::SortSpec sort)
Sets the sorting order of the view.
virtual void updateView(bool f=true)
does a repaint of the view.
virtual void ensureItemVisible(const KFileItem *i)=0
pure virtual function, that should be implemented to make item i visible, i.e.
virtual void clearView()=0
pure virtual function, that should be implemented to clear the view.
An item for the listiew, that has a reference to its corresponding KFileItem.
virtual void listingCompleted()
This hook is called when all items of the currently listed directory are listed and inserted into the...
KFileItem * fileInfo() const
A list-view capable of showing KFileItem'.