Messagelib

textpart.h
1/*
2 SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
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
15namespace MessageComposer
16{
17/**
18 * @brief The TextPart class
19 */
20class 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
37public:
38 explicit TextPart(QObject *parent = nullptr);
39 ~TextPart() override;
40
41 // default true
42 [[nodiscard]] bool isWordWrappingEnabled() const;
43 void setWordWrappingEnabled(bool enabled);
44 // default true
45 [[nodiscard]] bool warnBadCharset() const;
46 void setWarnBadCharset(bool warn);
47
48 [[nodiscard]] QString cleanPlainText() const;
49 void setCleanPlainText(const QString &text);
50 [[nodiscard]] QString wrappedPlainText() const;
51 void setWrappedPlainText(const QString &text);
52
53 [[nodiscard]] bool isHtmlUsed() const;
54 [[nodiscard]] QString cleanHtml() const;
55 void setCleanHtml(const QString &text);
56
57 [[nodiscard]] bool hasEmbeddedImages() const;
58 [[nodiscard]] KPIMTextEdit::ImageList embeddedImages() const;
59 void setEmbeddedImages(const KPIMTextEdit::ImageList &images);
60
61Q_SIGNALS:
62 void wordWrappingChanged();
63 void warnBadCharsetChanged();
64 void cleanPlainTextChanged();
65 void wrappedPlainTextChanged();
66 void cleanHtmlChanged();
67 void embeddedImagesChanged();
68
69private:
70 class TextPartPrivate;
71 std::unique_ptr<TextPartPrivate> const d;
72};
73} // namespace MessageComposer
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 Mon Nov 4 2024 16:33:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.