\section{KFile\-View Class Reference}
\label{classKFileView}\index{KFileView@{KFileView}}
This class defines an interface to all file views. A base class for views of the {\bf KDE} file selector.  


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

Inheritance diagram for KFile\-View:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=210pt]{classKFileView__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KFile\-View:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=171pt]{classKFileView__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf View\-Mode} \{ {\bf Files} =  1, 
{\bf Directories} =  2, 
{\bf All} =  Files $|$ Directories
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
virtual {\bf $\sim$KFile\-View} ()
\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item 
void {\bf add\-Item\-List} (const  {\bf KFile\-Item\-List} \&list)
\begin{CompactList}\small\item\em inserts a list of items. \item\end{CompactList}\item 
virtual {\bf QWidget} $\ast$ {\bf widget} ()=0
\begin{CompactList}\small\item\em a pure virtual function to get a {\bf QWidget}, that can be added to other widgets. \item\end{CompactList}\item 
{\bf QWidget} $\ast$ {\bf widget} () const 
\begin{CompactList}\small\item\em \#\#\# As const-method, to be fixed in 3.0 \item\end{CompactList}\item 
void {\bf set\-Current\-Item} (const  {\bf QString} \&filename)
\begin{CompactList}\small\item\em Sets {\tt filename} the current item in the view, if available. \item\end{CompactList}\item 
virtual void {\bf set\-Current\-Item} (const  {\bf KFile\-Item} $\ast$item)=0
\begin{CompactList}\small\item\em Reimplement this to set {\tt item} the current item in the view, e.g. \item\end{CompactList}\item 
virtual {\bf KFile\-Item} $\ast$ {\bf current\-File\-Item} () const =0
\item 
virtual void {\bf clear} ()
\begin{CompactList}\small\item\em Clears the view and all item lists. \item\end{CompactList}\item 
virtual void {\bf update\-View} (bool f=true)
\begin{CompactList}\small\item\em does a repaint of the view. \item\end{CompactList}\item 
virtual void {\bf update\-View} (const  {\bf KFile\-Item} $\ast$)\label{classKFileView_a10}

\item 
virtual void {\bf remove\-Item} (const  {\bf KFile\-Item} $\ast$item)
\begin{CompactList}\small\item\em Removes an item from the list; has to be implemented by the view. \item\end{CompactList}\item 
virtual void {\bf listing\-Completed} ()
\begin{CompactList}\small\item\em This hook is called when all items of the currently listed directory are listed and inserted into the view, i.e. \item\end{CompactList}\item 
QDir::Sort\-Spec {\bf sorting} () const 
\begin{CompactList}\small\item\em Returns the sorting order of the internal list. \item\end{CompactList}\item 
virtual void {\bf set\-Sorting} (QDir::Sort\-Spec sort)
\begin{CompactList}\small\item\em Sets the sorting order of the view. \item\end{CompactList}\item 
bool {\bf is\-Reversed} () const 
\begin{CompactList}\small\item\em Tells whether the current items are in reversed order (shortcut to {\bf sorting()}{\rm (p.\,\pageref{classKFileView_a13})} \& QDir::Reversed). \item\end{CompactList}\item 
void {\bf sort\-Reversed} ()\label{classKFileView_a16}

\item 
uint {\bf count} () const 
\item 
uint {\bf num\-Files} () const 
\item 
uint {\bf num\-Dirs} () const 
\item 
virtual void {\bf set\-Selection\-Mode} (KFile::Selection\-Mode sm)\label{classKFileView_a20}

\item 
virtual KFile::Selection\-Mode {\bf selection\-Mode} () const \label{classKFileView_a21}

\item 
virtual void {\bf set\-View\-Mode} (View\-Mode vm)\label{classKFileView_a22}

\item 
virtual View\-Mode {\bf view\-Mode} () const \label{classKFileView_a23}

\item 
{\bf QString} {\bf view\-Name} () const 
\item 
void {\bf set\-View\-Name} (const  {\bf QString} \&name)
\begin{CompactList}\small\item\em Sets the name of the view, which could be displayed somewhere. \item\end{CompactList}\item 
virtual void {\bf set\-Parent\-View} ({\bf KFile\-View} $\ast$parent)\label{classKFileView_a26}

\item 
virtual void {\bf insert\-Item} ({\bf KFile\-Item} $\ast$i)
\begin{CompactList}\small\item\em The derived view must implement this function to add the file in the widget. \item\end{CompactList}\item 
virtual void {\bf clear\-View} ()=0
\begin{CompactList}\small\item\em pure virtual function, that should be implemented to clear the view. \item\end{CompactList}\item 
virtual void {\bf ensure\-Item\-Visible} (const  {\bf KFile\-Item} $\ast$i)=0
\begin{CompactList}\small\item\em pure virtual function, that should be implemented to make item i visible, i.e. \item\end{CompactList}\item 
virtual void {\bf clear\-Selection} ()=0
\begin{CompactList}\small\item\em Clears any selection, unhighlights everything. \item\end{CompactList}\item 
virtual void {\bf select\-All} ()
\begin{CompactList}\small\item\em Selects all items. \item\end{CompactList}\item 
virtual void {\bf invert\-Selection} ()
\begin{CompactList}\small\item\em Inverts the current selection, i.e. \item\end{CompactList}\item 
virtual void {\bf set\-Selected} (const  {\bf KFile\-Item} $\ast$, bool enable)=0
\begin{CompactList}\small\item\em Tells the view that it should highlight the item. \item\end{CompactList}\item 
virtual bool {\bf is\-Selected} (const  {\bf KFile\-Item} $\ast$) const =0
\item 
const  {\bf KFile\-Item\-List} $\ast$ {\bf selected\-Items} () const 
\item 
const  {\bf KFile\-Item\-List} $\ast$ {\bf items} () const 
\item 
virtual {\bf KFile\-Item} $\ast$ {\bf first\-File\-Item} () const =0\label{classKFileView_a37}

\item 
virtual {\bf KFile\-Item} $\ast$ {\bf next\-Item} (const  {\bf KFile\-Item} $\ast$) const =0\label{classKFileView_a38}

\item 
virtual {\bf KFile\-Item} $\ast$ {\bf prev\-Item} (const  {\bf KFile\-Item} $\ast$) const =0\label{classKFileView_a39}

\item 
void {\bf set\-Only\-Double\-Click\-Selects\-Files} (bool enable)
\begin{CompactList}\small\item\em This is a {\bf KFile\-Dialog}{\rm (p.\,\pageref{classKFileDialog})} specific hack: we want to select directories with single click, but not files. \item\end{CompactList}\item 
bool {\bf only\-Double\-Click\-Selects\-Files} () const 
\item 
bool {\bf update\-Numbers} (const  {\bf KFile\-Item} $\ast$i)
\begin{CompactList}\small\item\em increases the number of dirs and files. \item\end{CompactList}\item 
virtual {\bf KAction\-Collection} $\ast$ {\bf action\-Collection} () const 
\item 
{\bf KFile\-View\-Signaler} $\ast$ {\bf signaler} () const \label{classKFileView_a44}

\item 
virtual void {\bf read\-Config} ({\bf KConfig} $\ast$, const  {\bf QString} \&group=QString::null)\label{classKFileView_a45}

\item 
virtual void {\bf write\-Config} ({\bf KConfig} $\ast$, const  {\bf QString} \&group=QString::null)\label{classKFileView_a46}

\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf QString} {\bf sorting\-Key} (const  {\bf QString} \&value, bool is\-Dir, int sort\-Spec)
\begin{CompactList}\small\item\em This method calculates a {\bf QString} from the given parameters, that is suitable for sorting with e.g. \item\end{CompactList}\item 
{\bf QString} {\bf sorting\-Key} (KIO::filesize\_\-t value, bool is\-Dir, int sort\-Spec)
\begin{CompactList}\small\item\em An overloaded method that takes not a {\bf QString}, but a number as sort criterion. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKFileView_b0}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf KFile\-View\-Signaler} $\ast$ {\bf sig}\label{classKFileView_p0}

