KTextAddons

libretranslateengineclient.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/TranslatorEngineClient>
10namespace QKeychain
11{
12class Job;
13}
14class LibreTranslateEngineClient : public TextTranslator::TranslatorEngineClient
15{
17 Q_PLUGIN_METADATA(IID "org.kde.Translator.libretranslate")
18 Q_INTERFACES(TextTranslator::TranslatorEngineClient)
19public:
20 explicit LibreTranslateEngineClient(QObject *parent = nullptr);
21 ~LibreTranslateEngineClient() override;
22
23 [[nodiscard]] QString name() const override;
24 [[nodiscard]] QString translatedName() const override;
25 [[nodiscard]] TextTranslator::TranslatorEnginePlugin *createTranslator() override;
26 [[nodiscard]] QMap<TextTranslator::TranslatorUtil::Language, QString> supportedFromLanguages() override;
27 [[nodiscard]] QMap<TextTranslator::TranslatorUtil::Language, QString> supportedToLanguages() override;
28
29 [[nodiscard]] bool hasConfigurationDialog() const override;
30 [[nodiscard]] bool showConfigureDialog(QWidget *parentWidget) override;
31 [[nodiscard]] TextTranslator::TranslatorEngineClient::EngineType engineType() const override;
32
33protected:
34 [[nodiscard]] bool isSupported(TextTranslator::TranslatorUtil::Language lang) const override;
35
36private:
37 void slotPasswordWritten(QKeychain::Job *baseJob);
38};
Q_INTERFACES(...)
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.