.TH "KScanDialog" 3 "28 Jan 2004" "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 &, int id)"
.br
.RI "\fIInforms you that an image has been previewed. \fP"
.ti -1c
.RI "void \fBfinalImage\fP (const  \fBQImage\fP &, int id)"
.br
.RI "\fIInforms you that an image has scanned. \fP"
.ti -1c
.RI "void \fBtextRecognized\fP (const  \fBQString\fP &, int id)"
.br
.RI "\fIInforms you that the image with the id \fCid\fP has been run through text-recognition. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fB~KScanDialog\fP ()"
.br
.RI "\fIDestructs the scan dialog. \fP"
.ti -1c
.RI "virtual bool \fBsetup\fP ()"
.br
.RI "\fIReimplement this if you need to set up some things, before showing the dialog, e.g. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKScanDialog\fP * \fBgetScanDialog\fP (\fBQWidget\fP *parent=0L, const  char *name=0, bool modal=false)"
.br
.RI "\fICreates the user's preferred scanning dialog and returns it, or 0L if no scan-support is available. \fP"
.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
.RI "\fIConstructs the scan dialog. \fP"
.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 = \fBKScanDialog::getScanDialog\fP( this, 'scandialog' );
     if ( !m_scanDialog ) // no scanning support installed?
         return;
.PP
.PP
.PP
.nf
     connect( m_scanDialog, SIGNAL( \fBfinalImage( const QImage&, int )\fP),
              SLOT( slotScanned( const QImage&, int ) ));
 }
.PP
.PP
.PP
.nf
 if ( m_scanDialog->\fBsetup()\fP ) // only if scanner configured/available
     m_scanDialog->\fBshow()\fP;
 
.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. Definition at line 58 of file kscan.cpp.
.SS "KScanDialog::KScanDialog (int dialogFace = Tabbed, int buttonMask = Close|Help, \fBQWidget\fP * parent = 0L, const char * name = 0, bool modal = false)\fC [protected]\fP"
.PP
Constructs the scan dialog. If you implement an own dialog, you can customize it with the usual \fBKDialogBase\fP flags.
.PP
\fBSee also:\fP
.RS 4
\fBKDialogBase\fP 
.RE
.PP
Definition at line 50 of file kscan.cpp.
.PP
References KStdAccel::name().
.SH "Member Function Documentation"
.PP 
.SS "\fBKScanDialog\fP * KScanDialog::getScanDialog (\fBQWidget\fP * parent = 0L, const char * name = 0, bool modal = false)\fC [static]\fP"
.PP
Creates the user's preferred scanning dialog and returns it, or 0L if no scan-support is available. Pass a suitable \fCparent\fP widget, if you like. If you don't you have to 'delete' the returned pointer yourself. Definition at line 28 of file kscan.cpp.
.PP
References QValueList::begin(), KLibFactory::create(), QFile::encodeName(), KLibLoader::factory(), QValueList::isEmpty(), KStdAccel::name(), QString::number(), KTrader::OfferList, 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. 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
Returns true by default. Definition at line 62 of file kscan.cpp.
.SS "int KScanDialog::id () const\fC [inline, protected]\fP"
.PP
\fBReturns:\fP
.RS 4
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.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBnextId\fP 
.PP
\fBfinalImage\fP 
.PP
\fBpreview\fP 
.PP
\fBtextRecognized\fP 
.RE
.PP
Definition at line 111 of file kscan.h.
.SS "int KScanDialog::nextId ()\fC [inline, protected]\fP"
.PP
\fBReturns:\fP
.RS 4
the id for the next image. You can use that in your subclass for the signals.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBid\fP 
.PP
\fBfinalImage\fP 
.PP
\fBpreview\fP 
.PP
\fBtextRecognized\fP 
.RE
.PP
Definition at line 123 of file kscan.h.
.SS "void KScanDialog::preview (const \fBQImage\fP &, int id)\fC [signal]\fP"
.PP
Informs you that an image has been previewed. 
.SS "void KScanDialog::finalImage (const \fBQImage\fP &, int id)\fC [signal]\fP"
.PP
Informs you that an image has scanned. \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. 
.SS "void KScanDialog::textRecognized (const \fBQString\fP &, int id)\fC [signal]\fP"
.PP
Informs you that the image with the id \fCid\fP has been run through text-recognition. The text is in the \fBQString\fP parameter. In the future, a compound document, using rich text will be used instead. 

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