\end{CompactItemize}


\subsection{Detailed Description}
This class defines an interface to all file views. A base class for views of the {\bf KDE} file selector. 

Its intent is to allow to switch the view of the files in the selector very easily. It defines some pure virtual functions, that must be implemented to make a file view working.

Since this class is not a widget, but it's meant to be added to other widgets, its most important function is {\bf widget}{\rm (p.\,\pageref{classKFileView_a3})}. This should return a pointer to the implemented widget.

\begin{Desc}
\item[Author:]Stephan Kulow $<${\tt coolo@kde.org}$>$ \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf kfileview.h}{\rm (p.\,\pageref{kfileview_8h})},v 1.44 2002/08/02 08:35:37 coolo Exp \end{Desc}
\end{Desc}




Definition at line 94 of file kfileview.h.

\subsection{Constructor \& Destructor Documentation}
\index{KFileView@{KFile\-View}!~KFileView@{$\sim$KFileView}}
\index{~KFileView@{$\sim$KFileView}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KFile\-View::$\sim${\bf KFile\-View} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileView_a1}


Destructor. 



Definition at line 81 of file kfileview.cpp.

\subsection{Member Function Documentation}
\index{KFileView@{KFile\-View}!addItemList@{addItemList}}
\index{addItemList@{addItemList}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::add\-Item\-List (const {\bf KFile\-Item\-List} \& {\em list})}\label{classKFileView_a2}


