summaryrefslogtreecommitdiffstats
path: root/src/core/print_view_manager_qt.h
diff options
context:
space:
mode:
authorMichael Bruning <michael.bruning@theqtcompany.com>2016-02-25 13:40:01 +0100
committerMichael BrĂ¼ning <michael.bruning@theqtcompany.com>2016-03-16 21:21:41 +0000
commitdf222f8ccb2151e519b92d3d2046ee74f221902e (patch)
treede0e9af4a11878399698e383f0162feee48d0aa6 /src/core/print_view_manager_qt.h
parentec9a8753a7b17bbbf886c155ed884c581c547913 (diff)
Add callback to printing API
Also corrects and updates the printToPDF docs to reflect recent changes. Change-Id: Iffe276a1046d6d55923939f9d72b97cd533017ff Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/core/print_view_manager_qt.h')
-rw-r--r--src/core/print_view_manager_qt.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/print_view_manager_qt.h b/src/core/print_view_manager_qt.h
index 6ef7ec754..88a499f1b 100644
--- a/src/core/print_view_manager_qt.h
+++ b/src/core/print_view_manager_qt.h
@@ -80,11 +80,11 @@ class PrintViewManagerQt
{
public:
~PrintViewManagerQt() override;
-
+ typedef base::Callback<void(const std::vector<char> &result)> PrintToPDFCallback;
#if defined(ENABLE_BASIC_PRINTING)
// Method to print a page to a Pdf document with page size \a pageSize in location \a filePath.
bool PrintToPDF(const QPageLayout& pageLayout, const QString& filePath);
- bool PrintToPDFWithCallback(const QPageLayout& pageLayout, const QString& filePath, base::Callback<void(bool)> callback);
+ bool PrintToPDFWithCallback(const QPageLayout& pageLayout, const PrintToPDFCallback& callback);
#endif // ENABLE_BASIC_PRINTING
// PrintedPagesSource implementation.
@@ -108,8 +108,12 @@ protected:
void OnRequestPrintPreview(const PrintHostMsg_RequestPrintPreview_Params&);
void OnMetafileReadyForPrinting(const PrintHostMsg_DidPreviewDocument_Params& params);
+#if defined(ENABLE_BASIC_PRINTING)
+ bool PrintToPDFInternal(const QPageLayout &);
+#endif //
+
base::FilePath m_pdfOutputPath;
- base::Callback<void(bool)> m_pdfPrintCallback;
+ PrintToPDFCallback m_pdfPrintCallback;
private:
friend class content::WebContentsUserData<PrintViewManagerQt>;