KTextAddons

bergamotengineclient.h
1/*
2 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "bergamotengineutils.h"
10
11#include <TextTranslator/TranslatorEngineClient>
12
13class BergamotEngineClient : public TextTranslator::TranslatorEngineClient
14{
16 Q_PLUGIN_METADATA(IID "org.kde.Translator.bergamot")
17 Q_INTERFACES(TextTranslator::TranslatorEngineClient)
18public:
19 explicit BergamotEngineClient(QObject *parent = nullptr);
20 ~BergamotEngineClient() override;
21
22 [[nodiscard]] QString name() const override;
23 [[nodiscard]] QString translatedName() const override;
24 [[nodiscard]] TextTranslator::TranslatorEnginePlugin *createTranslator() override;
25 [[nodiscard]] QMap<TextTranslator::TranslatorUtil::Language, QString> supportedFromLanguages() override;
26 [[nodiscard]] QMap<TextTranslator::TranslatorUtil::Language, QString> supportedToLanguages() override;
27
28 [[nodiscard]] bool hasConfigurationDialog() const override;
29
30 [[nodiscard]] bool showConfigureDialog(QWidget *parentWidget) override;
31
32 [[nodiscard]] bool hasInvertSupport() const override;
33
34 void generateToListFromCurrentToLanguage(const QString &languageCode) override;
35
36 [[nodiscard]] TextTranslator::TranslatorEngineClient::EngineType engineType() const override;
37
38 void updateListLanguages() override;
39
40protected:
41 [[nodiscard]] bool isSupported(TextTranslator::TranslatorUtil::Language lang) const override;
42
43private:
44 void updateInstalledLanguage();
45 void updateFromLanguageList();
46 void updateToLanguageList();
49 QString mLanguageCode;
50};
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 18 2024 12:19:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.