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

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 OCROCRADENGINE_H
0027 #define OCROCRADENGINE_H
0028 
0029 #include "abstractocrengine.h"
0030 
0031 
0032 class OcrOcradEngine : public AbstractOcrEngine
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037     explicit OcrOcradEngine(QObject *pnt, const QVariantList &args);
0038     ~OcrOcradEngine() override = default;
0039 
0040     AbstractOcrDialogue *createOcrDialogue(AbstractOcrEngine *plugin, QWidget *pnt) override;
0041 
0042     bool hasAdvancedSettings() const override           { return (true); }
0043     void openAdvancedSettings() override;
0044 
0045 protected:
0046     bool createOcrProcess(AbstractOcrDialogue *dia, ScanImage::Ptr img) override;
0047     QStringList tempFiles(bool retain) override;
0048     bool finishedOcrProcess(QProcess *proc) override;
0049 
0050 private:
0051     QString readORF(const QString &fileName);
0052 
0053 private:
0054     QString m_ocrImagePBM;
0055     QString m_tempOrfName;
0056     QString m_tempStdoutLog;
0057 
0058     int ocradVersion;
0059 };
0060 
0061 #endif                          // OCROCRADENGINE_H