class KFileTreeView

The filetreeview offers a treeview on the file system which behaves like a QTreeView showing files and/or directories in the file system. More...

Definition#include <kfiletreeview.h>
InheritsKListView (kdeui) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Slots

Signals

Protected Methods

Protected Slots

Protected Members


Detailed Description

The filetreeview offers a treeview on the file system which behaves like a QTreeView showing files and/or directories in the file system.

KFileTreeView is able to handle more than one URL, represented by KFileTreeBranch.

Typicall usage: 1. create a KFileTreeView fitting in your layout and add columns to it 2. call addBranch to create one or more branches 3. retrieve the root item with KFileTreeBranch::root() and set it open if desired. That starts the listing.

 KFileTreeView ( QWidget *parent, const char *name = 0 )

KFileTreeView

 ~KFileTreeView ()

~KFileTreeView

[virtual]

KFileTreeViewItem *  currentKFileTreeViewItem ()

currentKFileTreeViewItem

[const]

Returns: the current (i.e. selected) item

KURL  currentURL ()

currentURL

[const]

Returns: the URL of the current selected item.

KFileTreeBranch*  addBranch ( const KURL &path, const QString& name, bool showHidden = false )

addBranch

adds a branch to the treeview item. This highlevel function creates the branch, adds it to the treeview and connects some signals. Note that directory listing does not yet start. It is started by expanding the branches root either by opening the root item by user or by setOpen on the root item.

Parameters:
pathis the base url of the branch
nameis the name of the branch, which will be the text for column 0
showHiddensays if hidden files and directories should be visible

Returns: a pointer to the new branch or zero

KFileTreeBranch*  addBranch ( const KURL &path, const QString& name , const QPixmap& pix, bool showHidden = false )

addBranch

[virtual]

same as the function above but with a pixmap to set for the branch.

KFileTreeBranch*  addBranch ( KFileTreeBranch * )

addBranch

[virtual]

same as the function above but letting the user create the branch.

bool  removeBranch ( KFileTreeBranch *branch )

removeBranch

[virtual]

removes the branch from the treeview.

Parameters:
branchis a pointer to the branch

Returns: true on success.

KFileTreeBranchbranch ( const QString& searchName )

branch

Parameters:
branchnois the name of a branch

Returns: a pointer to the KFileTreeBranch in the KFileTreeView or zero on failiure.

KFileTreeBranchList&  branches ()

branches

Returns: a list of pointers to all existing branches in the treeview.

void  setDirOnlyMode ( KFileTreeBranch *brnch, bool )

setDirOnlyMode

[virtual]

set the directory mode for branches. If true is passed, only directories will be loaded.

Parameters:
branchis a pointer to a KFileTreeBranch

KFileTreeViewItemfindItem ( KFileTreeBranch* brnch, const QString& relUrl )

findItem

searches a branch for a KFileTreeViewItem identified by the relative url given as second parameter. The method adds the branches base url to the relative path and finds the item.

Parameters:
brnchis a pointer to the branch to search in
relUrlis the branch relativ url

Returns: a pointer to the item or zero if the item does not exist.

KFileTreeViewItemfindItem ( const QString& branchName, const QString& relUrl )

findItem

see method above, differs only in the first parameter. Finds the branch by its name.

bool  showFolderOpenPixmap ()

showFolderOpenPixmap

[const]

Returns: a flag indicating if extended folder pixmaps are displayed or not.

void  setShowFolderOpenPixmap ( bool showIt = true )

setShowFolderOpenPixmap

[virtual slot]

set the flag to show 'extended' folder icons on or off. If switched on, folders will have an open folder pixmap displayed if their children are visible, and the standard closed folder pixmap (from mimetype folder) if they are closed. If switched off, the plain mime pixmap is displayed.

Parameters:
showIt= false displays mime type pixmap only

bool  acceptDrag (QDropEvent* event)

acceptDrag

[protected const virtual]

Returns: true if we can decode the drag and support the action

Reimplemented from KListView.

QDragObject *  dragObject ()

dragObject

[protected virtual]

Reimplemented from KListView.

void  startAnimation ( KFileTreeViewItem* item, const char * iconBaseName = "kde", uint iconCount = 6 )

startAnimation

[protected virtual]

void  stopAnimation ( KFileTreeViewItem* item )

stopAnimation

[protected virtual]

void  contentsDragEnterEvent ( QDragEnterEvent *e )

contentsDragEnterEvent

[protected virtual]

Reimplemented from KListView.

void  contentsDragMoveEvent ( QDragMoveEvent *e )

contentsDragMoveEvent

[protected virtual]

Reimplemented from KListView.

void  contentsDragLeaveEvent ( QDragLeaveEvent *e )

contentsDragLeaveEvent

[protected virtual]

Reimplemented from KListView.

void  contentsDropEvent ( QDropEvent *ev )

contentsDropEvent

[protected virtual]

Reimplemented from KListView.

void  slotNewTreeViewItems ( KFileTreeBranch*, const KFileTreeViewItemList& )

slotNewTreeViewItems

[protected slots virtual slot]

void  slotSetNextUrlToSelect ( const KURL &url )

slotSetNextUrlToSelect

[protected slots virtual slot]

QPixmap  itemIcon ( KFileTreeViewItem*, int gap = 0 )

itemIcon

[protected slots const virtual slot]

void  onItem ( const QString& )

onItem

[signal]

void  dropped ( QWidget*, QDropEvent* )

dropped

[signal]

Reimplemented from KListView.

void  dropped ( QWidget*, QDropEvent*, KURL::List& )

dropped

[signal]

Reimplemented from KListView.

void  dropped ( KURL::List&, KURL& )

dropped

[signal]

Reimplemented from KListView.

void  dropped ( QDropEvent *, QListViewItem * )

dropped

[signal]

Reimplemented from KListView.

void  dropped (KFileTreeView *, QDropEvent *, QListViewItem *)

dropped

[signal]

Reimplemented from KListView.

void  dropped (QDropEvent *, QListViewItem *, QListViewItem *)

dropped

[signal]

Reimplemented from KListView.

void  dropped (KFileTreeView *, QDropEvent *, QListViewItem *, QListViewItem *)

dropped

[signal]

Reimplemented from KListView.

KURL m_nextUrlToSelect

m_nextUrlToSelect

[protected]

void  virtual_hook ( int id, void* data )

virtual_hook

[protected virtual]

Reimplemented from KListView.


Generated by: dfaure on faure on Tue Apr 16 08:50:13 2002, using kdoc 2.0a53.