• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDE3Support

K3FileTreeView Class Reference

#include <k3filetreeview.h>

Inheritance diagram for K3FileTreeView:

Inheritance graph
[legend]

List of all 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.

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

Typical usage: 1. create a K3FileTreeView 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.

Definition at line 53 of file k3filetreeview.h.


Public Slots

virtual void setShowFolderOpenPixmap (bool showIt=true)

Signals

void dropped (K3FileTreeView *, QDropEvent *, Q3ListViewItem *, Q3ListViewItem *)
void dropped (QDropEvent *, Q3ListViewItem *, Q3ListViewItem *)
void dropped (K3FileTreeView *, QDropEvent *, Q3ListViewItem *)
void dropped (QDropEvent *, Q3ListViewItem *)
void dropped (QWidget *, QDropEvent *, KUrl::List &, KUrl &)
void dropped (KUrl::List &, KUrl &)
void dropped (QWidget *, QDropEvent *, KUrl::List &)
void dropped (QWidget *, QDropEvent *)
void onItem (const QString &)

Public Member Functions

virtual KFileTreeBranch * addBranch (KFileTreeBranch *)
virtual KFileTreeBranch * addBranch (const KUrl &path, const QString &name, const QPixmap &pix, bool showHidden=false)
KFileTreeBranch * addBranch (const KUrl &path, const QString &name, bool showHidden=false)
KFileTreeBranch * branch (const QString &searchName)
KFileTreeBranchList & branches ()
K3FileTreeViewItem * currentKFileTreeViewItem () const
KUrl currentUrl () const
K3FileTreeViewItem * findItem (const QString &branchName, const QString &relUrl)
K3FileTreeViewItem * findItem (KFileTreeBranch *brnch, const QString &relUrl)
 K3FileTreeView (QWidget *parent)
virtual bool removeBranch (KFileTreeBranch *branch)
virtual void setDirOnlyMode (KFileTreeBranch *branch, bool)
bool showFolderOpenPixmap () const
virtual ~K3FileTreeView ()

Protected Slots

virtual QPixmap itemIcon (K3FileTreeViewItem *, int gap=0) const
virtual void slotNewTreeViewItems (KFileTreeBranch *, const K3FileTreeViewItemList &)
virtual void slotSetNextUrlToSelect (const KUrl &url)

Protected Member Functions

virtual bool acceptDrag (QDropEvent *event) const
virtual void contentsDragEnterEvent (QDragEnterEvent *e)
virtual void contentsDragLeaveEvent (QDragLeaveEvent *e)
virtual void contentsDragMoveEvent (QDragMoveEvent *e)
virtual void contentsDropEvent (QDropEvent *ev)
virtual Q3DragObject * dragObject ()
virtual void startAnimation (K3FileTreeViewItem *item, const char *iconBaseName="kde", uint iconCount=6)
virtual void stopAnimation (K3FileTreeViewItem *item)

Protected Attributes

KUrl m_nextUrlToSelect

Constructor & Destructor Documentation

K3FileTreeView::K3FileTreeView ( QWidget *  parent  ) 

Definition at line 40 of file k3filetreeview.cpp.

K3FileTreeView::~K3FileTreeView (  )  [virtual]

Definition at line 82 of file k3filetreeview.cpp.


Member Function Documentation

bool K3FileTreeView::acceptDrag ( QDropEvent *  event  )  const [protected, virtual]

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

Reimplemented from K3ListView.

Definition at line 226 of file k3filetreeview.cpp.

KFileTreeBranch * K3FileTreeView::addBranch ( KFileTreeBranch *  newBranch  )  [virtual]

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

Definition at line 377 of file k3filetreeview.cpp.

KFileTreeBranch * K3FileTreeView::addBranch ( const KUrl &  path,
const QString &  name,
const QPixmap &  pix,
bool  showHidden = false 
) [virtual]

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

Definition at line 366 of file k3filetreeview.cpp.

KFileTreeBranch * K3FileTreeView::addBranch ( const KUrl &  path,
const QString &  name,
bool  showHidden = false 
)

Adds a branch to the treeview item.

This high-level function creates the branch, adds it to the treeview and connects some signals. Note that directory listing does not start until a branch is expanded either by opening the root item by user or by setOpen on the root item.

Returns:
a pointer to the new branch or zero
Parameters:
path is the base url of the branch
name is the name of the branch, which will be the text for column 0
showHidden says if hidden files and directories should be visible

Definition at line 357 of file k3filetreeview.cpp.

KFileTreeBranch * K3FileTreeView::branch ( const QString &  searchName  ) 

Returns:
a pointer to the KFileTreeBranch in the K3FileTreeView or zero on failure.

Parameters:
searchName is the name of a branch

Definition at line 391 of file k3filetreeview.cpp.

KFileTreeBranchList & K3FileTreeView::branches (  ) 

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

Definition at line 409 of file k3filetreeview.cpp.

void K3FileTreeView::contentsDragEnterEvent ( QDragEnterEvent *  event  )  [protected, virtual]

Reimplemented for internal reasons.

Further reimplementations should call this function or else some features may not work correctly.

The API is unaffected.

Reimplemented from K3ListView.

Definition at line 108 of file k3filetreeview.cpp.

void K3FileTreeView::contentsDragLeaveEvent ( QDragLeaveEvent *  event  )  [protected, virtual]

Reimplemented for internal reasons.

Further reimplementations should call this function or else some features may not work correctly.

The API is unaffected.

Reimplemented from K3ListView.

Definition at line 164 of file k3filetreeview.cpp.

void K3FileTreeView::contentsDragMoveEvent ( QDragMoveEvent *  event  )  [protected, virtual]

Reimplemented for internal reasons.

