Messagelib

richtextcomposerng.h
1 /*
2  SPDX-FileCopyrightText: 2015-2021 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 
16 namespace PimCommon
17 {
18 class AutoCorrection;
19 }
20 
21 namespace MessageComposer
22 {
23 class TextPart;
24 class RichTextComposerSignatures;
25 class RichTextComposerNgPrivate;
26 /**
27  * @brief The RichTextComposerNg class
28  * @author Laurent Montel <[email protected]>
29  */
30 class MESSAGECOMPOSER_EXPORT RichTextComposerNg : public KPIMTextEdit::RichTextComposer
31 {
32  Q_OBJECT
33 public:
34  explicit RichTextComposerNg(QWidget *parent = nullptr);
35  ~RichTextComposerNg() override;
36 
37  Q_REQUIRED_RESULT PimCommon::AutoCorrection *autocorrection() const;
38  void setAutocorrection(PimCommon::AutoCorrection *autocorrect);
39  void setAutocorrectionLanguage(const QString &lang);
40 
41  void fillComposerTextPart(MessageComposer::TextPart *textPart);
42  Q_REQUIRED_RESULT MessageComposer::RichTextComposerSignatures *composerSignature() const;
43 
44  void insertSignature(const KIdentityManagement::Signature &signature,
47  Q_REQUIRED_RESULT QString toCleanHtml() const;
48 
49  void forceAutoCorrection(bool selectedText = false) override;
50 
51  Q_REQUIRED_RESULT virtual MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus convertPlainText(MessageComposer::TextPart *textPart);
52 
53 protected:
54  bool processModifyText(QKeyEvent *event) override;
55 
56 private:
57  std::unique_ptr<RichTextComposerNgPrivate> const d;
58 
59  friend class ::RichTextComposerNgTest; // for fixHtmlFontSize
60  void fixHtmlFontSize(QString &cleanHtml) const;
61 };
62 }
The RichTextComposerNg class.
The RichTextComposerSignatures class.
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
The TextPart class.
Definition: textpart.h:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Dec 4 2021 23:12:54 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.