Messagelib

richtextcomposerng.h
1/*
2 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messagecomposer_export.h"
10#include <KIdentityManagementCore/Signature>
11#include <KPIMTextEdit/RichTextComposer>
12#include <MessageComposer/PluginEditorConvertTextInterface>
13
14class RichTextComposerNgTest;
15namespace TextAutoCorrectionCore
16{
17class AutoCorrection;
18}
19namespace MessageComposer
20{
21class TextPart;
22class RichTextComposerSignatures;
23class RichTextComposerNgPrivate;
24/**
25 * @brief The RichTextComposerNg class
26 * @author Laurent Montel <montel@kde.org>
27 */
28class MESSAGECOMPOSER_EXPORT RichTextComposerNg : public KPIMTextEdit::RichTextComposer
29{
30 Q_OBJECT
31public:
32 explicit RichTextComposerNg(QWidget *parent = nullptr);
33 ~RichTextComposerNg() override;
34 [[nodiscard]] TextAutoCorrectionCore::AutoCorrection *autocorrection() const;
35 void setAutocorrection(TextAutoCorrectionCore::AutoCorrection *autocorrect);
36
37 void setAutocorrectionLanguage(const QString &lang);
38
39 void fillComposerTextPart(MessageComposer::TextPart *textPart);
40 [[nodiscard]] MessageComposer::RichTextComposerSignatures *composerSignature() const;
41
42 void insertSignature(const KIdentityManagementCore::Signature &signature,
45 [[nodiscard]] QString toCleanHtml() const;
46
47 void forceAutoCorrection(bool selectedText = false) override;
48
49 [[nodiscard]] virtual MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus convertPlainText(MessageComposer::TextPart *textPart);
50
51protected:
52 bool processModifyText(QKeyEvent *event) override;
53
54private:
55 std::unique_ptr<RichTextComposerNgPrivate> const d;
56
57 friend class ::RichTextComposerNgTest; // for fixHtmlFontSize
58 void fixHtmlFontSize(QString &cleanHtml) const;
59};
60}
The RichTextComposerNg class.
The TextPart class.
Definition textpart.h:21
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.