\section{KFile\-Preview Class Reference}
\label{classKFilePreview}\index{KFilePreview@{KFilePreview}}
{\tt \#include $<$kfilepreview.h$>$}

Inheritance diagram for KFile\-Preview:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=85pt]{classKFilePreview__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KFile\-Preview:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=217pt]{classKFilePreview__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf show\-Preview} (const  {\bf KURL} \&)\label{classKFilePreview_l0}

\item 
void {\bf clear\-Preview} ()\label{classKFilePreview_l1}

\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KFile\-Preview} ({\bf QWidget} $\ast$parent, const  char $\ast$name)\label{classKFilePreview_a0}

\item 
{\bf KFile\-Preview} ({\bf KFile\-View} $\ast$view, {\bf QWidget} $\ast$parent, const  char $\ast$name)\label{classKFilePreview_a1}

\item 
virtual {\bf QWidget} $\ast$ {\bf widget} ()
\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 
virtual void {\bf clear\-View} ()
\begin{CompactList}\small\item\em pure virtual function, that should be implemented to clear the view. \item\end{CompactList}\item 
void {\bf set\-File\-View} ({\bf KFile\-View} $\ast$view)
\begin{CompactList}\small\item\em Delets the current view and sets the view to the given {\tt view}. \item\end{CompactList}\item 
{\bf KFile\-View} $\ast$ {\bf file\-View} () const 
\item 
virtual void {\bf update\-View} (bool)
\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{classKFilePreview_a8}

\item 
virtual void {\bf remove\-Item} (const  {\bf KFile\-Item} $\ast$)
\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 
virtual void {\bf set\-Selection\-Mode} (KFile::Selection\-Mode sm)\label{classKFilePreview_a11}

\item 
virtual void {\bf set\-Selected} (const  {\bf KFile\-Item} $\ast$, bool)
\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 
\item 
virtual void {\bf clear\-Selection} ()
\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 insert\-Item} ({\bf KFile\-Item} $\ast$)
\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} ()
\begin{CompactList}\small\item\em Clears the view and all item lists. \item\end{CompactList}\item 
virtual void {\bf set\-Current\-Item} (const  {\bf KFile\-Item} $\ast$)
\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 
\item 
virtual {\bf KFile\-Item} $\ast$ {\bf first\-File\-Item} () const \label{classKFilePreview_a21}

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

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

\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 
virtual void {\bf read\-Config} ({\bf KConfig} $\ast$, const  {\bf QString} \&group=QString::null)\label{classKFilePreview_a25}

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

\item 
virtual {\bf KAction\-Collection} $\ast$ {\bf action\-Collection} () const 
\begin{CompactList}\small\item\em This overrides {\bf KFile\-View::action\-Collection()}{\rm (p.\,\pageref{classKFileView_a43})} by returning the {\bf action\-Collection()}{\rm (p.\,\pageref{classKFilePreview_a27})} of the {\bf KFile\-View}{\rm (p.\,\pageref{classKFileView})} (member left) it contains. \item\end{CompactList}\item 
void {\bf ensure\-Item\-Visible} (const  {\bf KFile\-Item} $\ast$)
\begin{CompactList}\small\item\em pure virtual function, that should be implemented to make item i visible, i.e. \item\end{CompactList}\item 
void {\bf set\-Preview\-Widget} (const  {\bf QWidget} $\ast$w, const  {\bf KURL} \&u)\label{classKFilePreview_a29}

\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
virtual void {\bf slot\-Highlighted} (const  {\bf KFile\-Item} $\ast$)\label{classKFilePreview_j0}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKFilePreview_b0}

\end{CompactItemize}


\subsection{Detailed Description}
This {\bf KFile\-View}{\rm (p.\,\pageref{classKFileView})} is an empbedded preview for some file types. 



Definition at line 46 of file kfilepreview.h.

\subsection{Member Function Documentation}
\index{KFilePreview@{KFile\-Preview}!widget@{widget}}
\index{widget@{widget}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QWidget}$\ast$ KFile\-Preview::widget ()\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKFilePreview_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. 

Implements {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a3})}.

Definition at line 55 of file kfilepreview.h.\index{KFilePreview@{KFile\-Preview}!clearView@{clearView}}
\index{clearView@{clearView}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::clear\-View ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a4}


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

At this moment the list is already empty 

Implements {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a28})}.

Definition at line 139 of file kfilepreview.cpp.

References KFile\-View::clear\-View().\index{KFilePreview@{KFile\-Preview}!setFileView@{setFileView}}
\index{setFileView@{setFileView}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::set\-File\-View ({\bf KFile\-View} $\ast$ {\em view})}\label{classKFilePreview_a5}


Delets the current view and sets the view to the given {\tt view}. 

The view is reparented to have this as parent, if necessary. 

Definition at line 78 of file kfilepreview.cpp.

References QWidget::reparent(), KFile\-View::set\-Parent\-View(), KFile\-View::set\-Sorting(), KFile\-View::signaler(), KFile\-View::sorting(), and KFile\-View::widget().\index{KFilePreview@{KFile\-Preview}!fileView@{fileView}}
\index{fileView@{fileView}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-View}$\ast$ KFile\-Preview::file\-View () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFilePreview_a6}


\begin{Desc}
\item[Returns:]the current fileview \end{Desc}


Definition at line 67 of file kfilepreview.h.\index{KFilePreview@{KFile\-Preview}!updateView@{updateView}}
\index{updateView@{updateView}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::update\-View (bool)\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a7}


does a repaint of the view. 

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

Reimplemented from {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a9})}.

Definition at line 145 of file kfilepreview.cpp.

