electron/chromium_src/chrome/utility/printing_handler_win.h

53 lines
1.5 KiB
C
Raw Normal View History

2015-04-30 03:31:17 +00:00
// Copyright 2014 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.
#ifndef CHROME_UTILITY_PRINTING_HANDLER_WIN_H_
#define CHROME_UTILITY_PRINTING_HANDLER_WIN_H_
2015-04-30 03:31:17 +00:00
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "chrome/utility/utility_message_handler.h"
#include "ipc/ipc_platform_file.h"
#include "printing/pdf_render_settings.h"
namespace printing {
2015-04-30 03:31:17 +00:00
class PdfRenderSettings;
struct PwgRasterSettings;
struct PageRange;
// Dispatches IPCs for printing.
class PrintingHandlerWin : public UtilityMessageHandler {
2015-04-30 03:31:17 +00:00
public:
PrintingHandlerWin();
~PrintingHandlerWin() override;
2015-04-30 03:31:17 +00:00
// IPC::Listener:
bool OnMessageReceived(const IPC::Message& message) override;
private:
// IPC message handlers.
void OnRenderPDFPagesToMetafile(IPC::PlatformFileForTransit pdf_transit,
2017-04-17 10:42:12 +00:00
const PdfRenderSettings& settings);
2015-04-30 03:31:17 +00:00
void OnRenderPDFPagesToMetafileGetPage(
int page_number,
IPC::PlatformFileForTransit output_file);
void OnRenderPDFPagesToMetafileStop();
int LoadPDF(base::File pdf_file);
bool RenderPdfPageToMetafile(int page_number,
base::File output_file,
2017-04-17 10:42:12 +00:00
float* scale_factor,
bool postscript);
2015-04-30 03:31:17 +00:00
std::vector<char> pdf_data_;
PdfRenderSettings pdf_rendering_settings_;
2015-04-30 03:31:17 +00:00
DISALLOW_COPY_AND_ASSIGN(PrintingHandlerWin);
2015-04-30 03:31:17 +00:00
};
} // namespace printing
#endif // CHROME_UTILITY_PRINTING_HANDLER_WIN_H_