org.kde.koala

Class KScanDialog

public class KScanDialog extends KDialogBase

This is a base class 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 KScanDialog.getScanDialog() to get an instance of the user's preferred scanning dialog. Typical usage looks like this (e.g. in a slotShowScanDialog() method):
 if ( !m_scanDialog ) {
     m_scanDialog = KScanDialog.getScanDialog( this, "scandialog" );
     if ( !m_scanDialog ) // no scanning support installed?
         return;
     connect( m_scanDialog, SIGNAL("finalImage( QImage, int )"),
              SLOT("slotScanned( QImage, int )"));
 }
 if ( m_scanDialog.setup() ) // only if scanner configured/available
     m_scanDialog.show();
 
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 KScanDialogFactory. See KScanDialogSignals for signals emitted by KScanDialog

Author: Carsten Pfeiffer

UNKNOWN: A baseclass and accessor for Scanning Dialogs.

Constructor Summary
protected KScanDialog(Class dummy)
KScanDialog(int dialogFace, int buttonMask, QWidget parent, String name, boolean modal)
Constructs the scan dialog.
KScanDialog(int dialogFace, int buttonMask, QWidget parent, String name)
KScanDialog(int dialogFace, int buttonMask, QWidget parent)
KScanDialog(int dialogFace, int buttonMask)
KScanDialog(int dialogFace)
KScanDialog()
Method Summary
StringclassName()
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
static KScanDialoggetScanDialog(QWidget parent, String name, boolean modal)
Creates the user's preferred scanning dialog and returns it, or null if no scan-support is available.
static KScanDialoggetScanDialog(QWidget parent, String name)
static KScanDialoggetScanDialog(QWidget parent)
static KScanDialoggetScanDialog()
protected intid()
Returns the current id for an image.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
QMetaObjectmetaObject()
protected intnextId()
Returns the id for the next image.
booleansetup()
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.

Constructor Detail

KScanDialog

protected KScanDialog(Class dummy)

KScanDialog

public KScanDialog(int dialogFace, int buttonMask, QWidget parent, String name, boolean modal)
Constructs the scan dialog. If you implement an own dialog, you can customize it with the usual KDialogBase flags.

Parameters: dialogFace the KDialogBase.DialogType buttonMask a ORed mask of all buttons (see KDialogBase.ButtonCode) parent the QWidget's parent, or 0 name the name of the QObject, can be 0 modal if true the dialog is model

See Also: KDialogBase

UNKNOWN: Constructs the scan dialog.

KScanDialog

public KScanDialog(int dialogFace, int buttonMask, QWidget parent, String name)

KScanDialog

public KScanDialog(int dialogFace, int buttonMask, QWidget parent)

KScanDialog

public KScanDialog(int dialogFace, int buttonMask)

KScanDialog

public KScanDialog(int dialogFace)

KScanDialog

public KScanDialog()

Method Detail

className

public String className()

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

finalize

protected void finalize()
Deletes the wrapped C++ instance

getScanDialog

public static KScanDialog getScanDialog(QWidget parent, String name, boolean modal)
Creates the user's preferred scanning dialog and returns it, or null if no scan-support is available. Pass a suitable parent widget, if you like. If you don't you have to 'delete' the returned pointer yourself.

Parameters: parent the QWidget's parent, or 0 name the name of the QObject, can be 0 modal if true the dialog is model

Returns: the KScanDialog, or 0 if the function failed

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

getScanDialog

public static KScanDialog getScanDialog(QWidget parent, String name)

getScanDialog

public static KScanDialog getScanDialog(QWidget parent)

getScanDialog

public static KScanDialog getScanDialog()

id

protected int id()
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.

Returns: the current id for the image

See Also: KScanDialog KScanDialog KScanDialog KScanDialog

UNKNOWN: Returns the current id for an image.

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

metaObject

public QMetaObject metaObject()

nextId

protected int nextId()
Returns the id for the next image. You can use that in your subclass for the signals.

Returns: the id for the next image

See Also: KScanDialog KScanDialog KScanDialog KScanDialog

UNKNOWN: Returns the id for the next image.

setup

public boolean setup()
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.

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