.TH "KScanDialog" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KScanDialog \- This is a base class for scanning dialogs. A baseclass and accessor for Scanning Dialogs.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kscan.h>\fP
.PP
Inherits \fBKDialogBase\fP.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBpreview\fP (const \fBQImage\fP &img, int id)"
.br
.ti -1c
.RI "void \fBfinalImage\fP (const \fBQImage\fP &img, int id)"
.br
.ti -1c
.RI "void \fBtextRecognized\fP (const \fBQString\fP &text, int id)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fB~KScanDialog\fP ()"
.br
.ti -1c
.RI "virtual bool \fBsetup\fP ()"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBKScanDialog\fP * \fBgetScanDialog\fP (\fBQWidget\fP *parent=0L, const char *name=0, bool modal=false)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKScanDialog\fP (int dialogFace=Tabbed, int buttonMask=Close|Help, \fBQWidget\fP *parent=0L, const char *name=0, bool modal=false)"
.br
.ti -1c
.RI "int \fBid\fP () const "
.br
.ti -1c
.RI "int \fBnextId\fP ()"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
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.
.PP
Application developers that wish to add scanning support to their program can use the static method \fC\fBKScanDialog::getScanDialog()\fP\fP to get an instance of the user's preferred scanning dialog.
.PP
Typical usage looks like this (e.g. in a slotShowScanDialog() method):
.PP
.PP
.nf
 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();
.fi
.PP
.PP
This will create and show a non-modal scanning dialog. Connect to more signals if you like.
.PP
If you implement an own scan-dialog, you also have to implement a \fBKScanDialogFactory\fP.
.PP
\fBAuthor:\fP
.RS 4
Carsten Pfeiffer <pfeiffer@kde.org> 
.RE
.PP

.PP
Definition at line 63 of file kscan.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KScanDialog::~\fBKScanDialog\fP ()"
.PP
Destructs the scan dialog. 
.PP
Definition at line 58 of file kscan.cpp.
.SS "KScanDialog::KScanDialog (int dialogFace = \fCTabbed\fP, int buttonMask = \fCClose|Help\fP, \fBQWidget\fP * parent = \fC0L\fP, const char * name = \fC0\fP, bool modal = \fCfalse\fP)\fC [protected]\fP"
.PP
Constructs the scan dialog. 
.PP
If you implement an own dialog, you can customize it with the usual \fBKDialogBase\fP flags.
.PP
\fBParameters:\fP
.RS 4
\fIdialogFace\fP the \fBKDialogBase::DialogType\fP 
.br
\fIbuttonMask\fP a ORed mask of all buttons (see \fBKDialogBase::ButtonCode\fP) 
.br
\fIparent\fP the QWidget's parent, or 0 
.br
\fIname\fP the name of the \fBQObject\fP, can be 0 
.br
\fImodal\fP if true the dialog is model 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKDialogBase\fP 
.RE
.PP

.PP
Definition at line 50 of file kscan.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBKScanDialog\fP * KScanDialog::getScanDialog (\fBQWidget\fP * parent = \fC0L\fP, const char * name = \fC0\fP, bool modal = \fCfalse\fP)\fC [static]\fP"
.PP
Creates the user's preferred scanning dialog and returns it, or 0L if no scan-support is available. 
.PP
Pass a suitable \fCparent\fP widget, if you like. If you don't you have to 'delete' the returned pointer yourself. 
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP the QWidget's parent, or 0 
.br
\fIname\fP the name of the \fBQObject\fP, can be 0 
.br
\fImodal\fP if true the dialog is model 
.RE
.PP
\fBReturns:\fP
.RS 4
the KScanDialog, or 0 if the function failed 
.RE
.PP

.PP
Definition at line 28 of file kscan.cpp.
.PP
References QValueList::begin(), KLibFactory::create(), KLibLoader::factory(), QValueList::isEmpty(), QString::number(), KTrader::query(), KLibLoader::self(), and KTrader::self().
.SS "bool KScanDialog::setup ()\fC [virtual]\fP"
.PP
Reimplement this if you need to set up some things, before showing the dialog, e.g. 
.PP
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.
.PP
\fBReturns:\fP
.RS 4
true by default. 
.RE
.PP

.PP
Definition at line 62 of file kscan.cpp.
.SS "int KScanDialog::id () const\fC [inline, protected]\fP"
.PP
Returns the current id for an image. 
.PP
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.
.PP
\fBReturns:\fP
.RS 4
the current id for the image 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBnextId\fP 
.PP
\fBfinalImage\fP 
.PP
\fBpreview\fP 
.PP
\fBtextRecognized\fP 
.RE
.PP

.PP
Definition at line 122 of file kscan.h.
.SS "int KScanDialog::nextId ()\fC [inline, protected]\fP"
.PP
Returns the id for the next image. 
.PP
You can use that in your subclass for the signals.
.PP
\fBReturns:\fP
.RS 4
the id for the next image 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBid\fP 
.PP
\fBfinalImage\fP 
.PP
\fBpreview\fP 
.PP
\fBtextRecognized\fP 
.RE
.PP

.PP
Definition at line 135 of file kscan.h.
.SS "void KScanDialog::preview (const \fBQImage\fP & img, int id)\fC [signal]\fP"
.PP
Informs you that an image has been previewed. 
.PP
\fBParameters:\fP
.RS 4
\fIimg\fP the image 
.br
\fIid\fP the image's id 
.RE
.PP

.SS "void KScanDialog::finalImage (const \fBQImage\fP & img, int id)\fC [signal]\fP"
.PP
Informs you that an image has scanned. 
.PP
\fCid\fP is the same as in the \fC\fBpreview()\fP\fP signal, if this image had been previewed before.
.PP
Note, that those id's may not be properly implemented in the current libkscan. 
.PP
\fBParameters:\fP
.RS 4
\fIimg\fP the image 
.br
\fIid\fP the image's id 
.RE
.PP

.SS "void KScanDialog::textRecognized (const \fBQString\fP & text, int id)\fC [signal]\fP"
.PP
Informs you that the image with the id \fCid\fP has been run through text-recognition. 
.PP
The text is in the \fBQString\fP parameter. In the future, a compound document, using rich text will be used instead.
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the text that has been recognized 
.br
\fIid\fP the id of the image 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
