File indexing completed on 2025-01-26 04:57:25

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "webengineviewer_export.h"
0010 #include <QObject>
0011 class QWebEngineView;
0012 namespace WebEngineViewer
0013 {
0014 /**
0015  * @brief The WebEngineExportHtmlPageJob class
0016  * @author Laurent Montel <montel@kde.org>
0017  */
0018 class WEBENGINEVIEWER_EXPORT WebEngineExportHtmlPageJob : public QObject
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit WebEngineExportHtmlPageJob(QObject *parent = nullptr);
0023     ~WebEngineExportHtmlPageJob() override;
0024 
0025     void start();
0026 
0027     [[nodiscard]] QWebEngineView *engineView() const;
0028     void setEngineView(QWebEngineView *engineView);
0029 
0030 Q_SIGNALS:
0031     void failed();
0032     void success(const QString &filename);
0033 
0034 private:
0035     WEBENGINEVIEWER_NO_EXPORT void slotSaveHtmlToPage(const QString &text);
0036     QWebEngineView *mEngineView = nullptr;
0037 };
0038 }