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
|
|
|
|
|
2017-06-15 17:27:56 +02:00
|
|
|
#include <map>
|
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.
|
2015-10-12 22:45:14 +02:00
|
|
|
void OnPrintStart(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
2017-06-15 17:27:56 +02:00
|
|
|
void OnPrintSettings(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefPrintSettings> settings,
|
2015-01-23 21:03:47 +01:00
|
|
|
bool get_defaults) OVERRIDE;
|
2017-06-15 17:27:56 +02:00
|
|
|
bool OnPrintDialog(CefRefPtr<CefBrowser> browser,
|
|
|
|
bool has_selection,
|
2017-05-17 11:29:28 +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,
|
|
|
|
CefRefPtr<CefPrintJobCallback> callback) OVERRIDE;
|
2017-06-15 17:27:56 +02:00
|
|
|
void OnPrintReset(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
2017-06-17 11:46:18 +02:00
|
|
|
CefSize GetPdfPaperSize(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;
|
|
|
|
PrintHandler* GetPrintHandler(CefRefPtr<CefBrowser> browser);
|
2014-07-10 17:41:30 +02:00
|
|
|
|
2017-06-15 17:27:56 +02:00
|
|
|
// Map of browser ID to print handler.
|
|
|
|
typedef std::map<int, PrintHandler*> PrintHandlerMap;
|
|
|
|
PrintHandlerMap print_handler_map_;
|
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_
|