\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} \&, int id)
\begin{CompactList}\small\item\em Informs you that an image has been previewed. \item\end{CompactList}\item 
void {\bf final\-Image} (const  {\bf QImage} \&, int id)
\begin{CompactList}\small\item\em Informs you that an image has scanned. \item\end{CompactList}\item 
void {\bf text\-Recognized} (const  {\bf QString} \&, int id)
\begin{CompactList}\small\item\em Informs you that the image with the id {\tt id} has been run through text-recognition. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf $\sim$KScan\-Dialog} ()
\begin{CompactList}\small\item\em Destructs the scan dialog. \item\end{CompactList}\item 
virtual bool {\bf setup} ()
\begin{CompactList}\small\item\em Reimplement this if you need to set up some things, before showing the dialog, e.g. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KScan\-Dialog} $\ast$ {\bf get\-Scan\-Dialog} ({\bf QWidget} $\ast$parent=0L, const  char $\ast$name=0, bool modal=false)
\begin{CompactList}\small\item\em Creates the user's preferred scanning dialog and returns it, or 0L if no scan-support is available. \item\end{CompactList}\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)
\begin{CompactList}\small\item\em Constructs the scan dialog. \item\end{CompactList}\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):

\small\begin{alltt}
 if ( !m\_scanDialog ) \{
     m\_scanDialog = {\bf KScanDialog::getScanDialog}{\rm (p.\,\pageref{classKScanDialog_e0})}( this, "scandialog" );
     if ( !m\_scanDialog ) // no scanning support installed?
         return;\end{alltt}\normalsize 


\small\begin{alltt}     connect( m\_scanDialog, SIGNAL( {\bf finalImage( const QImage&, int )}{\rm (p.\,\pageref{classKScanDialog_l1})}),
              SLOT( slotScanned( const QImage&, int ) ));
 \}\end{alltt}\normalsize 


\small\begin{alltt} if ( m\_scanDialog-$>${\bf setup()}{\rm (p.\,\pageref{classKScanDialog_a1})} ) // only if scanner configured/available
     m\_scanDialog-$>${\bf show()};
 \end{alltt}\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} = Tabbed, int {\em button\-Mask} = Close$|$Help, {\bf QWidget} $\ast$ {\em parent} = 0L, const char $\ast$ {\em name} = 0, bool {\em modal} = 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[See also:]{\bf KDialog\-Base} \end{Desc}


Definition at line 50 of file kscan.cpp.

References KStd\-Accel::name().

\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} = 0L, const char $\ast$ {\em name} = 0, bool {\em modal} = 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. 

Definition at line 28 of file kscan.cpp.

References QValue\-List::begin(), KLib\-Factory::create(), QFile::encode\-Name(), KLib\-Loader::factory(), QValue\-List::is\-Empty(), KStd\-Accel::name(), QString::number(), KTrader::Offer\-List, 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.

Returns true by default. 

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}


\begin{Desc}
\item[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.\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 111 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}


\begin{Desc}
\item[Returns:]the id for the next image. You can use that in your subclass for the signals.\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 123 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} \&, int {\em id})\hspace{0.3cm}{\tt  [signal]}}\label{classKScanDialog_l0}


Informs you that an image has been previewed. 

\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} \&, 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. \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} \&, 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. 

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