summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-05-09 21:08:35 +0200
committerMontel Laurent <[email protected]>2016-05-09 21:08:35 +0200
commitcca1eaf6cbe3aa236d0457c7e7a144acf21e152b (patch)
tree2b4e4e70e49e89dea5d4e5aec12e36aadadf7070
parent3c80c57826ea6abb8cc99b4852b87274cdf68b53 (diff)
Start to implement print preview
-rw-r--r--webengineviewer/src/CMakeLists.txt13
-rw-r--r--webengineviewer/src/print/printpreviewdialog.cpp31
-rw-r--r--webengineviewer/src/print/printpreviewdialog.h34
3 files changed, 78 insertions, 0 deletions
diff --git a/webengineviewer/src/CMakeLists.txt b/webengineviewer/src/CMakeLists.txt
index aa816a1..6dafe0f 100644
--- a/webengineviewer/src/CMakeLists.txt
+++ b/webengineviewer/src/CMakeLists.txt
@@ -8,6 +8,17 @@ if(BUILD_TESTING)
add_subdirectory(findbar/autotests)
endif()
+find_package(Poppler "0.12.1" COMPONENTS Qt5)
+set_package_properties("Poppler" PROPERTIES
+ TYPE RECOMMENDED
+ PURPOSE "Support for print preview.")
+
+if (Poppler_Qt5_FOUND)
+ set(libwebengineviewer_print_SRCS
+ print/printpreviewdialog.cpp
+ )
+ set(poppler_lib Poppler::Qt5)
+endif()
set(libwebengineviewer_webengine_SRCS
networkmanager/networkaccessmanagerwebengine.cpp
@@ -40,6 +51,7 @@ set(libwebengineviewer_SRCS
${libwebengineviewer_webengine_SRCS}
${libwebengineviewer_findbar_SRCS}
${libwebengineviewer_widgets_SRCS}
+ ${libwebengineviewer_print_SRCS}
)
qt5_add_resources(libwebengineviewer_webengine_SRCS jquery.qrc)
@@ -63,6 +75,7 @@ target_link_libraries(KF5WebEngineViewer
KF5::Completion
KF5::I18n
KF5::PimCommon
+ ${poppler_lib}
)
set_target_properties(KF5WebEngineViewer PROPERTIES
diff --git a/webengineviewer/src/print/printpreviewdialog.cpp b/webengineviewer/src/print/printpreviewdialog.cpp
new file mode 100644
index 0000000..cbaadbb
--- /dev/null
+++ b/webengineviewer/src/print/printpreviewdialog.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (c) 2016 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License, version 2, as
+ published by the Free Software Foundation.
+
+ This program 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "printpreviewdialog.h"
+
+using namespace WebEngineViewer;
+
+PrintPreviewDialog::PrintPreviewDialog(QWidget *parent)
+ : QDialog(parent)
+{
+
+}
+
+PrintPreviewDialog::~PrintPreviewDialog()
+{
+
+}
diff --git a/webengineviewer/src/print/printpreviewdialog.h b/webengineviewer/src/print/printpreviewdialog.h
new file mode 100644
index 0000000..1124def
--- /dev/null
+++ b/webengineviewer/src/print/printpreviewdialog.h
@@ -0,0 +1,34 @@
+/*
+ Copyright (c) 2016 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License, version 2, as
+ published by the Free Software Foundation.
+
+ This program 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef PRINTPREVIEWDIALOG_H
+#define PRINTPREVIEWDIALOG_H
+
+#include <QDialog>
+
+namespace WebEngineViewer
+{
+class PrintPreviewDialog : public QDialog
+{
+ Q_OBJECT
+public:
+ explicit PrintPreviewDialog(QWidget *parent = Q_NULLPTR);
+ ~PrintPreviewDialog();
+};
+}
+
+#endif // PRINTPREVIEWDIALOG_H