File indexing completed on 2024-11-24 04:16:54

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 
0009 #include "bergamotengineutils.h"
0010 
0011 #include <TextTranslator/TranslatorEnginePlugin>
0012 #include <TextTranslator/TranslatorUtil>
0013 class BergamotMarianInterface;
0014 class BergamotEnginePlugin : public TextTranslator::TranslatorEnginePlugin
0015 {
0016     Q_OBJECT
0017 public:
0018     explicit BergamotEnginePlugin(QObject *parent = nullptr);
0019     ~BergamotEnginePlugin() override;
0020 
0021     void translate() override;
0022 
0023     void slotConfigureChanged();
0024 
0025 private:
0026     void loadSettings();
0027     void slotLanguagesChanged();
0028     void updateBergamotModel();
0029     BergamotMarianInterface *const mBergamotInterface;
0030     QVector<BergamotEngineUtils::LanguageInstalled> mInstalledLanguages;
0031     BergamotEngineUtils::SettingsInfo mSettingInfo;
0032     QString mModelLanguageName;
0033 };