Messagelib

richtextcomposerng.h
1 /*
2  SPDX-FileCopyrightText: 2015-2023 Laurent Montel <[email protected]>
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 
14 class RichTextComposerNgTest;
15 namespace TextAutoCorrectionCore
16 {
17 class AutoCorrection;
18 }
19 namespace MessageComposer
20 {
21 class TextPart;
22 class RichTextComposerSignatures;
23 class RichTextComposerNgPrivate;
24 /**
25  * @brief The RichTextComposerNg class
26  * @author Laurent Montel <[email protected]>
27  */
28 class MESSAGECOMPOSER_EXPORT RichTextComposerNg : public KPIMTextEdit::RichTextComposer
29 {
30  Q_OBJECT
31 public:
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 
51 protected:
52  bool processModifyText(QKeyEvent *event) override;
53 
54 private:
55  std::unique_ptr<RichTextComposerNgPrivate> const d;
56 
57  friend class ::RichTextComposerNgTest; // for fixHtmlFontSize
58  void fixHtmlFontSize(QString &cleanHtml) const;
59 };
60 }
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
The RichTextComposerNg class.
The TextPart class.
Definition: textpart.h:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Dec 6 2023 03:56:41 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.