inserts a list of items. 



Definition at line 126 of file kfileview.cpp.

References QPtr\-List\-Iterator::current(), insert\-Item(), and update\-Numbers().

Referenced by KDir\-Operator::insert\-New\-Files().\index{KFileView@{KFile\-View}!widget@{widget}}
\index{widget@{widget}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QWidget}$\ast$ KFile\-View::widget ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKFileView_a3}


a pure virtual function to get a {\bf QWidget}, that can be added to other widgets. 

This function is needed to make it possible for derived classes to derive from other widgets. 

Implemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a2})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a2})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a2})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a3})}.

Referenced by action\-Collection(), KFile\-Preview::set\-File\-View(), KDir\-Operator::set\-View(), update\-View(), and KDir\-Operator::view\-Widget().\index{KFileView@{KFile\-View}!widget@{widget}}
\index{widget@{widget}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QWidget}$\ast$ KFile\-View::widget () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileView_a4}


\#\#\# As const-method, to be fixed in 3.0 



Definition at line 119 of file kfileview.h.\index{KFileView@{KFile\-View}!setCurrentItem@{setCurrentItem}}
\index{setCurrentItem@{setCurrentItem}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::set\-Current\-Item (const {\bf QString} \& {\em filename})}\label{classKFileView_a5}


Sets {\tt filename} the current item in the view, if available. 



Definition at line 264 of file kfileview.cpp.

References QString::is\-Null(), and KFile\-Item::name().

Referenced by KDir\-Operator::insert\-New\-Files(), KFile\-Preview::set\-Current\-Item(), KDir\-Operator::set\-Current\-Item(), and KCombi\-View::set\-Current\-Item().\index{KFileView@{KFile\-View}!setCurrentItem@{setCurrentItem}}
\index{setCurrentItem@{setCurrentItem}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KFile\-View::set\-Current\-Item (const {\bf KFile\-Item} $\ast$ {\em item})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKFileView_a6}


Reimplement this to set {\tt item} the current item in the view, e.g. 

the item having focus. 

Implemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a15})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a15})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a16})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a19})}.\index{KFileView@{KFile\-View}!currentFileItem@{currentFileItem}}
\index{currentFileItem@{currentFileItem}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf KFile\-Item}$\ast$ KFile\-View::current\-File\-Item () const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKFileView_a7}


\begin{Desc}
\item[Returns:]the \char`\"{}current\char`\"{} {\bf KFile\-Item}{\rm (p.\,\pageref{classKFileItem})}, 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. \end{Desc}


Implemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a16})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a16})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a17})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a20})}.

Referenced by KFile\-Preview::current\-File\-Item(), and KCombi\-View::current\-File\-Item().\index{KFileView@{KFile\-View}!clear@{clear}}
\index{clear@{clear}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::clear ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileView_a8}


Clears the view and all item lists. 



Reimplemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a21})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a18})}.

Definition at line 152 of file kfileview.cpp.

References QPtr\-List::clear(), and clear\-View().

