\section{KIO::Preview\-Job Class Reference}
\label{classKIO_1_1PreviewJob}\index{KIO::PreviewJob@{KIO::PreviewJob}}
{\bf KIO}{\rm (p.\,\pageref{namespaceKIO})} {\bf Job}{\rm (p.\,\pageref{classKIO_1_1Job})} to get a thumbnail picture.  


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

Inheritance diagram for KIO::Preview\-Job:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=63pt]{classKIO_1_1PreviewJob__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KIO::Preview\-Job:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=305pt]{classKIO_1_1PreviewJob__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf got\-Preview} (const {\bf KFile\-Item} $\ast$item, const {\bf QPixmap} \&preview)
\item 
void {\bf failed} (const {\bf KFile\-Item} $\ast$item)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Preview\-Job} (const {\bf KFile\-Item\-List} \&items, int width, int height, int icon\-Size, int icon\-Alpha, bool scale, bool save, const {\bf QString\-List} $\ast$enabled\-Plugins, bool delete\-Items=false)
\item 
void {\bf remove\-Item} (const {\bf KFile\-Item} $\ast$item)
\item 
void {\bf set\-Ignore\-Maximum\-Size} (bool ignore\-Size=true)
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf QString\-List} {\bf available\-Plugins} ()
\item 
static {\bf QString\-List} {\bf supported\-Mime\-Types} ()
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
virtual void {\bf slot\-Result} ({\bf KIO::Job} $\ast$job)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf get\-Or\-Create\-Thumbnail} ()\label{classKIO_1_1PreviewJob_b0}

\item 
bool {\bf stat\-Result\-Thumbnail} ()\label{classKIO_1_1PreviewJob_b1}

\item 
void {\bf create\-Thumbnail} ({\bf QString})\label{classKIO_1_1PreviewJob_b2}

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

\end{CompactItemize}


\subsection{Detailed Description}
{\bf KIO}{\rm (p.\,\pageref{namespaceKIO})} {\bf Job}{\rm (p.\,\pageref{classKIO_1_1Job})} to get a thumbnail picture. 

This class catches a preview (thumbnail) for files. 



Definition at line 37 of file previewjob.h.

\subsection{Constructor \& Destructor Documentation}
\index{KIO::PreviewJob@{KIO::Preview\-Job}!PreviewJob@{PreviewJob}}
\index{PreviewJob@{PreviewJob}!KIO::PreviewJob@{KIO::Preview\-Job}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Preview\-Job::Preview\-Job (const {\bf KFile\-Item\-List} \& {\em items}, int {\em width}, int {\em height}, int {\em icon\-Size}, int {\em icon\-Alpha}, bool {\em scale}, bool {\em save}, const {\bf QString\-List} $\ast$ {\em enabled\-Plugins}, bool {\em delete\-Items} = {\tt false})}\label{classKIO_1_1PreviewJob_a0}


Creates a new {\bf Preview\-Job}{\rm (p.\,\pageref{classKIO_1_1PreviewJob})}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em items}]a list of files to create previews for \item[{\em width}]the desired width \item[{\em height}]the desired height, 0 to use the {\tt width} \item[{\em icon\-Size}]the size of the mimetype icon to overlay over the preview or zero to not overlay an icon. This has no effect if the preview plugin that will be used doesn't use icon overlays. \item[{\em icon\-Alpha}]transparency to use for the icon overlay \item[{\em scale}]if the image is to be scaled to the requested size or returned in its original size \item[{\em save}]if the image should be cached for later use \item[{\em enabled\-Plugins}]if non-zero, this points to a list containing the names of the plugins that may be used. \item[{\em delete\-Items}]true to delete the items when done\end{description}
\end{Desc}


Definition at line 117 of file previewjob.cpp.

References QDir::home\-Dir\-Path(), and QTimer::single\-Shot().

\subsection{Member Function Documentation}
\index{KIO::PreviewJob@{KIO::Preview\-Job}!removeItem@{removeItem}}
\index{removeItem@{removeItem}!KIO::PreviewJob@{KIO::Preview\-Job}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Preview\-Job::remove\-Item (const {\bf KFile\-Item} $\ast$ {\em item})}\label{classKIO_1_1PreviewJob_a2}


Removes an item from preview processing. 

Use this if you passed an item to file\-Preview and want to delete it now.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em item}]the item that should be removed from the preview queue \end{description}
\end{Desc}


Definition at line 218 of file previewjob.cpp.

