File indexing completed on 2024-12-22 04:28:22

0001 /*
0002   SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 #include "libvoskspeechtotext_private_export.h"
0009 
0010 #include "voskengineutils.h"
0011 #include <QObject>
0012 
0013 class LIBVOSKSPEECHTOTEXT_TESTS_EXPORT GenerateInstalledLanguageInfoJob : public QObject
0014 {
0015     Q_OBJECT
0016 public:
0017     struct LIBVOSKSPEECHTOTEXT_TESTS_EXPORT LanguageInfo {
0018         VoskEngineUtils::LanguageInstalled info;
0019         QString pathToStore;
0020         [[nodiscard]] bool isValid() const;
0021     };
0022     explicit GenerateInstalledLanguageInfoJob(QObject *parent = nullptr);
0023     ~GenerateInstalledLanguageInfoJob() override;
0024 
0025     void start();
0026     [[nodiscard]] bool canStart() const;
0027 
0028     [[nodiscard]] GenerateInstalledLanguageInfoJob::LanguageInfo info() const;
0029     void setInfo(const GenerateInstalledLanguageInfoJob::LanguageInfo &newInfo);
0030 
0031 Q_SIGNALS:
0032     void generatedDone();
0033     void errorText(const QString &str);
0034 
0035 private:
0036     GenerateInstalledLanguageInfoJob::LanguageInfo mInfo;
0037 };
0038 LIBVOSKSPEECHTOTEXT_EXPORT QDebug operator<<(QDebug d, const GenerateInstalledLanguageInfoJob::LanguageInfo &t);