Referenced by KFile\-Preview::clear(), KCombi\-View::clear(), and KDir\-Operator::path\-Changed().\index{KFileView@{KFile\-View}!updateView@{updateView}}
\index{updateView@{updateView}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::update\-View (bool {\em f} = true)\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileView_a9}


does a repaint of the view. 

The default implementation calls \small\begin{alltt}{\bf widget()}{\rm (p.\,\pageref{classKFileView_a3})}-$>$repaint(f)\end{alltt}\normalsize 
 

Reimplemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a4})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a6})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a5})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a7})}.

Definition at line 255 of file kfileview.cpp.

References QWidget::repaint(), and widget().

Referenced by KFile\-Preview::update\-View(), and KCombi\-View::update\-View().\index{KFileView@{KFile\-View}!removeItem@{removeItem}}
\index{removeItem@{removeItem}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::remove\-Item (const {\bf KFile\-Item} $\ast$ {\em item})\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileView_a11}


Removes an item from the list; has to be implemented by the view. 

Call KFile\-View::remove\-Item( item ) after removing it. 

Reimplemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a6})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a8})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a7})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a9})}.

Definition at line 342 of file kfileview.cpp.

References KFile\-Item::is\-Dir(), and QPtr\-List::remove\-Ref().

Referenced by KDir\-Operator::item\-Deleted(), KFile\-Preview::remove\-Item(), KFile\-Icon\-View::remove\-Item(), KFile\-Detail\-View::remove\-Item(), and KCombi\-View::remove\-Item().\index{KFileView@{KFile\-View}!listingCompleted@{listingCompleted}}
\index{listingCompleted@{listingCompleted}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::listing\-Completed ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileView_a12}


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 in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a7})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a9})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a8})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a10})}.

Definition at line 356 of file kfileview.cpp.

Referenced by KFile\-Preview::listing\-Completed(), KCombi\-View::listing\-Completed(), and KDir\-Operator::update\-Dir().\index{KFileView@{KFile\-View}!sorting@{sorting}}
\index{sorting@{sorting}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}QDir::Sort\-Spec KFile\-View::sorting () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileView_a13}


Returns the sorting order of the internal list. 

Newly added files are added through this sorting. 

Definition at line 171 of file kfileview.h.

Referenced by KFile\-Preview::set\-File\-View(), KFile\-Preview::set\-Sorting(), and KCombi\-View::set\-Sorting().\index{KFileView@{KFile\-View}!setSorting@{setSorting}}
\index{setSorting@{setSorting}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::set\-Sorting (QDir::Sort\-Spec {\em sort})\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileView_a14}


Sets the sorting order of the view. 

Default is QDir::Name $|$ QDir::Ignore\-Case $|$ QDir::Dirs\-First Override this in your subclass and sort accordingly (usually by setting the sorting-key for every item and telling {\bf QIcon\-View} or {\bf QList\-View} 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.

\begin{Desc}
\item[See also:]{\bf sorting\-Key}{\rm (p.\,\pageref{classKFileView_e0})} \end{Desc}


Reimplemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a22})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a21})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a25})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a24})}.

Definition at line 147 of file kfileview.cpp.

Referenced by KFile\-Preview::set\-File\-View(), KFile\-Preview::set\-Sorting(), KFile\-Icon\-View::set\-Sorting(), KFile\-Detail\-View::set\-Sorting(), KDir\-Operator::set\-Sorting(), KCombi\-View::set\-Sorting(), and KDir\-Operator::set\-View().\index{KFileView@{KFile\-View}!isReversed@{isReversed}}
\index{isReversed@{isReversed}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-View::is\-Reversed () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileView_a15}


Tells whether the current items are in reversed order (shortcut to {\bf sorting()}{\rm (p.\,\pageref{classKFileView_a13})} \& QDir::Reversed). 



Definition at line 193 of file kfileview.h.

Referenced by KFile\-Icon\-View::set\-Sorting(), and KDir\-Operator::update\-Sort\-Actions().\index{KFileView@{KFile\-View}!count@{count}}
\index{count@{count}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint KFile\-View::count () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileView_a17}


\begin{Desc}
\item[Returns:]the number of dirs and files \end{Desc}


Definition at line 200 of file kfileview.h.\index{KFileView@{KFile\-View}!numFiles@{numFiles}}
\index{numFiles@{numFiles}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint KFile\-View::num\-Files () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileView_a18}