References QPtr\-List::first(), QMap::remove(), and QPtr\-List::remove\-First().\index{KIO::PreviewJob@{KIO::Preview\-Job}!setIgnoreMaximumSize@{setIgnoreMaximumSize}}
\index{setIgnoreMaximumSize@{setIgnoreMaximumSize}!KIO::PreviewJob@{KIO::Preview\-Job}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Preview\-Job::set\-Ignore\-Maximum\-Size (bool {\em ignore\-Size} = {\tt true})}\label{classKIO_1_1PreviewJob_a3}


If {\tt ignore\-Size} is true, then the preview is always generated regardless of the settings. 

\begin{Desc}
\item[Since:]{\bf KDE} 3.4 \end{Desc}


Definition at line 235 of file previewjob.cpp.\index{KIO::PreviewJob@{KIO::Preview\-Job}!availablePlugins@{availablePlugins}}
\index{availablePlugins@{availablePlugins}!KIO::PreviewJob@{KIO::Preview\-Job}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} Preview\-Job::available\-Plugins ()\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1PreviewJob_e0}


Returns a list of all available preview plugins. 

The list contains the basenames of the plugins' .desktop files (no path, no .desktop). \begin{Desc}
\item[Returns:]the list of plugins \end{Desc}


Definition at line 504 of file previewjob.cpp.

References QValue\-List::begin(), QValue\-List::end(), KTrader::query(), and KTrader::self().\index{KIO::PreviewJob@{KIO::Preview\-Job}!supportedMimeTypes@{supportedMimeTypes}}
\index{supportedMimeTypes@{supportedMimeTypes}!KIO::PreviewJob@{KIO::Preview\-Job}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} Preview\-Job::supported\-Mime\-Types ()\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1PreviewJob_e1}


Returns a list of all supported MIME types. 

The list can contain entries like text/ $\ast$ (without the space). \begin{Desc}
\item[Returns:]the list of mime types \end{Desc}


Definition at line 514 of file previewjob.cpp.

References QValue\-List::begin(), QValue\-List::end(), KTrader::query(), and KTrader::self().

Referenced by KFile\-Icon\-View::show\-Previews().\index{KIO::PreviewJob@{KIO::Preview\-Job}!gotPreview@{gotPreview}}
\index{gotPreview@{gotPreview}!KIO::PreviewJob@{KIO::Preview\-Job}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIO::Preview\-Job::got\-Preview (const {\bf KFile\-Item} $\ast$ {\em item}, const {\bf QPixmap} \& {\em preview})\hspace{0.3cm}{\tt  [signal]}}\label{classKIO_1_1PreviewJob_l0}


Emitted when a thumbnail picture for {\tt item} has been successfully retrieved. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em item}]the file of the preview \item[{\em preview}]the preview image \end{description}
\end{Desc}
\index{KIO::PreviewJob@{KIO::Preview\-Job}!failed@{failed}}
\index{failed@{failed}!KIO::PreviewJob@{KIO::Preview\-Job}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIO::Preview\-Job::failed (const {\bf KFile\-Item} $\ast$ {\em item})\hspace{0.3cm}{\tt  [signal]}}\label{classKIO_1_1PreviewJob_l1}


Emitted when a thumbnail for {\tt item} could not be created, either because a {\bf Thumb\-Creator}{\rm (p.\,\pageref{classThumbCreator})} for its MIME type does not exist, or because something went wrong. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em item}]the file that failed \end{description}
\end{Desc}
\index{KIO::PreviewJob@{KIO::Preview\-Job}!slotResult@{slotResult}}
\index{slotResult@{slotResult}!KIO::PreviewJob@{KIO::Preview\-Job}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Preview\-Job::slot\-Result ({\bf KIO::Job} $\ast$ {\em job})\hspace{0.3cm}{\tt  [protected, virtual, slot]}}\label{classKIO_1_1PreviewJob_j0}


Called whenever a subjob finishes. 

Default implementation checks for errors and propagates to parent job, then calls remove\-Subjob. Override if you don't want subjobs errors to be propagated. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job}]the subjob \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf result()}{\rm (p.\,\pageref{classKIO_1_1Job_l0})} \end{Desc}


Reimplemented from {\bf KIO::Job} {\rm (p.\,\pageref{classKIO_1_1Job_j0})}.

Definition at line 270 of file previewjob.cpp.

References QValue\-List::begin(), QValue\-List::end(), QPtr\-List::is\-Empty(), QFile::remove(), and QPtr\-List::remove().

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