kio Library API Documentation

KFileTreeBranch Class Reference

This is the branch class of the KFileTreeView, which represents one branch in the treeview. Branch object for KFileTreeView object. More...

#include <kfiletreebranch.h>

Inheritance diagram for KFileTreeBranch:

KDirLister QObject List of all members.

Public Slots

virtual bool populate (const KURL &url, KFileTreeViewItem *currItem)
 populates a branch.

virtual void setShowExtensions (bool visible=true)
 sets printing of the file extensions on or off.

void setOpenPixmap (const QPixmap &pix)

Signals

void populateFinished (KFileTreeViewItem *)
 emitted with the item of a directory which was finished to populate

void newTreeViewItems (KFileTreeBranch *, const KFileTreeViewItemList &)
 emitted with a list of new or updated KFileTreeViewItem which were found in a branch.

void directoryChildCount (KFileTreeViewItem *item, int count)
 emitted with the exact count of children for a directory.


Public Member Functions

 KFileTreeBranch (KFileTreeView *, const KURL &url, const QString &name, const QPixmap &pix, bool showHidden=false, KFileTreeViewItem *branchRoot=0)
 constructs a branch for KFileTreeView.

KURL rootUrl () const
virtual void setRoot (KFileTreeViewItem *r)
 sets a KFileTreeViewItem as root widget for the branch.

KFileTreeViewItemroot ()
QString name () const
virtual void setName (const QString n)
 sets the name of the branch.

const QPixmappixmap ()
const QPixmapopenPixmap ()
bool showExtensions () const
void setOpen (bool setopen=true)
 sets the root of the branch open or closed.

void setChildRecurse (bool t=true)
 sets if children recursion is wanted or not.

bool childRecurse ()
virtual KFileTreeViewItemfindTVIByURL (const KURL &)
 find the according KFileTreeViewItem by an url


Protected Member Functions

virtual KFileTreeViewItemcreateTreeViewItem (KFileTreeViewItem *parent, KFileItem *fileItem)
 allocates a KFileTreeViewItem for the branch for new items.

virtual void virtual_hook (int id, void *data)

Detailed Description

This is the branch class of the KFileTreeView, which represents one branch in the treeview. Branch object for KFileTreeView object.

Every branch has a root which is an url. The branch lists the files unter the root. Every branch uses its own dirlister and can have its own filter etc.

Definition at line 49 of file kfiletreebranch.h.


Constructor & Destructor Documentation

KFileTreeBranch::KFileTreeBranch KFileTreeView ,
const KURL url,
const QString name,
const QPixmap pix,
bool  showHidden = false,
KFileTreeViewItem branchRoot = 0
 

constructs a branch for KFileTreeView.

Does not yet start to list it.

Parameters:
url start url of the branch.
name the name of the branch, which is displayed in the first column of the treeview.
pix is a pixmap to display as an icon of the branch.
showHidden flag to make hidden files visible or not.
branchRoot is the KFileTreeViewItem to use as the root of the branch, with the default 0 meaning to let KFileTreeBranch create it for you.

Definition at line 35 of file kfiletreebranch.cpp.

References QValueList< KURL >::append(), KDirLister::canceled(), KDirLister::clear(), KDirLister::completed(), QObject::connect(), KDirLister::deleteItem(), KStdAccel::name(), KDirLister::newItems(), KURL::prettyURL(), KDirLister::redirection(), QListViewItem::setExpandable(), QListViewItem::setPixmap(), KDirLister::setShowingDotFiles(), QListViewItem::setText(), and KDirLister::started().


Member Function Documentation

KURL KFileTreeBranch::rootUrl  )  const [inline]
 

Returns:
the root url of the branch.

Definition at line 70 of file kfiletreebranch.h.

Referenced by KFileTreeView::findItem().

virtual void KFileTreeBranch::setRoot KFileTreeViewItem r  )  [inline, virtual]
 

sets a KFileTreeViewItem as root widget for the branch.