\begin{Desc}
\item[Returns:]the number of files. \end{Desc}


Definition at line 205 of file kfileview.h.

Referenced by KDir\-Operator::insert\-New\-Files(), KDir\-Operator::item\-Deleted(), and KDir\-Operator::num\-Files().\index{KFileView@{KFile\-View}!numDirs@{numDirs}}
\index{numDirs@{numDirs}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint KFile\-View::num\-Dirs () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileView_a19}


\begin{Desc}
\item[Returns:]the number of directories \end{Desc}


Definition at line 210 of file kfileview.h.

Referenced by KDir\-Operator::insert\-New\-Files(), KDir\-Operator::item\-Deleted(), and KDir\-Operator::num\-Dirs().\index{KFileView@{KFile\-View}!viewName@{viewName}}
\index{viewName@{viewName}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-View::view\-Name () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileView_a24}


\begin{Desc}
\item[Returns:]the localized name of the view, which could be displayed somewhere, e.g. in a menu, where the user can choose between views. \end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-View\-Name}{\rm (p.\,\pageref{classKFileView_a25})} \end{Desc}


Definition at line 228 of file kfileview.h.

Referenced by KCombi\-View::set\-Right().\index{KFileView@{KFile\-View}!setViewName@{setViewName}}
\index{setViewName@{setViewName}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::set\-View\-Name (const {\bf QString} \& {\em name})\hspace{0.3cm}{\tt  [inline]}}\label{classKFileView_a25}


Sets the name of the view, which could be displayed somewhere. 

E.g. \char`\"{}Image Preview\char`\"{}. 

Definition at line 234 of file kfileview.h.

References KStd\-Accel::name().

Referenced by KDir\-Operator::create\-View(), and KCombi\-View::set\-Right().\index{KFileView@{KFile\-View}!insertItem@{insertItem}}
\index{insertItem@{insertItem}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::insert\-Item ({\bf KFile\-Item} $\ast$ {\em i})\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileView_a27}


The derived view must implement this function to add the file in the widget. 

Make sure to call this implementation, i.e. KFile\-View::insert\-Item( i ); 

Reimplemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a20})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a20})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a9})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a17})}.

Definition at line 143 of file kfileview.cpp.

Referenced by add\-Item\-List(), KFile\-Preview::insert\-Item(), KFile\-Icon\-View::insert\-Item(), KFile\-Detail\-View::insert\-Item(), and KCombi\-View::insert\-Item().\index{KFileView@{KFile\-View}!clearView@{clearView}}
\index{clearView@{clearView}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KFile\-View::clear\-View ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKFileView_a28}


pure virtual function, that should be implemented to clear the view. 

At this moment the list is already empty 

Implemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a3})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a3})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a3})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a4})}.

Referenced by clear(), KFile\-Preview::clear\-View(), and KCombi\-View::clear\-View().\index{KFileView@{KFile\-View}!ensureItemVisible@{ensureItemVisible}}
\index{ensureItemVisible@{ensureItemVisible}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KFile\-View::ensure\-Item\-Visible (const {\bf KFile\-Item} $\ast$ {\em i})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKFileView_a29}


pure virtual function, that should be implemented to make item i visible, i.e. 

by scrolling the view appropriately. 

Implemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a25})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a22})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a24})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a28})}.

Referenced by KFile\-Preview::ensure\-Item\-Visible(), KCombi\-View::ensure\-Item\-Visible(), KDir\-Operator::insert\-New\-Files(), and KDir\-Operator::set\-Current\-Item().\index{KFileView@{KFile\-View}!clearSelection@{clearSelection}}
\index{clearSelection@{clearSelection}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KFile\-View::clear\-Selection ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKFileView_a30}


Clears any selection, unhighlights everything. 

Must be implemented by the view. 

Implemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a12})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a12})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a13})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a14})}.

Referenced by KFile\-Preview::clear\-Selection(), KCombi\-View::clear\-Selection(), KDir\-Operator::make\-Completion(), KDir\-Operator::make\-Dir\-Completion(), and KDir\-Operator::set\-Current\-Item().\index{KFileView@{KFile\-View}!selectAll@{selectAll}}
\index{selectAll@{selectAll}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::select\-All ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileView_a31}


