KTextAddons

translatorengineloader.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_export.h"
10#include <QObject>
11#include <TextTranslator/TranslatorUtil>
12#include <memory>
13namespace TextTranslator
14{
15class TranslatorEngineLoaderPrivate;
16class TranslatorEngineClient;
17class TEXTTRANSLATOR_EXPORT TranslatorEngineLoader : public QObject
18{
19 Q_OBJECT
20public:
21 static TranslatorEngineLoader *self();
22
23 explicit TranslatorEngineLoader(QObject *parent = nullptr);
24 ~TranslatorEngineLoader() override;
25
26 [[nodiscard]] TextTranslator::TranslatorEngineClient *createTranslatorClient(const QString &clientName);
27
28 // engine name, i18n
29 [[nodiscard]] QMap<QString, QString> translatorEngineInfos() const;
30
31 [[nodiscard]] QString currentPluginName(const QString &key) const;
32
33 [[nodiscard]] QMap<TextTranslator::TranslatorUtil::Language, QString> supportedFromLanguages(const QString &clientName) const;
34 [[nodiscard]] QMap<TextTranslator::TranslatorUtil::Language, QString> supportedToLanguages(const QString &clientName) const;
35
36 [[nodiscard]] bool hasConfigurationDialog(const QString &clientName) const;
37
38 [[nodiscard]] QString fallbackFirstEngine() const;
39
40 [[nodiscard]] bool showConfigureDialog(const QString &clientName, QWidget *parentWidget);
41
42Q_SIGNALS:
43 void loadingTranslatorFailed();
44
45private:
46 TEXTTRANSLATOR_NO_EXPORT void loadPlugins();
47 TEXTTRANSLATOR_NO_EXPORT void loadPlugin(const QString &pluginPath);
48 std::unique_ptr<TranslatorEngineLoaderPrivate> const d;
49};
50}
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.