kio Library API Documentation

KCombiView Class Reference

This view is designed to combine two KFileViews into one widget, to show directories on the left side and files on the right side. More...

#include <kcombiview.h>

Inheritance diagram for KCombiView:

QSplitter KFileView List of all members.

Public Methods

virtual QWidgetwidget ()
 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 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.

void setRight (KFileView *view)
 Sets the view to be shown in the right.

virtual void setSelectionMode (KFile::SelectionMode sm)
virtual void setSelected (const KFileItem *, bool)
 Tells the view that it should highlight the item.

virtual bool isSelected (const KFileItem *) 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 KFileItemcurrentFileItem () const
virtual KFileItemfirstFileItem () const
virtual KFileItemnextItem (const KFileItem *) const
virtual KFileItemprevItem (const KFileItem *) const
virtual void insertItem (KFileItem *i)
 The derived view must implement this function to add the file in the widget.

virtual void clear ()
 Clears the view and all item lists.

virtual void setSorting (QDir::SortSpec sort)
 Sets the sorting order of the view.

virtual void readConfig (KConfig *, const QString &group=QString::null)
virtual void writeConfig (KConfig *, const QString &group=QString::null)
void ensureItemVisible (const KFileItem *)
 pure virtual function, that should be implemented to make item i visible, i.e.

virtual KActionCollectionactionCollection () const

Protected Methods

virtual void virtual_hook (int id, void *data)

Detailed Description

This view is designed to combine two KFileViews into one widget, to show directories on the left side and files on the right side.

Methods like selectedItems() to query status _only_ work on the right side, i.e. on the files.

After creating the KCombiView, you need to supply the view shown in the right, (see setRight()). Available KFileView implementations are KFileIconView and KFileDetailView.

Most of the below methods are just implementations of the baseclass KFileView, so look there for documentation.

See also:
KFileView , KFileIconView , KFileDetailView , KDirOperator

Definition at line 53 of file kcombiview.h.


Member Function Documentation

virtual QWidget* KCombiView::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 62 of file kcombiview.h.

void KCombiView::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 103 of file kcombiview.cpp.

References KFileView::clearView(), and KFileIconView::clearView().

void KCombiView::updateView bool    [virtual]
 

does a repaint of the view.

The default implementation calls

widget()->repaint(f)

Reimplemented from KFileView.

Definition at line 110 of file kcombiview.cpp.

References KFileView::updateView(), and KFileIconView::updateView().

void KCombiView::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 124 of file kcombiview.cpp.

References KFileView::removeItem(), and KFileIconView::removeItem().

void KCombiView::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 132 of file kcombiview.cpp.

References KFileView::listingCompleted(), and KFileIconView::listingCompleted().

void KCombiView::setRight KFileView   view
 

Sets the view to be shown in the right.

You need to call this before doing anything else with this widget.

Definition at line 64 of file kcombiview.cpp.

References QIconView::gridX(), KFileView::setParentView(), QSplitter::setResizeMode(), QSplitter::setSizes(), KFileView::setViewName(), QIconView::spacing(), and KFileView::viewName().

Referenced by KDirOperator::createView().

void KCombiView::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 184 of file kcombiview.cpp.

References KFileView::setSelected(), and KFileIconView::setSelected().

bool KCombiView::isSelected const KFileItem   const [virtual]
 

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

Implements KFileView.

Definition at line 168 of file kcombiview.cpp.

References KFileIconView::isSelected(), and KFileView::isSelected().

void KCombiView::clearSelection   [virtual]
 

Clears any selection, unhighlights everything.

Must be implemented by the view.

Implements KFileView.

Definition at line 147 of file kcombiview.cpp.

References KFileView::clearSelection(), and KFileIconView::clearSelection().

void KCombiView::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 154 of file kcombiview.cpp.

References KFileView::selectAll(), and KFileIconView::selectAll().

void KCombiView::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 161 of file kcombiview.cpp.

References KFileView::invertSelection(), and KFileIconView::invertSelection().

void KCombiView::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 191 of file kcombiview.cpp.

References KFileView::setCurrentItem(), and KFileIconView::setCurrentItem().

KFileItem * KCombiView::currentFileItem   [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 198 of file kcombiview.cpp.

References KFileView::currentFileItem(), and KFileIconView::currentFileItem().

void KCombiView::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 79 of file kcombiview.cpp.

References KFileIconView::insertItem(), KFileView::insertItem(), KFileItem::isDir(), and KFileView::updateNumbers().

void KCombiView::clear   [virtual]
 

Clears the view and all item lists.

Reimplemented from KFileView.

Definition at line 139 of file kcombiview.cpp.

References KFileView::clear().

void KCombiView::setSorting QDir::SortSpec    sort [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 93 of file kcombiview.cpp.

References KFileIconView::setSorting(), KFileView::setSorting(), and KFileView::sorting().

void KCombiView::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 214 of file kcombiview.cpp.

References KFileView::ensureItemVisible(), and KFileIconView::ensureItemVisible().

KActionCollection * KCombiView::actionCollection   [virtual]
 

Returns:
the view-specific action-collection. Every view should add its actions here (if it has any) to make them available to e.g. the KDirOperator's popup-menu.

Reimplemented from KFileView.

Definition at line 314 of file kcombiview.cpp.

References KFileView::actionCollection().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:34 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001