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 <KIdentityManagement/Signature>
11 #include <KPIMTextEdit/RichTextComposer>
12 #include <MessageComposer/PluginEditorConvertTextInterface>
13 
14 class RichTextComposerNgTest;
15 namespace TextAutoCorrection
16 {
17 class AutoCorrection;
18 }
19 
20 namespace MessageComposer
21 {
22 class TextPart;
23 class RichTextComposerSignatures;
24 class RichTextComposerNgPrivate;
25 /**
26  * @brief The RichTextComposerNg class
27  * @author Laurent Montel <[email protected]>
28  */
29 class MESSAGECOMPOSER_EXPORT RichTextComposerNg : public KPIMTextEdit::RichTextComposer
30 {
31  Q_OBJECT
32 public:
33  explicit RichTextComposerNg(QWidget *parent = nullptr);
34  ~RichTextComposerNg() override;
35  Q_REQUIRED_RESULT TextAutoCorrection::AutoCorrection *autocorrection() const;
36  void setAutocorrection(TextAutoCorrection::AutoCorrection *autocorrect);
37 
38  void setAutocorrectionLanguage(const QString &lang);
39 
40  void fillComposerTextPart(MessageComposer::TextPart *textPart);
41  Q_REQUIRED_RESULT MessageComposer::RichTextComposerSignatures *composerSignature() const;
42 
43  void insertSignature(const KIdentityManagement::Signature &signature,
46  Q_REQUIRED_RESULT QString toCleanHtml() const;
47 
48  void forceAutoCorrection(bool selectedText = false) override;
49 
50  Q_REQUIRED_RESULT virtual MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus convertPlainText(MessageComposer::TextPart *textPart);
51 
52 protected:
53  bool processModifyText(QKeyEvent *event) override;
54 
55 private:
56  std::unique_ptr<RichTextComposerNgPrivate> const d;
57 
58  friend class ::RichTextComposerNgTest; // for fixHtmlFontSize
59  void fixHtmlFontSize(QString &cleanHtml) const;
60 };
61 }
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 Sun Mar 26 2023 04:08:12 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.