Further reimplementations should call this function or else some features may not work correctly.

The API is unaffected.

Reimplemented from K3ListView.

Definition at line 130 of file k3filetreeview.cpp.

void K3FileTreeView::contentsDropEvent ( QDropEvent *  e  )  [protected, virtual]

Reimplemented for internal reasons.

Further reimplementations should call this function or else some features may not work correctly.

The API is unaffected.

Reimplemented from K3ListView.

Definition at line 179 of file k3filetreeview.cpp.

K3FileTreeViewItem * K3FileTreeView::currentKFileTreeViewItem (  )  const

Returns:
the current (i.e.

selected) item

Definition at line 587 of file k3filetreeview.cpp.

KUrl K3FileTreeView::currentUrl (  )  const

Returns:
the URL of the current selected item.

Definition at line 592 of file k3filetreeview.cpp.

Q3DragObject * K3FileTreeView::dragObject (  )  [protected, virtual]

Returns:
a dragobject encoding the current selection.

See also:
setDragEnabled()

Reimplemented from K3ListView.

Definition at line 250 of file k3filetreeview.cpp.

void K3FileTreeView::dropped ( K3FileTreeView *  ,
QDropEvent *  ,
Q3ListViewItem *  ,
Q3ListViewItem *   
) [signal]

void K3FileTreeView::dropped ( QDropEvent *  e,
Q3ListViewItem *  parent,
Q3ListViewItem *  after 
) [signal]

This signal gets emitted whenever something acceptable is dropped onto the listview.

This function also provides a parent, in the event that your listview is a tree

Parameters:
e is the drop event itself (it has already been accepted)
parent the item that is to be the parent of the new item
after is the item after which the drop occurred (or 0L, if the drop was above all items

Reimplemented from K3ListView.

void K3FileTreeView::dropped ( K3FileTreeView *  ,
QDropEvent *  ,
Q3ListViewItem *   
) [signal]

void K3FileTreeView::dropped ( QDropEvent *  e,
Q3ListViewItem *  after 
) [signal]

This signal gets emitted whenever something acceptable is dropped onto the listview.

Parameters:
e is the drop event itself (it has already been accepted)
after is the item after which the drop occurred (or 0L, if the drop was above all items)
See also:
acceptDrop()

Reimplemented from K3ListView.

void K3FileTreeView::dropped ( QWidget *  ,
QDropEvent *  ,
KUrl::List &  ,
KUrl &   
) [signal]

void K3FileTreeView::dropped ( KUrl::List &  ,
KUrl &   
) [signal]

void K3FileTreeView::dropped ( QWidget *  ,
QDropEvent *  ,
KUrl::List &   
) [signal]

void K3FileTreeView::dropped ( QWidget *  ,
QDropEvent *   
) [signal]

K3FileTreeViewItem * K3FileTreeView::findItem ( const QString &  branchName,
const QString &  relUrl 
)

see method above, differs only in the first parameter.

Finds the branch by its name.

Definition at line 620 of file k3filetreeview.cpp.

K3FileTreeViewItem * K3FileTreeView::findItem ( KFileTreeBranch *  brnch,
const QString &  relUrl 
)

searches a branch for a K3FileTreeViewItem identified by the relative url given as second parameter.

The method adds the branches base url to the relative path and finds the item.

Returns:
a pointer to the item or zero if the item does not exist.
Parameters:
brnch is a pointer to the branch to search in
relUrl is the branch relativ url

Definition at line 626 of file k3filetreeview.cpp.

QPixmap K3FileTreeView::itemIcon ( K3FileTreeViewItem *  item,
int  gap = 0 
) const [protected, virtual, slot]

Definition at line 475 of file k3filetreeview.cpp.

void K3FileTreeView::onItem ( const QString &   )  [signal]

bool K3FileTreeView::removeBranch ( KFileTreeBranch *  branch  )  [virtual]

removes the branch from the treeview.

Parameters:
branch is a pointer to the branch
Returns:
true on success.

Definition at line 415 of file k3filetreeview.cpp.

void K3FileTreeView::setDirOnlyMode ( KFileTreeBranch *  branch,
bool  bom 
) [virtual]

set the directory mode for branches.

If true is passed, only directories will be loaded.

Parameters:
branch is a pointer to a KFileTreeBranch

Definition at line 429 of file k3filetreeview.cpp.

void K3FileTreeView::setShowFolderOpenPixmap ( bool  showIt = true  )  [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

Definition at line 666 of file k3filetreeview.cpp.

bool K3FileTreeView::showFolderOpenPixmap (  )  const

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

Definition at line 661 of file k3filetreeview.cpp.

void K3FileTreeView::slotNewTreeViewItems ( KFileTreeBranch *  branch,
const K3FileTreeViewItemList &  itemList 
) [protected, virtual, slot]

Definition at line 444 of file k3filetreeview.cpp.

void K3FileTreeView::slotSetNextUrlToSelect ( const KUrl &  url  )  [protected, virtual, slot]

Definition at line 671 of file k3filetreeview.cpp.

void K3FileTreeView::startAnimation ( K3FileTreeViewItem *  item,
const char *  iconBaseName = "kde",
uint  iconCount = 6 
) [protected, virtual]

Definition at line 539 of file k3filetreeview.cpp.

void K3FileTreeView::stopAnimation ( K3FileTreeViewItem *  item  )  [protected, virtual]

Definition at line 556 of file k3filetreeview.cpp.


Member Data Documentation

KUrl K3FileTreeView::m_nextUrlToSelect [protected]

Definition at line 208 of file k3filetreeview.h.


The documentation for this class was generated from the following files:
  • k3filetreeview.h
  • k3filetreeview.cpp

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal