File indexing completed on 2025-01-19 04:46:56
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <MessageViewer/ViewerPluginInterface> 0010 class KActionCollection; 0011 namespace TextTranslator 0012 { 0013 class TranslatorWidget; 0014 } 0015 namespace MessageViewer 0016 { 0017 class ViewerPluginTranslatorInterface : public ViewerPluginInterface 0018 { 0019 Q_OBJECT 0020 public: 0021 explicit ViewerPluginTranslatorInterface(KActionCollection *ac, QWidget *parent = nullptr); 0022 ~ViewerPluginTranslatorInterface() override; 0023 0024 void setText(const QString &text) override; 0025 [[nodiscard]] QList<QAction *> actions() const override; 0026 void showWidget() override; 0027 [[nodiscard]] ViewerPluginInterface::SpecificFeatureTypes featureTypes() const override; 0028 0029 private: 0030 [[nodiscard]] TextTranslator::TranslatorWidget *widget(); 0031 void createAction(KActionCollection *ac); 0032 QList<QAction *> mAction; 0033 TextTranslator::TranslatorWidget *mTranslatorWidget = nullptr; 0034 }; 0035 }