KTextAddons

libretranslateengineplugin.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 LibreTranslateEnginePlugin : public TextTranslator::TranslatorEnginePlugin
15{
17public:
18 explicit LibreTranslateEnginePlugin(QObject *parent = nullptr);
19 ~LibreTranslateEnginePlugin() override;
20
21 void translate() override;
22
23 void slotConfigureChanged();
24
25private:
26 void loadSettings();
27 void parseTranslation(QNetworkReply *reply);
28 void slotApiKeyRead(QKeychain::Job *baseJob);
29 void translateText();
30 QString mServerUrl;
31 QString mResult;
32 QString mApiKey;
33 bool mRequiredApiKey = false;
34};
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.