8#include "converthtmltoplaintext.h"
10#include <KPIMTextEdit/MarkupDirector>
11#include <KPIMTextEdit/PlainTextMarkupBuilder>
12#include <QTextDocument>
14using namespace MimeTreeParser;
15ConvertHtmlToPlainText::ConvertHtmlToPlainText() =
default;
17ConvertHtmlToPlainText::~ConvertHtmlToPlainText() =
default;
19void ConvertHtmlToPlainText::setHtmlString(
const QString &htmlString)
21 mHtmlString = htmlString;
24QString ConvertHtmlToPlainText::generatePlainText()
29 auto pb =
new KPIMTextEdit::PlainTextMarkupBuilder();
35 pmd->processDocument(doc);
36 QString plainText = pb->getResult();
41 toCleanPlainText(plainText);
45QString ConvertHtmlToPlainText::htmlString()
const
51void ConvertHtmlToPlainText::toCleanPlainText(
QString &text)
58 text.remove(
QChar(0xFFFC));
bool isEmpty() const const
void setHtml(const QString &html)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:13 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.