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

0001 /*
0002   SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <TextTranslator/TranslatorEnginePlugin>
0010 #include <TextTranslator/TranslatorUtil>
0011 class QNetworkReply;
0012 class GoogleEnginePlugin : public TextTranslator::TranslatorEnginePlugin
0013 {
0014 public:
0015     explicit GoogleEnginePlugin(QObject *parent = nullptr);
0016     ~GoogleEnginePlugin() override;
0017 
0018     void translate() override;
0019 
0020     [[nodiscard]] QString languageCode(const QString &langStr) override;
0021 
0022 private:
0023     void slotTranslateFinished(QNetworkReply *reply);
0024     QString mJsonData;
0025     QString mResult;
0026 };