2014-07-10 15:41:30 +00: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 00:55:56 +00:00
|
|
|
#ifndef CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_
|
|
|
|
#define CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_
|
2014-07-10 15:41:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-03-30 09:49:17 -07:00
|
|
|
#include <memory>
|
2014-07-10 15:41:30 +00:00
|
|
|
|
|
|
|
#include "include/cef_print_handler.h"
|
|
|
|
|
2015-01-23 19:23:54 +00:00
|
|
|
namespace client {
|
|
|
|
|
2014-07-10 15:41:30 +00:00
|
|
|
class ClientPrintHandlerGtk : public CefPrintHandler {
|
|
|
|
public:
|
|
|
|
ClientPrintHandlerGtk();
|
2017-06-15 08:27:56 -07:00
|
|
|
virtual ~ClientPrintHandlerGtk();
|
2014-07-10 15:41:30 +00:00
|
|
|
|
2015-01-23 20:03:47 +00:00
|
|
|
// CefPrintHandler methods.
|
2021-06-17 15:43:06 -04:00
|
|
|
void OnPrintStart(CefRefPtr<CefBrowser> browser) override;
|
2017-06-15 08:27:56 -07:00
|
|
|
void OnPrintSettings(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefPrintSettings> settings,
|
2021-06-17 15:43:06 -04:00
|
|
|
bool get_defaults) override;
|
2017-06-15 08:27:56 -07:00
|
|
|
bool OnPrintDialog(CefRefPtr<CefBrowser> browser,
|
|
|
|
bool has_selection,
|
2021-06-17 15:43:06 -04:00
|
|
|
CefRefPtr<CefPrintDialogCallback> callback) override;
|
2017-06-15 08:27:56 -07:00
|
|
|
bool OnPrintJob(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& document_name,
|
2015-01-23 20:03:47 +00:00
|
|
|
const CefString& pdf_file_path,
|
2021-06-17 15:43:06 -04:00
|
|
|
CefRefPtr<CefPrintJobCallback> callback) override;
|
|
|
|
void OnPrintReset(CefRefPtr<CefBrowser> browser) override;
|
2021-03-30 09:16:51 -07:00
|
|
|
CefSize GetPdfPaperSize(CefRefPtr<CefBrowser> browser,
|
2021-06-17 15:43:06 -04:00
|
|
|
int device_units_per_inch) override;
|
2014-07-10 15:41:30 +00:00
|
|
|
|
|
|
|
private:
|
2017-06-15 08:27:56 -07:00
|
|
|
// Print handler.
|
|
|
|
struct PrintHandler;
|
2021-03-30 09:49:17 -07:00
|
|
|
std::unique_ptr<PrintHandler> print_handler_;
|
2014-07-10 15:41:30 +00:00
|
|
|
|
|
|
|
IMPLEMENT_REFCOUNTING(ClientPrintHandlerGtk);
|
2015-01-23 20:03:47 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(ClientPrintHandlerGtk);
|
2014-07-10 15:41:30 +00:00
|
|
|
};
|
|
|
|
|
2015-01-23 19:23:54 +00:00
|
|
|
} // namespace client
|
2014-07-10 15:41:30 +00:00
|
|
|
|
2015-01-31 00:55:56 +00:00
|
|
|
#endif // CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_
|