Commit 8bd24b3c authored by Laurent Montel's avatar Laurent Montel 😁

Add more methods

parent 89b20b1e
......@@ -228,3 +228,38 @@ void MailWebEngineView::scrollPageUp(int percent)
scrollPageDown(-percent);
#endif
}
void MailWebEngineView::injectAttachments(const boost::function<QString()> &delayedHtml)
{
//TODO
#if 0
QWebElement doc = page()->currentFrame()->documentElement();
QWebElement injectionPoint = doc.findFirst(QStringLiteral("*#attachmentInjectionPoint"));
if (injectionPoint.isNull()) {
return;
}
const QString html = delayedHtml();
if (html.isEmpty()) {
return;
}
assert(injectionPoint.tagName().toLower() == QLatin1String("div"));
injectionPoint.setInnerXml(html)
#endif
}
bool MailWebEngineView::replaceInnerHtml(const QString &id, const boost::function<QString()> &delayedHtml)
{
#if 0
QWebElement doc = page()->currentFrame()->documentElement();
QWebElement tag = doc.findFirst(QLatin1String("*#") + id);
if (tag.isNull()) {
return false;
}
tag.setInnerXml(delayedHtml());
return true;
#endif
//TODO
return false;
}
......@@ -19,6 +19,7 @@
#define MAILWEBENGINE_H
#include "messageviewer_export.h"
#include <MessageViewer/WebEngineView>
#include <boost/function.hpp>
class KActionCollection;
namespace MessageViewer
{
......@@ -46,6 +47,8 @@ public:
void scrollToAnchor(const QString &anchor);
void scrollPageDown(int percent);
void scrollPageUp(int percent);
void injectAttachments(const boost::function<QString ()> &delayedHtml);
bool replaceInnerHtml(const QString &id, const boost::function<QString ()> &delayedHtml);
public Q_SLOTS:
void slotZoomChanged(qreal zoom);
void slotZoomTextOnlyChanged(bool b);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment