kio
kscan.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KSCAN_H
00021 #define KSCAN_H
00022
00023 #include <kdialogbase.h>
00024 #include <kinstance.h>
00025 #include <klibloader.h>
00026
00027 class QImage;
00028
00063 class KIO_EXPORT KScanDialog : public KDialogBase
00064 {
00065 Q_OBJECT
00066
00067 public:
00078 static KScanDialog * getScanDialog( QWidget *parent=0L,
00079 const char *name=0, bool modal=false );
00083 ~KScanDialog();
00084
00093 virtual bool setup();
00094
00095 protected:
00108 KScanDialog( int dialogFace=Tabbed, int buttonMask = Close|Help,
00109 QWidget *parent=0L, const char *name=0, bool modal=false );
00110
00122 int id() const { return m_currentId; }
00123
00135 int nextId() { return ++m_currentId; }
00136
00137 signals:
00143 void preview( const QImage &img, int id );
00144
00154 void finalImage( const QImage &img, int id );
00155
00164 void textRecognized( const QString &text, int id );
00165
00166 private:
00167 int m_currentId;
00168
00169 protected:
00170 virtual void virtual_hook( int id, void* data );
00171 private:
00172 class KScanDialogPrivate;
00173 KScanDialogPrivate *d;
00174 };
00175
00176
00182 class KIO_EXPORT KScanDialogFactory : public KLibFactory
00183 {
00184 public:
00185 virtual ~KScanDialogFactory();
00186
00194 virtual KScanDialog * createDialog( QWidget *parent=0, const char *name=0,
00195 bool modal=false ) = 0;
00196
00197 protected:
00203 KScanDialogFactory( QObject *parent=0, const char *name=0 );
00204
00205 virtual QObject* createObject( QObject* parent = 0, const char* name = 0,
00206 const char* classname = "QObject",
00207 const QStringList &args = QStringList() );
00208
00209
00214 void setName( const QCString& instanceName ) {
00215 delete m_instance;
00216 m_instance = new KInstance( instanceName );
00217 }
00218
00223 KInstance *instance() const { return m_instance; }
00224
00225 private:
00226 KInstance *m_instance;
00227 protected:
00228 virtual void virtual_hook( int id, void* data );
00229 private:
00230 class KScanDialogFactoryPrivate* d;
00231 };
00232
00236 class KIO_EXPORT KOCRDialog : public KDialogBase
00237 {
00238 Q_OBJECT
00239
00240 public:
00251 static KOCRDialog * getOCRDialog( QWidget *parent=0L,
00252 const char *name=0, bool modal=false );
00253 ~KOCRDialog();
00254
00255 protected:
00267 KOCRDialog( int dialogFace=Tabbed, int buttonMask = Close|Help,
00268 QWidget *parent=0L, const char *name=0, bool modal=false );
00269
00279 int id() const { return m_currentId; }
00280
00289 int nextId() { return ++m_currentId; }
00290
00291 signals:
00300 void textRecognized( const QString &text, int id );
00301
00302 private:
00303 int m_currentId;
00304
00305 protected:
00306 virtual void virtual_hook( int id, void* data );
00307 private:
00308 class KOCRDialogPrivate;
00309 KOCRDialogPrivate *d;
00310 };
00311
00312
00318 class KIO_EXPORT KOCRDialogFactory : public KLibFactory
00319 {
00320 public:
00321 virtual ~KOCRDialogFactory();
00322
00330 virtual KOCRDialog * createDialog( QWidget *parent=0, const char *name=0,
00331 bool modal=false ) = 0;
00332
00333 protected:
00339 KOCRDialogFactory( QObject *parent=0, const char *name=0 );
00340
00341 virtual QObject* createObject( QObject* parent = 0, const char* name = 0,
00342 const char* className = "QObject",
00343 const QStringList &args = QStringList() );
00344
00345
00350 void setName( const QCString& instanceName ) {
00351 delete m_instance;
00352 m_instance = new KInstance( instanceName );
00353 }
00354
00359 KInstance *instance() const { return m_instance; }
00360
00361 private:
00362 KInstance *m_instance;
00363 protected:
00364 virtual void virtual_hook( int id, void* data );
00365 private:
00366 class KOCRDialogFactory* d;
00367 };
00368
00369
00370 #endif // KSCAN_H