File indexing completed on 2024-05-12 15:55:07

0001 /***************************************************** -*- mode:c++; -*- ***
0002                              -------------------
0003     begin                : Fri Jun 30 2000
0004     copyright            : (C) 2000 by Klaas Freitag
0005     email                : freitag@suse.de
0006  ***************************************************************************/
0007 
0008 /***************************************************************************
0009  *                                                                         *
0010  *  This file may be distributed and/or modified under the terms of the    *
0011  *  GNU General Public License version 2 as published by the Free Software *
0012  *  Foundation and appearing in the file COPYING included in the           *
0013  *  packaging of this file.                                                *
0014  *
0015  *  As a special exception, permission is given to link this program       *
0016  *  with any version of the KADMOS ocr/icr engine of reRecognition GmbH,   *
0017  *  Kreuzlingen and distribute the resulting executable without            *
0018  *  including the source code for KADMOS in the source distribution.       *
0019  *
0020  *  As a special exception, permission is given to link this program       *
0021  *  with any edition of Qt, and distribute the resulting executable,       *
0022  *  without including the source code for Qt in the source distribution.   *
0023  *                                                                         *
0024  ***************************************************************************/
0025 
0026 #ifndef OCRKADMOSENGINE_H
0027 #define OCRKADMOSENGINE_H
0028 
0029 #include "ocrengine.h"
0030 
0031 #ifdef HAVE_KADMOS
0032 #include "kadmosocr.h"
0033 #endif
0034 
0035 class OcrBaseDialog;
0036 
0037 class OcrKadmosEngine : public OcrEngine
0038 {
0039     Q_OBJECT
0040 
0041 public:
0042     explicit OcrKadmosEngine(QWidget *parent = nullptr);
0043     virtual ~OcrKadmosEngine();
0044 
0045     OcrBaseDialog *createOCRDialog(QWidget *parent) override;
0046 
0047     OcrEngine::EngineType engineType() const override;
0048     static QString engineDesc();
0049 
0050 protected:
0051     QStringList tempFiles(bool retain) override;
0052 
0053 protected slots:
0054     void slotKadmosResult();
0055 
0056 private:
0057     void startProcess(OcrBaseDialog *dia, const ScanImage *img) override;
0058 
0059 private:
0060     QString m_tmpFile;
0061 #ifdef HAVE_KADMOS
0062     Kadmos::CRep m_rep;
0063 #endif
0064 };
0065 
0066 #endif                          // OCRKADMOSENGINE_H