File indexing completed on 2025-01-19 03:52:37

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2022-08-26
0007  * Description : Text Converter threads manager
0008  *
0009  * SPDX-FileCopyrightText: 2012      by Smit Mehta <smit dot meh at gmail dot com>
0010  * SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_TEXT_CONVERTER_THREAD_H
0017 #define DIGIKAM_TEXT_CONVERTER_THREAD_H
0018 
0019 // Qt includes
0020 
0021 #include <QUrl>
0022 
0023 // Local includes
0024 
0025 #include "ocroptions.h"
0026 #include "actionthreadbase.h"
0027 #include "textconverteraction.h"
0028 
0029 using namespace Digikam;
0030 
0031 namespace DigikamGenericTextConverterPlugin
0032 {
0033 
0034 class TextConverterActionThread : public ActionThreadBase
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039 
0040     explicit TextConverterActionThread(QObject* const parent);
0041     ~TextConverterActionThread();
0042 
0043     OcrOptions ocrOptions() const;
0044     void setOcrOptions(const OcrOptions& opt);
0045 
0046     void ocrProcessFile(const QUrl& url);
0047     void ocrProcessFiles(const QList<QUrl>& urlList);
0048 
0049     void cancel();
0050 
0051 Q_SIGNALS:
0052 
0053     void signalStarting(const DigikamGenericTextConverterPlugin::TextConverterActionData& ad);
0054     void signalFinished(const DigikamGenericTextConverterPlugin::TextConverterActionData& ad);
0055 
0056     /**
0057      * Signal emitted to sub-tasks for cancel processing.
0058      */
0059     void signalCancelTextConverterTask();
0060 
0061 private:
0062 
0063     class Private;
0064     Private* const d;
0065 };
0066 
0067 } // namespace DigikamGenericTextConverterPlugin
0068 
0069 #endif // DIGIKAM_TEXT_CONVERTER_THREAD_H