References QWidget::repaint(), and KFile\-View::update\-View().\index{KFilePreview@{KFile\-Preview}!removeItem@{removeItem}}
\index{removeItem@{removeItem}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::remove\-Item (const {\bf KFile\-Item} $\ast$)\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a9}


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

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

Reimplemented from {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a11})}.

Definition at line 157 of file kfilepreview.cpp.

References KFile\-View::is\-Selected(), and KFile\-View::remove\-Item().\index{KFilePreview@{KFile\-Preview}!listingCompleted@{listingCompleted}}
\index{listingCompleted@{listingCompleted}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::listing\-Completed ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a10}


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 from {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a12})}.

Definition at line 166 of file kfilepreview.cpp.

References KFile\-View::listing\-Completed().\index{KFilePreview@{KFile\-Preview}!setSelected@{setSelected}}
\index{setSelected@{setSelected}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::set\-Selected (const {\bf KFile\-Item} $\ast$, bool)\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a12}


Tells the view that it should highlight the item. 

This function must be implemented by the view. 

Implements {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a33})}.

Definition at line 202 of file kfilepreview.cpp.

References KFile\-View::set\-Selected().\index{KFilePreview@{KFile\-Preview}!isSelected@{isSelected}}
\index{isSelected@{isSelected}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Preview::is\-Selected (const {\bf KFile\-Item} $\ast$) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a13}


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


Implements {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a34})}.

Definition at line 193 of file kfilepreview.cpp.

References KFile\-View::is\-Selected().\index{KFilePreview@{KFile\-Preview}!clearSelection@{clearSelection}}
\index{clearSelection@{clearSelection}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::clear\-Selection ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a14}


Clears any selection, unhighlights everything. 

Must be implemented by the view. 

Implements {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a30})}.

Definition at line 177 of file kfilepreview.cpp.

References KFile\-View::clear\-Selection().\index{KFilePreview@{KFile\-Preview}!selectAll@{selectAll}}
\index{selectAll@{selectAll}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::select\-All ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a15}


Selects all items. 

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

Reimplemented from {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a31})}.

Definition at line 183 of file kfilepreview.cpp.

References KFile\-View::select\-All().\index{KFilePreview@{KFile\-Preview}!invertSelection@{invertSelection}}
\index{invertSelection@{invertSelection}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::invert\-Selection ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a16}


Inverts the current selection, i.e. 

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

Reimplemented from {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a32})}.

Definition at line 188 of file kfilepreview.cpp.

References KFile\-View::invert\-Selection().\index{KFilePreview@{KFile\-Preview}!insertItem@{insertItem}}
\index{insertItem@{insertItem}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::insert\-Item ({\bf KFile\-Item} $\ast$)\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a17}


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 from {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a27})}.

Definition at line 127 of file kfilepreview.cpp.

References KFile\-View::insert\-Item().\index{KFilePreview@{KFile\-Preview}!clear@{clear}}
\index{clear@{clear}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::clear ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a18}


Clears the view and all item lists. 



Reimplemented from {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a8})}.

Definition at line 171 of file kfilepreview.cpp.

References KFile\-View::clear().\index{KFilePreview@{KFile\-Preview}!setCurrentItem@{setCurrentItem}}
\index{setCurrentItem@{setCurrentItem}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::set\-Current\-Item (const {\bf KFile\-Item} $\ast$)\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a19}


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

the item having focus. 

Implements {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a6})}.

Definition at line 206 of file kfilepreview.cpp.

References KFile\-View::set\-Current\-Item().\index{KFilePreview@{KFile\-Preview}!currentFileItem@{currentFileItem}}
\index{currentFileItem@{currentFileItem}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Item} $\ast$ KFile\-Preview::current\-File\-Item () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a20}


\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}


Implements {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a7})}.

Definition at line 211 of file kfilepreview.cpp.

References KFile\-View::current\-File\-Item().\index{KFilePreview@{KFile\-Preview}!setSorting@{setSorting}}
\index{setSorting@{setSorting}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::set\-Sorting (QDir::Sort\-Spec {\em sort})\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a24}


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 from {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a14})}.

Definition at line 133 of file kfilepreview.cpp.

References KFile\-View::set\-Sorting(), and KFile\-View::sorting().\index{KFilePreview@{KFile\-Preview}!actionCollection@{actionCollection}}
\index{actionCollection@{actionCollection}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KAction\-Collection} $\ast$ KFile\-Preview::action\-Collection () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a27}


This overrides {\bf KFile\-View::action\-Collection()}{\rm (p.\,\pageref{classKFileView_a43})} by returning the {\bf action\-Collection()}{\rm (p.\,\pageref{classKFilePreview_a27})} of the {\bf KFile\-View}{\rm (p.\,\pageref{classKFileView})} (member left) it contains. 

This means that KFile\-Preview will never create a {\bf KAction\-Collection} object of its own. 

Reimplemented from {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a43})}.

Definition at line 254 of file kfilepreview.cpp.

References KFile\-View::action\-Collection().\index{KFilePreview@{KFile\-Preview}!ensureItemVisible@{ensureItemVisible}}
\index{ensureItemVisible@{ensureItemVisible}!KFilePreview@{KFile\-Preview}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Preview::ensure\-Item\-Visible (const {\bf KFile\-Item} $\ast$)\hspace{0.3cm}{\tt  [virtual]}}\label{classKFilePreview_a28}


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

by scrolling the view appropriately. 

Implements {\bf KFile\-View} {\rm (p.\,\pageref{classKFileView_a29})}.

Definition at line 234 of file kfilepreview.cpp.

References KFile\-View::ensure\-Item\-Visible().

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