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 thread
0008  *
0009  * SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2022      by Quoc Hung Tran <quochungtran1999 at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_TEXT_CONVERTER_TASK_H
0017 #define DIGIKAM_TEXT_CONVERTER_TASK_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 TextConverterTask : public ActionJob
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039 
0040     explicit TextConverterTask(QObject* const parent,
0041                               const QUrl& url,
0042                               const TextConverterAction& action);
0043     ~TextConverterTask();
0044 
0045     OcrOptions ocrOptions() const;
0046     void setOcrOptions(const OcrOptions& opt);
0047 
0048 Q_SIGNALS:
0049 
0050     void signalStarting(const DigikamGenericTextConverterPlugin::TextConverterActionData& ad);
0051     void signalFinished(const DigikamGenericTextConverterPlugin::TextConverterActionData& ad);
0052 
0053 public Q_SLOTS:
0054 
0055     void slotCancel();
0056 
0057 protected:
0058 
0059     void run();
0060 
0061 private:
0062 
0063     class Private;
0064     Private* const d;
0065 };
0066 
0067 } // namespace DigikamGenericTextConverterPlugin
0068 
0069 #endif // DIGIKAM_Text_CONVERTER_TASK_H