Commit 5586de4b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to implmement export as pdf

parent bbdc8b58
cmake_minimum_required(VERSION 3.5)
set(PIM_VERSION "5.13.58")
set(PIM_VERSION "5.13.59")
if (POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
......
......@@ -23,6 +23,7 @@ set(libwebengineviewer_webengine_SRCS
webenginemanagescript.cpp
webengineexporthtmlpagejob.cpp
webenginenavigationrequestinterceptor.cpp
webengineexportpdfpagejob.cpp
)
set(libwebengineviewer_checkphishingurl_SRCS
......@@ -169,6 +170,7 @@ ecm_generate_headers(WebEngineViewer_Camelcasewebengine_misc_HEADERS
WebEngineScript
WebEngineManageScript
WebEngineExportHtmlPageJob
WebEngineExportPdfPageJob
REQUIRED_HEADERS WebEngineViewer_webengine_misc_HEADERS
PREFIX WebEngineViewer
RELATIVE
......
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "webengineexportpdfpagejob.h"
#include "webengineviewer_debug.h"
using namespace WebEngineViewer;
WebEngineExportPdfPageJob::WebEngineExportPdfPageJob(QObject *parent)
: QObject(parent)
{
}
WebEngineExportPdfPageJob::~WebEngineExportPdfPageJob()
{
}
void WebEngineExportPdfPageJob::start()
{
if (!mWebEngineView) {
qCWarning(WEBENGINEVIEWER_LOG) << "webengineview not defined! It's a bug";
return;
}
}
QWebEngineView *WebEngineExportPdfPageJob::engineView() const
{
return mWebEngineView;
}
void WebEngineExportPdfPageJob::setEngineView(QWebEngineView *engineView)
{
mWebEngineView = engineView;
}
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef WEBENGINEEXPORTPDFPAGEJOB_H
#define WEBENGINEEXPORTPDFPAGEJOB_H
#include <QObject>
#include "webengineviewer_export.h"
class QWebEngineView;
namespace WebEngineViewer {
/**
* @brief The WebEngineExportHtmlPageJob class
* @author Laurent Montel <montel@kde.org>
*/
class WEBENGINEVIEWER_EXPORT WebEngineExportPdfPageJob : public QObject
{
Q_OBJECT
public:
explicit WebEngineExportPdfPageJob(QObject *parent = nullptr);
~WebEngineExportPdfPageJob();
void start();
Q_REQUIRED_RESULT QWebEngineView *engineView() const;
void setEngineView(QWebEngineView *engineView);
private:
QWebEngineView *mWebEngineView = nullptr;
};
}
#endif // WEBENGINEEXPORTPDFPAGEJOB_H
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