\section{KScan\-Dialog Class Reference}
\label{classKScanDialog}\index{KScanDialog@{KScanDialog}}
This is a base class for scanning dialogs. A baseclass and accessor for Scanning Dialogs.  


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

Inheritance diagram for KScan\-Dialog:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=55pt]{classKScanDialog__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KScan\-Dialog:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=55pt]{classKScanDialog__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf preview} (const {\bf QImage} \&img, int id)
\item 
void {\bf final\-Image} (const {\bf QImage} \&img, int id)
\item 
void {\bf text\-Recognized} (const {\bf QString} \&text, int id)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf $\sim$KScan\-Dialog} ()
\item 
virtual bool {\bf setup} ()
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf KScan\-Dialog} $\ast$ {\bf get\-Scan\-Dialog} ({\bf QWidget} $\ast$parent=0L, const char $\ast$name=0, bool modal=false)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf KScan\-Dialog} (int dialog\-Face=Tabbed, int button\-Mask=Close$|$Help, {\bf QWidget} $\ast$parent=0L, const char $\ast$name=0, bool modal=false)
\item 
int {\bf id} () const 
\item 
int {\bf next\-Id} ()
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKScanDialog_b3}

\end{CompactItemize}


\subsection{Detailed Description}
This is a base class for scanning dialogs. A baseclass and accessor for Scanning Dialogs. 

You can derive from this class and implement your own dialog. An implementation is available in kdegraphics/libkscan.

Application developers that wish to add scanning support to their program can use the static method {\tt {\bf KScan\-Dialog::get\-Scan\-Dialog()}{\rm (p.\,\pageref{classKScanDialog_e0})}} to get an instance of the user's preferred scanning dialog.

Typical usage looks like this (e.g. in a slot\-Show\-Scan\-Dialog() method):



\footnotesize\begin{verbatim} if ( !m_scanDialog ) {
     m_scanDialog = KScanDialog::getScanDialog( this, "scandialog" );
     if ( !m_scanDialog ) // no scanning support installed?
         return;

     connect( m_scanDialog, SIGNAL( finalImage( const QImage&, int )),
              SLOT( slotScanned( const QImage&, int ) ));
 }

 if ( m_scanDialog->setup() ) // only if scanner configured/available
     m_scanDialog->show();
\end{verbatim}
\normalsize


This will create and show a non-modal scanning dialog. Connect to more signals if you like.

If you implement an own scan-dialog, you also have to implement a {\bf KScan\-Dialog\-Factory}{\rm (p.\,\pageref{classKScanDialogFactory})}.

\begin{Desc}
\item[Author:]Carsten Pfeiffer $<${\tt pfeiffer@kde.org}$>$ \end{Desc}




Definition at line 63 of file kscan.h.

\subsection{Constructor \& Destructor Documentation}
\index{KScanDialog@{KScan\-Dialog}!~KScanDialog@{$\sim$KScanDialog}}
\index{~KScanDialog@{$\sim$KScanDialog}!KScanDialog@{KScan\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KScan\-Dialog::$\sim${\bf KScan\-Dialog} ()}\label{classKScanDialog_a0}


Destructs the scan dialog. 



Definition at line 58 of file kscan.cpp.\index{KScanDialog@{KScan\-Dialog}!KScanDialog@{KScanDialog}}
\index{KScanDialog@{KScanDialog}!KScanDialog@{KScan\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KScan\-Dialog::KScan\-Dialog (int {\em dialog\-Face} = {\tt Tabbed}, int {\em button\-Mask} = {\tt Close$|$Help}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0L}, const char $\ast$ {\em name} = {\tt 0}, bool {\em modal} = {\tt false})\hspace{0.3cm}{\tt  [protected]}}\label{classKScanDialog_b0}


Constructs the scan dialog. 

If you implement an own dialog, you can customize it with the usual {\bf KDialog\-Base} flags.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dialog\-Face}]the {\bf KDialog\-Base::Dialog\-Type} \item[{\em button\-Mask}]a ORed mask of all buttons (see {\bf KDialog\-Base::Button\-Code}) \item[{\em parent}]the QWidget's parent, or 0 \item[{\em name}]the name of the {\bf QObject}, can be 0 \item[{\em modal}]if true the dialog is model \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf KDialog\-Base} \end{Desc}


Definition at line 50 of file kscan.cpp.

\subsection{Member Function Documentation}
\index{KScanDialog@{KScan\-Dialog}!getScanDialog@{getScanDialog}}
\index{getScanDialog@{getScanDialog}!KScanDialog@{KScan\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KScan\-Dialog} $\ast$ KScan\-Dialog::get\-Scan\-Dialog ({\bf QWidget} $\ast$ {\em parent} = {\tt 0L}, const char $\ast$ {\em name} = {\tt 0}, bool {\em modal} = {\tt false})\hspace{0.3cm}{\tt  [static]}}\label{classKScanDialog_e0}