Selects all items. 

You may want to override this, if you can implement it more efficiently than calling {\bf set\-Selected()}{\rm (p.\,\pageref{classKFileView_a33})} with every item. This works only in Multiselection mode of course. 

Reimplemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a13})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a13})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a14})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a15})}.

Definition at line 308 of file kfileview.cpp.

References set\-Selected().

Referenced by KFile\-Preview::select\-All(), and KCombi\-View::select\-All().\index{KFileView@{KFile\-View}!invertSelection@{invertSelection}}
\index{invertSelection@{invertSelection}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::invert\-Selection ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileView_a32}


Inverts the current selection, i.e. 

selects all items, that were up to now not selected and deselects the other. 

Reimplemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a14})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a14})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a15})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a16})}.

Definition at line 319 of file kfileview.cpp.

References is\-Selected(), and set\-Selected().

Referenced by KFile\-Preview::invert\-Selection(), and KCombi\-View::invert\-Selection().\index{KFileView@{KFile\-View}!setSelected@{setSelected}}
\index{setSelected@{setSelected}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KFile\-View::set\-Selected (const {\bf KFile\-Item} $\ast$, bool {\em enable})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKFileView_a33}


Tells the view that it should highlight the item. 

This function must be implemented by the view. 

Implemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a10})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a10})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a11})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a12})}.

Referenced by invert\-Selection(), select\-All(), KDir\-Operator::set\-Current\-Item(), KFile\-Preview::set\-Selected(), and KCombi\-View::set\-Selected().\index{KFileView@{KFile\-View}!isSelected@{isSelected}}
\index{isSelected@{isSelected}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KFile\-View::is\-Selected (const {\bf KFile\-Item} $\ast$) const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKFileView_a34}


\begin{Desc}
\item[Returns:]whether the given item is currently selected. Must be implemented by the view. \end{Desc}


Implemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a11})}, {\bf KFile\-Detail\-View} {\rm (p.\,\pageref{classKFileDetailView_a11})}, {\bf KFile\-Icon\-View} {\rm (p.\,\pageref{classKFileIconView_a12})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a13})}.

Referenced by invert\-Selection(), KFile\-Preview::is\-Selected(), KDir\-Operator::is\-Selected(), KCombi\-View::is\-Selected(), KFile\-Preview::remove\-Item(), and selected\-Items().\index{KFileView@{KFile\-View}!selectedItems@{selectedItems}}
\index{selectedItems@{selectedItems}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const  {\bf KFile\-Item\-List} $\ast$ KFile\-View::selected\-Items () const}\label{classKFileView_a35}


\begin{Desc}
\item[Returns:]all currently highlighted items. \end{Desc}


Definition at line 292 of file kfileview.cpp.

References QPtr\-List::append(), QPtr\-List::clear(), and is\-Selected().

Referenced by KDir\-Operator::delete\-Selected(), KDir\-Operator::selected\-Items(), and KDir\-Operator::update\-Selection\-Dependent\-Actions().\index{KFileView@{KFile\-View}!items@{items}}
\index{items@{items}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const  {\bf KFile\-Item\-List} $\ast$ KFile\-View::items () const}\label{classKFileView_a36}


\begin{Desc}
\item[Returns:]all items currently available in the current sort-order \end{Desc}


Definition at line 279 of file kfileview.cpp.

References QPtr\-List::append(), and QPtr\-List::clear().

Referenced by KDir\-Operator::prepare\-Completion\-Objects(), KFile\-Icon\-View::set\-Sorting(), and KFile\-Icon\-View::show\-Previews().\index{KFileView@{KFile\-View}!setOnlyDoubleClickSelectsFiles@{setOnlyDoubleClickSelectsFiles}}
\index{setOnlyDoubleClickSelectsFiles@{setOnlyDoubleClickSelectsFiles}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-View::set\-Only\-Double\-Click\-Selects\-Files (bool {\em enable})\hspace{0.3cm}{\tt  [inline]}}\label{classKFileView_a40}


This is a {\bf KFile\-Dialog}{\rm (p.\,\pageref{classKFileDialog})} specific hack: we want to select directories with single click, but not files. 

