# kio Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KFileDetailView Class Reference

A list-view capable of showing KFileItem'. More...

`#include <kfiledetailview.h>`

Inheritance diagram for KFileDetailView:

[legend]
Collaboration diagram for KFileDetailView:

[legend]
List of all members.

## Public Member Functions

| KFileDetailView (QWidget *parent, const char *name)
virtual QWidget * | widget ()
| a pure virtual function to get a QWidget, that can be added to other widgets.
virtual void | clearView ()
| pure virtual function, that should be implemented to clear the view.
virtual void | setAutoUpdate (bool)
virtual void | setSelectionMode (KFile::SelectionMode sm)
virtual void | updateView (bool)
| does a repaint of the view.
virtual void | updateView (const KFileItem *)
virtual void | removeItem (const KFileItem *)
| Removes an item from the list; has to be implemented by the view.
virtual void | listingCompleted ()
| This hook is called when all items of the currently listed directory are listed and inserted into the view, i.e.
virtual void | setSelected (const KFileItem *, bool)
| Tells the view that it should highlight the item.
virtual bool | isSelected (const KFileItem *i) const
virtual void | clearSelection ()
| Clears any selection, unhighlights everything.
virtual void | selectAll ()
| Selects all items.
virtual void | invertSelection ()
| Inverts the current selection, i.e.
virtual void | setCurrentItem (const KFileItem *)
| Reimplement this to set `item` the current item in the view, e.g.
virtual KFileItem * | currentFileItem () const
virtual KFileItem * | firstFileItem () const
virtual KFileItem * | nextItem (const KFileItem *) const
virtual KFileItem * | prevItem (const KFileItem *) const
virtual void | insertItem (KFileItem *i)
| The derived view must implement this function to add the file in the widget.
virtual void | setSorting (QDir::SortSpec)
| Sets the sorting order of the view.
void | ensureItemVisible (const KFileItem *)
| pure virtual function, that should be implemented to make item i visible, i.e.
void | mimeTypeDeterminationFinished ()
void | determineIcon (KFileListViewItem *item)
QScrollView * | scrollWidget () const

## Protected Slots

void | slotSelectionChanged ()

## Protected Member Functions

virtual void | keyPressEvent (QKeyEvent *)
virtual void | virtual_hook (int id, void *data)

## Protected Attributes

int | m_sortingCol

## Detailed Description

A list-view capable of showing KFileItem'.

Used in the filedialog for example. Most of the documentation is in KFileView class.

See also:
  KDirOperator

  KCombiView

  KFileIconView

Definition at line 109 of file kfiledetailview.h.

## Member Function Documentation

virtual QWidget* KFileDetailView::widget | ( |  | ) | `[inline, virtual]`

| a pure virtual function to get a QWidget, that can be added to other widgets. This function is needed to make it possible for derived classes to derive from other widgets. Implements KFileView. Definition at line 117 of file kfiledetailview.h.

void KFileDetailView::clearView | ( |  | ) | `[virtual]`

| pure virtual function, that should be implemented to clear the view. At this moment the list is already empty Implements KFileView. Definition at line 174 of file kfiledetailview.cpp. References QListView::clear(), QPtrList< KFileListViewItem >::clear(), and KMimeTypeResolver< KFileListViewItem, KFileDetailView >::m_lstPendingMimeIconItems.

void KFileDetailView::updateView | ( | bool |  | ) | `[virtual]`

does a repaint of the view.

The default implementation calls

    widget()->repaint(f)

Reimplemented from KFileView.

Definition at line 268 of file kfiledetailview.cpp.

References QListViewItemIterator::current(), KFileListViewItem::fileInfo(), KFileItem::pixmap(), QListViewItem::setPixmap(), and KIcon::SizeSmall.

void KFileDetailView::removeItem | ( | const KFileItem * |  | ) | `[virtual]`

| Removes an item from the list; has to be implemented by the view. Call KFileView::removeItem( item ) after removing it. Reimplemented from KFileView. Definition at line 312 of file kfiledetailview.cpp. References KFileItem::extraData(), KMimeTypeResolver< KFileListViewItem, KFileDetailView >::m_lstPendingMimeIconItems, QPtrList< KFileListViewItem >::remove(), and KFileView::removeItem().