Creates the user's preferred scanning dialog and returns it, or 0L if no scan-support is available. 

Pass a suitable {\tt parent} widget, if you like. If you don't you have to 'delete' the returned pointer yourself. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]the QWidget's parent, or 0 \item[{\em name}]the name of the {\bf QObject}, can be 0 \item[{\em modal}]if true the dialog is model \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the KScan\-Dialog, or 0 if the function failed \end{Desc}


Definition at line 28 of file kscan.cpp.

References QValue\-List::begin(), KLib\-Factory::create(), KLib\-Loader::factory(), QValue\-List::is\-Empty(), QString::number(), KTrader::query(), KLib\-Loader::self(), and KTrader::self().\index{KScanDialog@{KScan\-Dialog}!setup@{setup}}
\index{setup@{setup}!KScanDialog@{KScan\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KScan\-Dialog::setup ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKScanDialog_a1}


Reimplement this if you need to set up some things, before showing the dialog, e.g. 

to ask the user for the scanner device to use. If you return false (e.g. there is no device available or the user aborted device selection), the dialog will not be shown.

\begin{Desc}
\item[Returns:]true by default. \end{Desc}


Definition at line 62 of file kscan.cpp.\index{KScanDialog@{KScan\-Dialog}!id@{id}}
\index{id@{id}!KScanDialog@{KScan\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KScan\-Dialog::id () const\hspace{0.3cm}{\tt  [inline, protected]}}\label{classKScanDialog_b1}


Returns the current id for an image. 

You can use that in your subclass for the signals. The id is used in the signals to let people know which preview and which text-recognition belongs to which scan.

\begin{Desc}
\item[Returns:]the current id for the image \end{Desc}
\begin{Desc}
\item[See also:]{\bf next\-Id}{\rm (p.\,\pageref{classKScanDialog_b2})} 

{\bf final\-Image}{\rm (p.\,\pageref{classKScanDialog_l1})} 

{\bf preview}{\rm (p.\,\pageref{classKScanDialog_l0})} 

{\bf text\-Recognized}{\rm (p.\,\pageref{classKScanDialog_l2})} \end{Desc}


Definition at line 122 of file kscan.h.\index{KScanDialog@{KScan\-Dialog}!nextId@{nextId}}
\index{nextId@{nextId}!KScanDialog@{KScan\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KScan\-Dialog::next\-Id ()\hspace{0.3cm}{\tt  [inline, protected]}}\label{classKScanDialog_b2}


Returns the id for the next image. 

You can use that in your subclass for the signals.

\begin{Desc}
\item[Returns:]the id for the next image \end{Desc}
\begin{Desc}
\item[See also:]{\bf id}{\rm (p.\,\pageref{classKScanDialog_b1})} 

{\bf final\-Image}{\rm (p.\,\pageref{classKScanDialog_l1})} 

{\bf preview}{\rm (p.\,\pageref{classKScanDialog_l0})} 

{\bf text\-Recognized}{\rm (p.\,\pageref{classKScanDialog_l2})} \end{Desc}


Definition at line 135 of file kscan.h.\index{KScanDialog@{KScan\-Dialog}!preview@{preview}}
\index{preview@{preview}!KScanDialog@{KScan\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScan\-Dialog::preview (const {\bf QImage} \& {\em img}, int {\em id})\hspace{0.3cm}{\tt  [signal]}}\label{classKScanDialog_l0}


Informs you that an image has been previewed. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em img}]the image \item[{\em id}]the image's id \end{description}
\end{Desc}
\index{KScanDialog@{KScan\-Dialog}!finalImage@{finalImage}}
\index{finalImage@{finalImage}!KScanDialog@{KScan\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScan\-Dialog::final\-Image (const {\bf QImage} \& {\em img}, int {\em id})\hspace{0.3cm}{\tt  [signal]}}\label{classKScanDialog_l1}


Informs you that an image has scanned. 

{\tt id} is the same as in the {\tt {\bf preview()}{\rm (p.\,\pageref{classKScanDialog_l0})}} signal, if this image had been previewed before.

Note, that those id's may not be properly implemented in the current libkscan. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em img}]the image \item[{\em id}]the image's id \end{description}
\end{Desc}
\index{KScanDialog@{KScan\-Dialog}!textRecognized@{textRecognized}}
\index{textRecognized@{textRecognized}!KScanDialog@{KScan\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScan\-Dialog::text\-Recognized (const {\bf QString} \& {\em text}, int {\em id})\hspace{0.3cm}{\tt  [signal]}}\label{classKScanDialog_l2}


Informs you that the image with the id {\tt id} has been run through text-recognition. 

The text is in the {\bf QString} parameter. In the future, a compound document, using rich text will be used instead.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the text that has been recognized \item[{\em id}]the id of the image \end{description}
\end{Desc}


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