Messagelib

webengineparthtmlwriter.h
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
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>
13class QTemporaryFile;
14namespace MessageViewer
15{
16class MailWebEngineView;
17}
18
19namespace MessageViewer
20{
21class WebEnginePartHtmlWriter : public QObject, public BufferedHtmlWriter
22{
24public:
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
37 void finished();
38
39private:
40 void insertExtraHead();
41 void insertBodyStyle();
42
43 MailWebEngineView *const mHtmlView;
44 QString mExtraHead;
45 QString mStyleBody;
46 enum State {
47 Begun,
48 Queued,
49 Ended
50 } mState = Ended;
51 QTemporaryFile *mTempFile = nullptr;
52};
53}
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.