But as a generic class, we have to be able to select files on single click as well.

This gives us the opportunity to do both.

Every view has to decide when to call select( item ) when a file was single-clicked, based on {\bf only\-Double\-Click\-Selects\-Files}{\rm (p.\,\pageref{classKFileView_a41})}(). 

Definition at line 315 of file kfileview.h.

Referenced by KDir\-Operator::create\-View(), KDir\-Operator::set\-Only\-Double\-Click\-Selects\-Files(), and KDir\-Operator::set\-View().\index{KFileView@{KFile\-View}!onlyDoubleClickSelectsFiles@{onlyDoubleClickSelectsFiles}}
\index{onlyDoubleClickSelectsFiles@{onlyDoubleClickSelectsFiles}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-View::only\-Double\-Click\-Selects\-Files () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileView_a41}


\begin{Desc}
\item[Returns:]whether files (not directories) should only be select()ed by double-clicks. \end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Only\-Double\-Click\-Selects\-Files}{\rm (p.\,\pageref{classKFileView_a40})} \end{Desc}


Definition at line 324 of file kfileview.h.\index{KFileView@{KFile\-View}!updateNumbers@{updateNumbers}}
\index{updateNumbers@{updateNumbers}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-View::update\-Numbers (const {\bf KFile\-Item} $\ast$ {\em i})}\label{classKFileView_a42}


increases the number of dirs and files. 

\begin{Desc}
\item[Returns:]true if the item fits the view mode \end{Desc}


Definition at line 106 of file kfileview.cpp.

References KFile\-Item::is\-Dir(), and KFile\-Item::is\-File().

Referenced by add\-Item\-List(), and KCombi\-View::insert\-Item().\index{KFileView@{KFile\-View}!actionCollection@{actionCollection}}
\index{actionCollection@{actionCollection}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KAction\-Collection} $\ast$ KFile\-View::action\-Collection () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileView_a43}


\begin{Desc}
\item[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 KDir\-Operator's popup-menu. \end{Desc}


Reimplemented in {\bf KCombi\-View} {\rm (p.\,\pageref{classKCombiView_a26})}, and {\bf KFile\-Preview} {\rm (p.\,\pageref{classKFilePreview_a27})}.

Definition at line 361 of file kfileview.cpp.

References widget().

Referenced by KFile\-Preview::action\-Collection(), and KCombi\-View::action\-Collection().\index{KFileView@{KFile\-View}!sortingKey@{sortingKey}}
\index{sortingKey@{sortingKey}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-View::sorting\-Key (const {\bf QString} \& {\em value}, bool {\em is\-Dir}, int {\em sort\-Spec})\hspace{0.3cm}{\tt  [static]}}\label{classKFileView_e0}


This method calculates a {\bf QString} from the given parameters, that is suitable for sorting with e.g. 

{\bf QIcon\-View} or {\bf QList\-View}. Their Item-classes usually have a set\-Key( const QString\& ) method or a virtual method {\bf QString} key() that is used for sorting.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em value}]Any string that should be used as sort criterion \item[{\em is\-Dir}]Tells whether the key is computed for an item representing a directory (directories are usually sorted before files) \item[{\em sort\-Spec}]An ORed combination of QDir::Sort\-Spec flags. Currently, the values Ignore\-Case, Reversed and Dirs\-First are taken into account. \end{description}
\end{Desc}


Definition at line 376 of file kfileview.cpp.

References QString::lower(), and QString::prepend().

Referenced by KFile\-Icon\-View::set\-Sorting().\index{KFileView@{KFile\-View}!sortingKey@{sortingKey}}
\index{sortingKey@{sortingKey}!KFileView@{KFile\-View}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-View::sorting\-Key (KIO::filesize\_\-t {\em value}, bool {\em is\-Dir}, int {\em sort\-Spec})\hspace{0.3cm}{\tt  [static]}}\label{classKFileView_e1}


An overloaded method that takes not a {\bf QString}, but a number as sort criterion. 

You can use this for file-sizes or dates/times for example. If you use a time\_\-t, you need to cast that to KIO::filesize\_\-t because of ambiguity problems. 

Definition at line 385 of file kfileview.cpp.

References KIO::number(), and QString::right\-Justify().

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