File indexing completed on 2025-01-19 04:46:43
0001 /* 0002 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #pragma once 0007 0008 #include <MessageComposer/PluginEditorGrammarCustomToolsViewInterface> 0009 class KActionCollection; 0010 namespace TextGrammarCheck 0011 { 0012 class GrammalecteResultWidget; 0013 class GrammarAction; 0014 } 0015 class GrammalecteInterface : public MessageComposer::PluginEditorGrammarCustomToolsViewInterface 0016 { 0017 Q_OBJECT 0018 public: 0019 explicit GrammalecteInterface(KActionCollection *ac, QWidget *parent = nullptr); 0020 ~GrammalecteInterface() override; 0021 0022 [[nodiscard]] KToggleAction *action() const override; 0023 0024 private: 0025 Q_DISABLE_COPY(GrammalecteInterface) 0026 void slotReplaceText(const TextGrammarCheck::GrammarAction &act); 0027 void slotActivateGrammalecte(bool state); 0028 void createAction(KActionCollection *ac); 0029 void checkAgain(); 0030 void closeChecker(); 0031 TextGrammarCheck::GrammalecteResultWidget *const mGrammarResultWidget; 0032 KToggleAction *mAction = nullptr; 0033 };