KTextAddons

deeplengineplugin.h
1/*
2 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <TextTranslator/TranslatorEnginePlugin>
10namespace QKeychain
11{
12class Job;
13}
14class DeeplEnginePlugin : public TextTranslator::TranslatorEnginePlugin
15{
17public:
18 explicit DeeplEnginePlugin(QObject *parent = nullptr);
19 ~DeeplEnginePlugin() override;
20
21 void translate() override;
22
23 void slotConfigureChanged();
24
25protected:
26 [[nodiscard]] QString languageCode(const QString &langStr) override;
27
28private:
29 void loadSettings();
30 void translateText();
31 void parseTranslation(QNetworkReply *reply);
32 void slotApiKeyRead(QKeychain::Job *baseJob);
33 QString mServerUrl;
34 QString mResult;
35 // TODO load it ? kwallet ?
36 QString mApiKey;
37 bool mUseFreeLicense = false;
38};
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.