2014-07-10 17:41:30 +02:00
|
|
|
// Copyright (c) 2014 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2015-01-31 01:55:56 +01:00
|
|
|
#ifndef CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_
|
|
|
|
#define CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_
|
2014-07-10 17:41:30 +02:00
|
|
|
#pragma once
|
|
|
|
|
2021-03-30 18:49:17 +02:00
|
|
|
#include <memory>
|
2014-07-10 17:41:30 +02:00
|
|
|
|
|
|
|
#include "include/cef_print_handler.h"
|
|
|
|
|
2015-01-23 20:23:54 +01:00
|
|
|
namespace client {
|
|
|
|
|
2014-07-10 17:41:30 +02:00
|
|
|
class ClientPrintHandlerGtk : public CefPrintHandler {
|
|
|
|
public:
|
|
|
|
ClientPrintHandlerGtk();
|
2017-06-15 17:27:56 +02:00
|
|
|
virtual ~ClientPrintHandlerGtk();
|
2014-07-10 17:41:30 +02:00
|
|
|
|
2015-01-23 21:03:47 +01:00
|
|
|
// CefPrintHandler methods.
|
2021-06-17 21:43:06 +02:00
|
|
|
void OnPrintStart(CefRefPtr<CefBrowser> browser) override;
|
2017-06-15 17:27:56 +02:00
|
|
|
void OnPrintSettings(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefPrintSettings> settings,
|
2021-06-17 21:43:06 +02:00
|
|
|
bool get_defaults) override;
|
2017-06-15 17:27:56 +02:00
|
|
|
bool OnPrintDialog(CefRefPtr<CefBrowser> browser,
|
|
|
|
bool has_selection,
|
2021-06-17 21:43:06 +02:00
|
|
|
CefRefPtr<CefPrintDialogCallback> callback) override;
|
2017-06-15 17:27:56 +02:00
|
|
|
bool OnPrintJob(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& document_name,
|
2015-01-23 21:03:47 +01:00
|
|
|
const CefString& pdf_file_path,
|
2021-06-17 21:43:06 +02:00
|
|
|
CefRefPtr<CefPrintJobCallback> callback) override;
|
|
|
|
void OnPrintReset(CefRefPtr<CefBrowser> browser) override;
|
2021-03-30 18:16:51 +02:00
|
|
|
CefSize GetPdfPaperSize(CefRefPtr<CefBrowser> browser,
|
2021-06-17 21:43:06 +02:00
|
|
|
int device_units_per_inch) override;
|
2014-07-10 17:41:30 +02:00
|
|
|
|
|
|
|
private:
|
2017-06-15 17:27:56 +02:00
|
|
|
// Print handler.
|
|
|
|
struct PrintHandler;
|
2021-03-30 18:49:17 +02:00
|
|
|
std::unique_ptr<PrintHandler> print_handler_;
|
2014-07-10 17:41:30 +02:00
|
|
|
|
|
|
|
IMPLEMENT_REFCOUNTING(ClientPrintHandlerGtk);
|
2015-01-23 21:03:47 +01:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(ClientPrintHandlerGtk);
|
2014-07-10 17:41:30 +02:00
|
|
|
};
|
|
|
|
|
2015-01-23 20:23:54 +01:00
|
|
|
} // namespace client
|
2014-07-10 17:41:30 +02:00
|
|
|
|
2015-01-31 01:55:56 +01:00
|
|
|
#endif // CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_
|