7#include "templateextracttextfrommail.h"
8#include "templateparser_debug.h"
9#include "templatewebenginepage.h"
11using namespace TemplateParser;
13template<
typename Arg,
typename R,
typename C>
16 void (C::*memberFun)(Arg);
17 void operator()(Arg result)
19 (receiver->*memberFun)(result);
23template<
typename Arg,
typename R,
typename C>
24InvokeWrapper<Arg, R, C> invoke(R *receiver,
void (C::*memberFun)(Arg))
26 InvokeWrapper<Arg, R, C> wrapper = {receiver, memberFun};
30TemplateExtractTextFromMail::TemplateExtractTextFromMail(
QObject *parent)
32 , mPage(new TemplateWebEnginePage(this))
34 connect(mPage, &TemplateWebEnginePage::loadFinished,
this, &TemplateExtractTextFromMail::slotLoadFinished);
37TemplateExtractTextFromMail::~TemplateExtractTextFromMail() =
default;
39void TemplateExtractTextFromMail::setHtmlContent(
const QString &html)
41 mExtractedPlainText.
clear();
45void TemplateExtractTextFromMail::slotLoadFinished(
bool ok)
48 mPage->toPlainText(invoke(
this, &TemplateExtractTextFromMail::setPlainText));
50 qCWarning(TEMPLATEPARSER_LOG) <<
"Loading page failed";
51 Q_EMIT loadContentDone(
false);
55void TemplateExtractTextFromMail::setPlainText(
const QString &plainText)
57 mExtractedPlainText = plainText;
58 Q_EMIT loadContentDone(
true);
61QString TemplateExtractTextFromMail::plainText()
const
63 return mExtractedPlainText;
66#include "moc_templateextracttextfrommail.cpp"
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.