That must be created outside of the branch. All KFileTreeViewItems the branch is allocating will become children of that object.

Parameters:
the KFileTreeViewItem to become the root item.

Definition at line 78 of file kfiletreebranch.h.

KFileTreeViewItem* KFileTreeBranch::root  )  [inline]
 

Returns:
the root item.

Definition at line 83 of file kfiletreebranch.h.

Referenced by KFileTreeView::findItem(), KFileTreeView::removeBranch(), and setOpen().

QString KFileTreeBranch::name  )  const [inline]
 

Returns:
the name of the branch.

Reimplemented from QObject.

Definition at line 88 of file kfiletreebranch.h.

Referenced by KFileTreeView::branch().

virtual void KFileTreeBranch::setName const QString  n  )  [inline, virtual]
 

sets the name of the branch.

Definition at line 93 of file kfiletreebranch.h.

bool KFileTreeBranch::showExtensions  )  const
 

Returns:
whether the items in the branch show their file extensions in the tree or not. See setShowExtensions for more information.

Definition at line 241 of file kfiletreebranch.cpp.

void KFileTreeBranch::setOpen bool  setopen = true  )  [inline]
 

sets the root of the branch open or closed.

Definition at line 121 of file kfiletreebranch.h.

References root(), and QListViewItem::setOpen().

void KFileTreeBranch::setChildRecurse bool  t = true  ) 
 

sets if children recursion is wanted or not.

If this is switched off, the child directories of a just opened directory are not listed internally. That means that it can not be determined if the sub directories are expandable or not. If this is switched off there will be no call to setExpandable.

Parameters:
t set to true to switch on child recursion

Definition at line 228 of file kfiletreebranch.cpp.

References QValueList< KURL >::clear().

bool KFileTreeBranch::childRecurse  )  [inline]
 

Returns:
if child recursion is on or off.
See also:
setChildRecurse

Definition at line 138 of file kfiletreebranch.h.

bool KFileTreeBranch::populate const KURL url,
KFileTreeViewItem currItem
[virtual, slot]
 

populates a branch.

This method must be called after a branch was added to a KFileTreeView using method addBranch.

Parameters:
url is the url of the root item where the branch starts.
currItem is the current parent.

Definition at line 466 of file kfiletreebranch.cpp.

References KFileTreeViewItem::alreadyListed(), QValueList< KURL >::append(), KDirLister::openURL(), and KURL::prettyURL().

void KFileTreeBranch::setShowExtensions bool  visible = true  )  [virtual, slot]
 

sets printing of the file extensions on or off.

If you pass false to this slot, all items of this branch will not show their file extensions in the tree.

Parameters:
visible flags if the extensions should be visible or not.

Definition at line 236 of file kfiletreebranch.cpp.

KFileTreeViewItem * KFileTreeBranch::createTreeViewItem KFileTreeViewItem parent,
KFileItem fileItem
[protected, virtual]
 

allocates a KFileTreeViewItem for the branch for new items.

Definition at line 211 of file kfiletreebranch.cpp.

KFileTreeViewItem * KFileTreeBranch::findTVIByURL const KURL  )  [virtual]
 

find the according KFileTreeViewItem by an url

Definition at line 339 of file kfiletreebranch.cpp.

References KURL::equals(), KFileItem::extraData(), KDirLister::findByURL(), and KURL::url().

void KFileTreeBranch::populateFinished KFileTreeViewItem  )  [signal]
 

emitted with the item of a directory which was finished to populate

void KFileTreeBranch::newTreeViewItems KFileTreeBranch ,
const KFileTreeViewItemList
[signal]
 

emitted with a list of new or updated KFileTreeViewItem which were found in a branch.

Note that this signal is emitted very often and may slow down the performance of the treeview !

void KFileTreeBranch::directoryChildCount KFileTreeViewItem item,
int  count
[signal]
 

emitted with the exact count of children for a directory.


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.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:15:36 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001