File indexing completed on 2025-02-16 04:49:31

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 LanguageToolResultWidget;
0013 class GrammarAction;
0014 }
0015 class LanguageToolInterface : public MessageComposer::PluginEditorGrammarCustomToolsViewInterface
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit LanguageToolInterface(KActionCollection *ac, QWidget *parent = nullptr);
0020     ~LanguageToolInterface() override;
0021 
0022     [[nodiscard]] KToggleAction *action() const override;
0023 
0024 private:
0025     Q_DISABLE_COPY(LanguageToolInterface)
0026     void slotReplaceText(const TextGrammarCheck::GrammarAction &act);
0027     void slotActivateGrammalecte(bool state);
0028     void createAction(KActionCollection *ac);
0029     void closeChecker();
0030     bool checkAgain();
0031     TextGrammarCheck::LanguageToolResultWidget *const mGrammarResultWidget;
0032     KToggleAction *mAction = nullptr;
0033 };