Messagelib

webengineparthtmlwriter.h
1 /*
2  SPDX-FileCopyrightText: 2016-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 #pragma once
7 
8 #include "bufferedhtmlwriter.h"
9 #include <QObject>
10 
11 #include <QByteArray>
12 #include <QString>
13 class QTemporaryFile;
14 namespace MessageViewer
15 {
16 class MailWebEngineView;
17 }
18 
19 namespace MessageViewer
20 {
21 class WebEnginePartHtmlWriter : public QObject, public BufferedHtmlWriter
22 {
23  Q_OBJECT
24 public:
25  explicit WebEnginePartHtmlWriter(MailWebEngineView *view, QObject *parent = nullptr);
26  ~WebEnginePartHtmlWriter() override;
27 
28  void begin() override;
29  void end() override;
30  void reset() override;
31  void embedPart(const QByteArray &contentId, const QString &url) override;
32  void setExtraHead(const QString &str) override;
33 
34  void setStyleBody(const QString &styleBody) override;
35 
36 Q_SIGNALS:
37  void finished();
38 
39 private:
40  void insertExtraHead();
41  void insertBodyStyle();
42 
43 private:
44  MailWebEngineView *const mHtmlView;
45  QString mExtraHead;
46  QString mStyleBody;
47  enum State { Begun, Queued, Ended } mState = Ended;
48  QTemporaryFile *mTempFile = nullptr;
49 };
50 }
Q_SIGNALSQ_SIGNALS
const QList< QKeySequence > & begin()
Q_OBJECTQ_OBJECT
const QList< QKeySequence > & end()
AKONADI_MIME_EXPORT const char Queued[]
KGuiItem reset()
State
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Dec 5 2021 23:04:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.