kscan.h
/* This file is part of the KDE libraries
Copyright (C) 2001 Carsten Pfeiffer <pfeiffer@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KSCAN_H
#define KSCAN_H
#include <kdialogbase.h>
#include <kinstance.h>
#include <klibloader.h>
class QImage;
class KIO_EXPORT KScanDialog : public KDialogBase
{
Q_OBJECT
public:
static KScanDialog * getScanDialog( QWidget *parent=0L,
const char *name=0, bool modal=false );
~KScanDialog();
virtual bool setup();
protected:
KScanDialog( int dialogFace=Tabbed, int buttonMask = Close|Help,
QWidget *parent=0L, const char *name=0, bool modal=false );
int id() const { return m_currentId; }
int nextId() { return ++m_currentId; }
signals:
void preview( const QImage &img, int id );
void finalImage( const QImage &img, int id );
void textRecognized( const QString &text, int id );
private:
int m_currentId;
protected:
virtual void virtual_hook( int id, void* data );
private:
class KScanDialogPrivate;
KScanDialogPrivate *d;
};
class KIO_EXPORT KScanDialogFactory : public KLibFactory
{
public:
virtual ~KScanDialogFactory();
virtual KScanDialog * createDialog( QWidget *parent=0, const char *name=0,
bool modal=false ) = 0;
protected:
KScanDialogFactory( QObject *parent=0, const char *name=0 );
virtual QObject* createObject( QObject* parent = 0, const char* name = 0,
const char* classname = "QObject",
const QStringList &args = QStringList() );
void setName( const QCString& instanceName ) {
delete m_instance;
m_instance = new KInstance( instanceName );
}
KInstance *instance() const { return m_instance; }
private:
KInstance *m_instance;
protected:
virtual void virtual_hook( int id, void* data );
private:
class KScanDialogFactoryPrivate* d;
};
class KIO_EXPORT KOCRDialog : public KDialogBase
{
Q_OBJECT
public:
static KOCRDialog * getOCRDialog( QWidget *parent=0L,
const char *name=0, bool modal=false );
~KOCRDialog();
protected:
KOCRDialog( int dialogFace=Tabbed, int buttonMask = Close|Help,
QWidget *parent=0L, const char *name=0, bool modal=false );
int id() const { return m_currentId; }
int nextId() { return ++m_currentId; }
signals:
void textRecognized( const QString &text, int id );
private:
int m_currentId;
protected:
virtual void virtual_hook( int id, void* data );
private:
class KOCRDialogPrivate;
KOCRDialogPrivate *d;
};
class KIO_EXPORT KOCRDialogFactory : public KLibFactory
{
public:
virtual ~KOCRDialogFactory();
virtual KOCRDialog * createDialog( QWidget *parent=0, const char *name=0,
bool modal=false ) = 0;
protected:
KOCRDialogFactory( QObject *parent=0, const char *name=0 );
virtual QObject* createObject( QObject* parent = 0, const char* name = 0,
const char* className = "QObject",
const QStringList &args = QStringList() );
void setName( const QCString& instanceName ) {
delete m_instance;
m_instance = new KInstance( instanceName );
}
KInstance *instance() const { return m_instance; }
private:
KInstance *m_instance;
protected:
virtual void virtual_hook( int id, void* data );
private:
class KOCRDialogFactory* d;
};
#endif // KSCAN_H
KOCRDialog::id
int id() const
Returns the current id for an image.
Definition: kscan.h:279
KOCRDialogFactory
A factory for creating a KOCRDialog.
Definition: kscan.h:318
KOCRDialog
Base class for OCR Dialogs.
Definition: kscan.h:236
KScanDialog
This is a base class for scanning dialogs.
Definition: kscan.h:63
KOCRDialogFactory::instance
KInstance * instance() const
Returns the instance.
Definition: kscan.h:359
KScanDialogFactory::setName
void setName(const QCString &instanceName)
Creates a new instance with the given name.
Definition: kscan.h:214
KOCRDialogFactory::setName
void setName(const QCString &instanceName)
Creates a new instance with the given name.
Definition: kscan.h:350
KScanDialogFactory
A factory for creating a KScanDialog.
Definition: kscan.h:182
KScanDialog::id
int id() const
Returns the current id for an image.
Definition: kscan.h:122
KScanDialogFactory::instance
KInstance * instance() const
Returns the instance.
Definition: kscan.h:223
KScanDialog::nextId
int nextId()
Returns the id for the next image.
Definition: kscan.h:135
KOCRDialog::nextId
int nextId()
Returns the id for the next image.
Definition: kscan.h:289

KDE Home | KDE Accessibility Home | Description of Access Keys