Messagelib

textpart.h
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QString>
10 
11 #include "messagecomposer_export.h"
12 #include "messagepart.h"
13 #include <KPIMTextEdit/RichTextComposerImages>
14 
15 namespace MessageComposer
16 {
17 /**
18  * @brief The TextPart class
19  */
20 class MESSAGECOMPOSER_EXPORT TextPart : public MessagePart
21 {
22  Q_OBJECT
23 
24  /// True iff the text is word wrapped. By default: true.
25  Q_PROPERTY(bool isWordWrappingEnabled READ isWordWrappingEnabled WRITE setWordWrappingEnabled NOTIFY wordWrappingChanged)
26 
27  /// Default true.
28  Q_PROPERTY(bool warnBadCharset READ warnBadCharset WRITE setWarnBadCharset NOTIFY warnBadCharsetChanged)
29 
30  Q_PROPERTY(QString cleanPlainText READ cleanPlainText WRITE setCleanPlainText NOTIFY cleanPlainTextChanged)
31  Q_PROPERTY(QString wrappedPlainText READ wrappedPlainText WRITE setWrappedPlainText NOTIFY wrappedPlainTextChanged)
32  Q_PROPERTY(QString cleanHtml READ cleanHtml WRITE setCleanHtml NOTIFY cleanHtmlChanged)
33  Q_PROPERTY(bool isHtmlUsed READ isHtmlUsed NOTIFY cleanHtmlChanged)
34  Q_PROPERTY(bool hasEmbeddedImages READ hasEmbeddedImages NOTIFY embeddedImagesChanged)
35  Q_PROPERTY(KPIMTextEdit::ImageList embeddedImages READ embeddedImages WRITE setEmbeddedImages NOTIFY embeddedImagesChanged)
36 
37 public:
38  explicit TextPart(QObject *parent = nullptr);
39  ~TextPart() override;
40 
41  // default true
42  Q_REQUIRED_RESULT bool isWordWrappingEnabled() const;
43  void setWordWrappingEnabled(bool enabled);
44  // default true
45  Q_REQUIRED_RESULT bool warnBadCharset() const;
46  void setWarnBadCharset(bool warn);
47 
48  Q_REQUIRED_RESULT QString cleanPlainText() const;
49  void setCleanPlainText(const QString &text);
50  Q_REQUIRED_RESULT QString wrappedPlainText() const;
51  void setWrappedPlainText(const QString &text);
52 
53  Q_REQUIRED_RESULT bool isHtmlUsed() const;
54  Q_REQUIRED_RESULT QString cleanHtml() const;
55  void setCleanHtml(const QString &text);
56 
57  Q_REQUIRED_RESULT bool hasEmbeddedImages() const;
58  Q_REQUIRED_RESULT KPIMTextEdit::ImageList embeddedImages() const;
59  void setEmbeddedImages(const KPIMTextEdit::ImageList &images);
60 
61 Q_SIGNALS:
62  void wordWrappingChanged();
63  void warnBadCharsetChanged();
64  void cleanPlainTextChanged();
65  void wrappedPlainTextChanged();
66  void cleanHtmlChanged();
67  void embeddedImagesChanged();
68 
69 private:
70  class TextPartPrivate;
71  std::unique_ptr<TextPartPrivate> const d;
72 };
73 } // namespace MessageComposer
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-2022 The KDE developers.
Generated on Sat May 21 2022 03:53:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.