\section{KFile\-Tree\-View Class Reference}
\label{classKFileTreeView}\index{KFileTreeView@{KFileTreeView}}
The filetreeview offers a treeview on the file system which behaves like a QTree\-View showing files and/or directories in the file system.  


{\tt \#include $<$kfiletreeview.h$>$}

Inheritance diagram for KFile\-Tree\-View:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=61pt]{classKFileTreeView__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KFile\-Tree\-View:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=213pt]{classKFileTreeView__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
virtual void {\bf set\-Show\-Folder\-Open\-Pixmap} (bool show\-It=true)
\begin{CompactList}\small\item\em set the flag to show 'extended' folder icons on or off. \item\end{CompactList}\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf on\-Item} (const  {\bf QString} \&)\label{classKFileTreeView_l0}

\item 
void {\bf dropped} ({\bf QWidget} $\ast$, {\bf QDrop\-Event} $\ast$)\label{classKFileTreeView_l1}

\item 
void {\bf dropped} ({\bf QWidget} $\ast$, {\bf QDrop\-Event} $\ast$, {\bf KURL::List} \&)\label{classKFileTreeView_l2}

\item 
void {\bf dropped} ({\bf KURL::List} \&, {\bf KURL} \&)\label{classKFileTreeView_l3}

\item 
void {\bf dropped} ({\bf QDrop\-Event} $\ast$, {\bf QList\-View\-Item} $\ast$)\label{classKFileTreeView_l4}

\item 
void {\bf dropped} ({\bf KFile\-Tree\-View} $\ast$, {\bf QDrop\-Event} $\ast$, {\bf QList\-View\-Item} $\ast$)\label{classKFileTreeView_l5}

\item 
void {\bf dropped} ({\bf QDrop\-Event} $\ast$, {\bf QList\-View\-Item} $\ast$, {\bf QList\-View\-Item} $\ast$)\label{classKFileTreeView_l6}

\item 
void {\bf dropped} ({\bf KFile\-Tree\-View} $\ast$, {\bf QDrop\-Event} $\ast$, {\bf QList\-View\-Item} $\ast$, {\bf QList\-View\-Item} $\ast$)\label{classKFileTreeView_l7}

\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KFile\-Tree\-View} ({\bf QWidget} $\ast$parent, const  char $\ast$name=0)\label{classKFileTreeView_a0}

\item 
{\bf KFile\-Tree\-View\-Item} $\ast$ {\bf current\-KFile\-Tree\-View\-Item} () const 
\item 
{\bf KURL} {\bf current\-URL} () const 
\item 
{\bf KFile\-Tree\-Branch} $\ast$ {\bf add\-Branch} (const  {\bf KURL} \&path, const  {\bf QString} \&name, bool show\-Hidden=false)
\begin{CompactList}\small\item\em Adds a branch to the treeview item. \item\end{CompactList}\item 
virtual {\bf KFile\-Tree\-Branch} $\ast$ {\bf add\-Branch} (const  {\bf KURL} \&path, const  {\bf QString} \&name, const  {\bf QPixmap} \&pix, bool show\-Hidden=false)
\begin{CompactList}\small\item\em same as the function above but with a pixmap to set for the branch. \item\end{CompactList}\item 
virtual {\bf KFile\-Tree\-Branch} $\ast$ {\bf add\-Branch} ({\bf KFile\-Tree\-Branch} $\ast$)
\begin{CompactList}\small\item\em same as the function above but letting the user create the branch. \item\end{CompactList}\item 
virtual bool {\bf remove\-Branch} ({\bf KFile\-Tree\-Branch} $\ast$branch)
\begin{CompactList}\small\item\em removes the branch from the treeview. \item\end{CompactList}\item 
{\bf KFile\-Tree\-Branch} $\ast$ {\bf branch} (const  {\bf QString} \&search\-Name)
\item 
{\bf KFile\-Tree\-Branch\-List} \& {\bf branches} ()
\item 
virtual void {\bf set\-Dir\-Only\-Mode} ({\bf KFile\-Tree\-Branch} $\ast$brnch, bool)
\begin{CompactList}\small\item\em set the directory mode for branches. \item\end{CompactList}\item 
{\bf KFile\-Tree\-View\-Item} $\ast$ {\bf find\-Item} ({\bf KFile\-Tree\-Branch} $\ast$brnch, const  {\bf QString} \&rel\-Url)
\begin{CompactList}\small\item\em searches a branch for a {\bf KFile\-Tree\-View\-Item}{\rm (p.\,\pageref{classKFileTreeViewItem})} identified by the relative url given as second parameter. \item\end{CompactList}\item 
{\bf KFile\-Tree\-View\-Item} $\ast$ {\bf find\-Item} (const  {\bf QString} \&branch\-Name, const  {\bf QString} \&rel\-Url)
\begin{CompactList}\small\item\em see method above, differs only in the first parameter. \item\end{CompactList}\item 
bool {\bf show\-Folder\-Open\-Pixmap} () const 
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
virtual void {\bf slot\-New\-Tree\-View\-Items} ({\bf KFile\-Tree\-Branch} $\ast$, const  {\bf KFile\-Tree\-View\-Item\-List} \&)\label{classKFileTreeView_j0}

