File indexing completed on 2024-05-12 15:55:06
0001 /************************************************************************ 0002 * * 0003 * This file is part of Kooka, a scanning/OCR application using * 0004 * Qt <http://www.qt.io> and KDE Frameworks <http://www.kde.org>. * 0005 * * 0006 * Copyright (C) 2000-2016 Klaas Freitag <freitag@suse.de> * 0007 * Jonathan Marten <jjm@keelhaul.me.uk> * 0008 * * 0009 * Kooka is free software; you can redistribute it and/or modify it * 0010 * under the terms of the GNU Library General Public License as * 0011 * published by the Free Software Foundation and appearing in the * 0012 * file COPYING included in the packaging of this file; either * 0013 * version 2 of the License, or (at your option) any later version. * 0014 * * 0015 * As a special exception, permission is given to link this program * 0016 * with any version of the KADMOS OCR/ICR engine (a product of * 0017 * reRecognition GmbH, Kreuzlingen), and distribute the resulting * 0018 * executable without including the source code for KADMOS in the * 0019 * source distribution. * 0020 * * 0021 * This program is distributed in the hope that it will be useful, * 0022 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0024 * GNU General Public License for more details. * 0025 * * 0026 * You should have received a copy of the GNU General Public * 0027 * License along with this program; see the file COPYING. If * 0028 * not, see <http://www.gnu.org/licenses/>. * 0029 * * 0030 ************************************************************************/ 0031 0032 #ifndef OCRGOCRENGINE_H 0033 #define OCRGOCRENGINE_H 0034 0035 #include "abstractocrengine.h" 0036 0037 class QTemporaryDir; 0038 0039 0040 class OcrGocrEngine : public AbstractOcrEngine 0041 { 0042 Q_OBJECT 0043 0044 public: 0045 explicit OcrGocrEngine(QObject *pnt, const QVariantList &args); 0046 ~OcrGocrEngine() override = default; 0047 0048 AbstractOcrDialogue *createOcrDialogue(AbstractOcrEngine *plugin, QWidget *pnt) override; 0049 0050 bool hasAdvancedSettings() const override { return (true); } 0051 void openAdvancedSettings() override; 0052 0053 protected: 0054 bool createOcrProcess(AbstractOcrDialogue *dia, ScanImage::Ptr img) override; 0055 QStringList tempFiles(bool retain) override; 0056 bool finishedOcrProcess(QProcess *proc) override; 0057 0058 protected slots: 0059 void slotGOcrStdout(); 0060 0061 private: 0062 QTemporaryDir *m_tempDir; 0063 QString m_inputFile; 0064 QString m_resultFile; 0065 }; 0066 0067 #endif // OCRGOCRENGINE_H