void KFileDetailView::listingCompleted | ( |  | ) | `[virtual]`

| This hook is called when all items of the currently listed directory are listed and inserted into the view, i.e. there won't come any new items anymore. Reimplemented from KFileView. Definition at line 501 of file kfiledetailview.cpp. References KMimeTypeResolver< KFileListViewItem, KFileDetailView >::start().

void KFileDetailView::setSelected | ( | const KFileItem * | ,
|  | bool |
| ) | `[virtual]`

| Tells the view that it should highlight the item. This function must be implemented by the view. Implements KFileView. Definition at line 115 of file kfiledetailview.cpp. References KFileItem::extraData(), and QListView::setSelected().

bool KFileDetailView::isSelected | ( | const KFileItem * | i | ) | const`[virtual]`

Returns:
  whether the given item is currently selected. Must be implemented by the view.

Implements KFileView.

Definition at line 258 of file kfiledetailview.cpp.

References KFileItem::extraData(), and QListViewItem::isSelected().

void KFileDetailView::clearSelection | ( |  | ) | `[virtual]`

| Clears any selection, unhighlights everything. Must be implemented by the view. Implements KFileView. Definition at line 145 of file kfiledetailview.cpp. References QListView::clearSelection().

void KFileDetailView::selectAll | ( |  | ) | `[virtual]`

| Selects all items. You may want to override this, if you can implement it more efficiently than calling setSelected() with every item. This works only in Multiselection mode of course. Reimplemented from KFileView. Definition at line 150 of file kfiledetailview.cpp. References QListView::selectAll().

void KFileDetailView::invertSelection | ( |  | ) | `[virtual]`

| Inverts the current selection, i.e. selects all items, that were up to now not selected and deselects the other. Reimplemented from KFileView. Definition at line 159 of file kfiledetailview.cpp. References QListView::invertSelection().

void KFileDetailView::setCurrentItem | ( | const KFileItem * |  | ) | `[virtual]`

| Reimplement this to set `item` the current item in the view, e.g. the item having focus. Implements KFileView. Definition at line 127 of file kfiledetailview.cpp. References KFileItem::extraData(), and QListView::setCurrentItem().

KFileItem * KFileDetailView::currentFileItem | ( |  | ) | const`[virtual]`

Returns:
  the "current" KFileItem, e.g. where the cursor is. Returns 0L when there is no current item (e.g. in an empty view). Subclasses have to implement this.

Implements KFileView.

Definition at line 136 of file kfiledetailview.cpp.

References QListView::currentItem(), and KFileListViewItem::fileInfo().

void KFileDetailView::insertItem | ( | KFileItem * | i | ) | `[virtual]`

The derived view must implement this function to add the file in the widget.

Make sure to call this implementation, i.e. KFileView::insertItem( i );

Reimplemented from KFileView.

Definition at line 180 of file kfiledetailview.cpp.

References QPtrList< KFileListViewItem >::append(), KFileView::insertItem(), KFileItem::isMimeTypeKnown(), KMimeTypeResolver< KFileListViewItem, KFileDetailView >::m_lstPendingMimeIconItems, and KFileItem::setExtraData().

void KFileDetailView::setSorting | ( | QDir::SortSpec |  | ) | `[virtual]`

Sets the sorting order of the view.

Default is QDir::Name | QDir::IgnoreCase | QDir::DirsFirst Override this in your subclass and sort accordingly (usually by setting the sorting-key for every item and telling QIconView or QListView to sort.

A view may choose to use a different sorting than QDir::Name, Time or Size. E.g. to sort by mimetype or any possible string. Set the sorting to QDir::Unsorted for that and do the rest internally.

See also:
  sortingKey

Reimplemented from KFileView.

Definition at line 396 of file kfiledetailview.cpp.

References KFileView::setSorting().

void KFileDetailView::ensureItemVisible | ( | const KFileItem * |  | ) | `[virtual]`

| pure virtual function, that should be implemented to make item i visible, i.e. by scrolling the view appropriately. Implements KFileView. Definition at line 424 of file kfiledetailview.cpp. References QListView::ensureItemVisible(), and KFileItem::extraData().

The documentation for this class was generated from the following files:

- kfiledetailview.h
- kfiledetailview.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:16:36 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001