\item 
virtual void {\bf slot\-Set\-Next\-Url\-To\-Select} (const  {\bf KURL} \&url)\label{classKFileTreeView_j1}

\item 
virtual {\bf QPixmap} {\bf item\-Icon} ({\bf KFile\-Tree\-View\-Item} $\ast$, int gap=0) const \label{classKFileTreeView_j2}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual bool {\bf accept\-Drag} ({\bf QDrop\-Event} $\ast${\bf event}) const 
\item 
virtual {\bf QDrag\-Object} $\ast$ {\bf drag\-Object} ()\label{classKFileTreeView_b1}

\item 
virtual void {\bf start\-Animation} ({\bf KFile\-Tree\-View\-Item} $\ast$item, const  char $\ast$icon\-Base\-Name=\char`\"{}kde\char`\"{}, uint icon\-Count=6)\label{classKFileTreeView_b2}

\item 
virtual void {\bf stop\-Animation} ({\bf KFile\-Tree\-View\-Item} $\ast$item)\label{classKFileTreeView_b3}

\item 
virtual void {\bf contents\-Drag\-Enter\-Event} ({\bf QDrag\-Enter\-Event} $\ast$e)\label{classKFileTreeView_b4}

\item 
virtual void {\bf contents\-Drag\-Move\-Event} ({\bf QDrag\-Move\-Event} $\ast$e)\label{classKFileTreeView_b5}

\item 
virtual void {\bf contents\-Drag\-Leave\-Event} ({\bf QDrag\-Leave\-Event} $\ast$e)\label{classKFileTreeView_b6}

\item 
virtual void {\bf contents\-Drop\-Event} ({\bf QDrop\-Event} $\ast$ev)\label{classKFileTreeView_b7}

\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKFileTreeView_b8}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf KURL} {\bf m\_\-next\-Url\-To\-Select}\label{classKFileTreeView_p0}

\end{CompactItemize}


\subsection{Detailed Description}
The filetreeview offers a treeview on the file system which behaves like a QTree\-View showing files and/or directories in the file system. 

KFile\-Tree\-View is able to handle more than one URL, represented by {\bf KFile\-Tree\-Branch}{\rm (p.\,\pageref{classKFileTreeBranch})}.

Typical usage: 1. create a KFile\-Tree\-View fitting in your layout and add columns to it 2. call add\-Branch to create one or more branches 3. retrieve the root item with {\bf KFile\-Tree\-Branch::root}{\rm (p.\,\pageref{classKFileTreeBranch_a3})}() and set it open if desired. That starts the listing. 



Definition at line 66 of file kfiletreeview.h.

\subsection{Member Function Documentation}
\index{KFileTreeView@{KFile\-Tree\-View}!currentKFileTreeViewItem@{currentKFileTreeViewItem}}
\index{currentKFileTreeViewItem@{currentKFileTreeViewItem}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Tree\-View\-Item} $\ast$ KFile\-Tree\-View::current\-KFile\-Tree\-View\-Item () const}\label{classKFileTreeView_a2}


\begin{Desc}
\item[Returns:]the current (i.e. selected) item \end{Desc}


Definition at line 557 of file kfiletreeview.cpp.

References QList\-View::selected\-Item().

