KTextAddons

grammarresulttextedit.h
1/*
2 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "grammarerror.h"
10#include "textgrammarcheck_export.h"
11#include <QTextEdit>
12namespace TextGrammarCheck
13{
14class GrammarAction;
15class TEXTGRAMMARCHECK_EXPORT GrammarResultTextEdit : public QTextEdit
16{
17 Q_OBJECT
18public:
19 explicit GrammarResultTextEdit(QWidget *parent = nullptr);
20 ~GrammarResultTextEdit() override;
21
22 void applyGrammarResult(const QVector<GrammarError> &infos);
23
24protected:
25 void contextMenuEvent(QContextMenuEvent *event) override;
26
27 void paintEvent(QPaintEvent *event) override;
28
29 bool event(QEvent *ev) override;
30Q_SIGNALS:
31 void replaceText(const TextGrammarCheck::GrammarAction &act);
32 void checkAgain();
33 void closeChecker();
34 void configure();
35
36private:
37 Q_DISABLE_COPY(GrammarResultTextEdit)
38 TEXTGRAMMARCHECK_NO_EXPORT void slotReplaceWord(const TextGrammarCheck::GrammarAction &act, const QString &replacementWord);
39 TEXTGRAMMARCHECK_NO_EXPORT void slotOpenGrammarUrlInfo(const QString &url);
40 TEXTGRAMMARCHECK_NO_EXPORT void generalPaletteChanged();
41 QColor mTextColor;
42 QColor mNegativeTextColor;
43};
44}
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
KGuiItem configure()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:48:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.