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.
|
|
|
|
|
2015-05-11 12:57:07 +00:00
|
|
|
#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 {
|
2016-04-14 08:15:20 +00:00
|
|
|
|
2018-06-25 20:30:00 +00:00
|
|
|
struct PdfRenderSettings;
|
2015-04-30 03:31:17 +00:00
|
|
|
struct PwgRasterSettings;
|
|
|
|
struct PageRange;
|
|
|
|
|
|
|
|
// Dispatches IPCs for printing.
|
2015-05-11 12:57:07 +00:00
|
|
|
class PrintingHandlerWin : public UtilityMessageHandler {
|
2015-04-30 03:31:17 +00:00
|
|
|
public:
|
2015-05-11 12:57:07 +00:00
|
|
|
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_;
|
2016-04-14 08:15:20 +00:00
|
|
|
PdfRenderSettings pdf_rendering_settings_;
|
2015-04-30 03:31:17 +00:00
|
|
|
|
2015-05-11 12:57:07 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(PrintingHandlerWin);
|
2015-04-30 03:31:17 +00:00
|
|
|
};
|
|
|
|
|
2016-04-14 08:15:20 +00:00
|
|
|
} // namespace printing
|
|
|
|
|
2015-05-11 12:57:07 +00:00
|
|
|
#endif // CHROME_UTILITY_PRINTING_HANDLER_WIN_H_
|