Referenced by current\-URL().\index{KFileTreeView@{KFile\-Tree\-View}!currentURL@{currentURL}}
\index{currentURL@{currentURL}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KURL} KFile\-Tree\-View::current\-URL () const}\label{classKFileTreeView_a3}


\begin{Desc}
\item[Returns:]the URL of the current selected item. \end{Desc}


Definition at line 562 of file kfiletreeview.cpp.

References current\-KFile\-Tree\-View\-Item(), and KFile\-Tree\-View\-Item::url().

Referenced by KDir\-Select\-Dialog::url().\index{KFileTreeView@{KFile\-Tree\-View}!addBranch@{addBranch}}
\index{addBranch@{addBranch}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Tree\-Branch} $\ast$ KFile\-Tree\-View::add\-Branch (const {\bf KURL} \& {\em path}, const {\bf QString} \& {\em name}, bool {\em show\-Hidden} = false)}\label{classKFileTreeView_a4}


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 set\-Open on the root item.

\begin{Desc}
\item[Returns:]a pointer to the new branch or zero \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em path}]is the base url of the branch \item[{\em name}]is the name of the branch, which will be the text for column 0 \item[{\em show\-Hidden}]says if hidden files and directories should be visible \end{description}
\end{Desc}


Definition at line 338 of file kfiletreeview.cpp.

References KMime\-Type::mime\-Type(), and KStd\-Accel::name().

Referenced by add\-Branch().\index{KFileTreeView@{KFile\-Tree\-View}!addBranch@{addBranch}}
\index{addBranch@{addBranch}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Tree\-Branch} $\ast$ KFile\-Tree\-View::add\-Branch (const {\bf KURL} \& {\em path}, const {\bf QString} \& {\em name}, const {\bf QPixmap} \& {\em pix}, bool {\em show\-Hidden} = false)\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileTreeView_a5}


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



Definition at line 346 of file kfiletreeview.cpp.

References add\-Branch(), KStd\-Accel::name(), and KURL::pretty\-URL().\index{KFileTreeView@{KFile\-Tree\-View}!addBranch@{addBranch}}
\index{addBranch@{addBranch}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Tree\-Branch} $\ast$ KFile\-Tree\-View::add\-Branch ({\bf KFile\-Tree\-Branch} $\ast$)\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileTreeView_a6}


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



Definition at line 357 of file kfiletreeview.cpp.

References QPtr\-List::append().\index{KFileTreeView@{KFile\-Tree\-View}!removeBranch@{removeBranch}}
\index{removeBranch@{removeBranch}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Tree\-View::remove\-Branch ({\bf KFile\-Tree\-Branch} $\ast$ {\em branch})\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileTreeView_a7}


removes the branch from the treeview. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em branch}]is a pointer to the branch \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true on success. \end{Desc}


Definition at line 395 of file kfiletreeview.cpp.

References QPtr\-List::contains(), QPtr\-List::remove(), and KFile\-Tree\-Branch::root().\index{KFileTreeView@{KFile\-Tree\-View}!branch@{branch}}
\index{branch@{branch}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Tree\-Branch} $\ast$ KFile\-Tree\-View::branch (const {\bf QString} \& {\em search\-Name})}\label{classKFileTreeView_a8}


\begin{Desc}
\item[Returns:]a pointer to the {\bf KFile\-Tree\-Branch}{\rm (p.\,\pageref{classKFileTreeBranch})} in the KFile\-Tree\-View or zero on failiure. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em branchno}]is the name of a branch \end{description}
\end{Desc}


Definition at line 371 of file kfiletreeview.cpp.

References QPtr\-List\-Iterator::current(), and KFile\-Tree\-Branch::name().

Referenced by find\-Item().\index{KFileTreeView@{KFile\-Tree\-View}!branches@{branches}}
\index{branches@{branches}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Tree\-Branch\-List} \& KFile\-Tree\-View::branches ()}\label{classKFileTreeView_a9}


\begin{Desc}
\item[Returns:]a list of pointers to all existing branches in the treeview. \end{Desc}


Definition at line 389 of file kfiletreeview.cpp.\index{KFileTreeView@{KFile\-Tree\-View}!setDirOnlyMode@{setDirOnlyMode}}
\index{setDirOnlyMode@{setDirOnlyMode}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Tree\-View::set\-Dir\-Only\-Mode ({\bf KFile\-Tree\-Branch} $\ast$ {\em brnch}, bool)\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileTreeView_a10}


set the directory mode for branches. 

If true is passed, only directories will be loaded. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em branch}]is a pointer to a {\bf KFile\-Tree\-Branch}{\rm (p.\,\pageref{classKFileTreeBranch})} \end{description}
\end{Desc}


Definition at line 409 of file kfiletreeview.cpp.

References KDir\-Lister::set\-Dir\-Only\-Mode().\index{KFileTreeView@{KFile\-Tree\-View}!findItem@{findItem}}
\index{findItem@{findItem}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Tree\-View\-Item} $\ast$ KFile\-Tree\-View::find\-Item ({\bf KFile\-Tree\-Branch} $\ast$ {\em brnch}, const {\bf QString} \& {\em rel\-Url})}\label{classKFileTreeView_a11}


searches a branch for a {\bf KFile\-Tree\-View\-Item}{\rm (p.\,\pageref{classKFileTreeViewItem})} identified by the relative url given as second parameter. 

The method adds the branches base url to the relative path and finds the item. \begin{Desc}
\item[Returns:]a pointer to the item or zero if the item does not exist. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em brnch}]is a pointer to the branch to search in \item[{\em rel\-Url}]is the branch relativ url \end{description}
\end{Desc}


Definition at line 596 of file kfiletreeview.cpp.

References KURL::add\-Path(), QString::ends\-With(), KFile\-Item::extra\-Data(), KDir\-Lister::find(), QString::from\-Latin1(), QString::is\-Empty(), QString::length(), KURL::pretty\-URL(), KFile\-Tree\-Branch::root(), KFile\-Tree\-Branch::root\-Url(), and QString::truncate().

Referenced by find\-Item().\index{KFileTreeView@{KFile\-Tree\-View}!findItem@{findItem}}
\index{findItem@{findItem}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Tree\-View\-Item} $\ast$ KFile\-Tree\-View::find\-Item (const {\bf QString} \& {\em branch\-Name}, const {\bf QString} \& {\em rel\-Url})}\label{classKFileTreeView_a12}


see method above, differs only in the first parameter. 

Finds the branch by its name. 

Definition at line 590 of file kfiletreeview.cpp.

References branch(), and find\-Item().\index{KFileTreeView@{KFile\-Tree\-View}!showFolderOpenPixmap@{showFolderOpenPixmap}}
\index{showFolderOpenPixmap@{showFolderOpenPixmap}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Tree\-View::show\-Folder\-Open\-Pixmap () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileTreeView_a13}


\begin{Desc}
\item[Returns:]a flag indicating if extended folder pixmaps are displayed or not. \end{Desc}


Definition at line 152 of file kfiletreeview.h.\index{KFileTreeView@{KFile\-Tree\-View}!setShowFolderOpenPixmap@{setShowFolderOpenPixmap}}
\index{setShowFolderOpenPixmap@{setShowFolderOpenPixmap}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KFile\-Tree\-View::set\-Show\-Folder\-Open\-Pixmap (bool {\em show\-It} = true)\hspace{0.3cm}{\tt  [inline, virtual, slot]}}\label{classKFileTreeView_i0}


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. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em show\-It}]= false displays mime type pixmap only \end{description}
\end{Desc}


Definition at line 163 of file kfiletreeview.h.\index{KFileTreeView@{KFile\-Tree\-View}!acceptDrag@{acceptDrag}}
\index{acceptDrag@{acceptDrag}!KFileTreeView@{KFile\-Tree\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Tree\-View::accept\-Drag ({\bf QDrop\-Event} $\ast$ {\em event}) const\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKFileTreeView_b0}


\begin{Desc}
\item[Returns:]true if we can decode the drag and support the action \end{Desc}


Reimplemented from {\bf KList\-View}.

Definition at line 211 of file kfiletreeview.cpp.

References QDrop\-Event::action(), QUri\-Drag::can\-Decode(), and KList\-View::items\-Movable().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kfiletreeview.h\item 
kfiletreeview.cpp\end{CompactItemize}
