Revert of Create a new AccountTrackerService (patchset #8 of https://codereview.chrom...
[chromium-blink-merge.git] / chrome / common / chrome_utility_printing_messages.h
blob876d4af3cc0cdaae4d428f58cf2767e4bd1c705b
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Multiply-included message file, so no include guard.
7 #include <string>
8 #include <vector>
10 #include "ipc/ipc_message_macros.h"
11 #include "ipc/ipc_platform_file.h"
12 #include "printing/backend/print_backend.h"
13 #include "printing/page_range.h"
14 #include "printing/pdf_render_settings.h"
15 #include "printing/pwg_raster_settings.h"
17 #if !defined(ENABLE_FULL_PRINTING)
18 #error "Full printing must be enabled"
19 #endif
21 #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart
23 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults)
24 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities)
25 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type)
26 IPC_STRUCT_TRAITS_MEMBER(printer_defaults)
27 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type)
28 IPC_STRUCT_TRAITS_END()
30 IPC_ENUM_TRAITS_MAX_VALUE(printing::ColorModel, printing::PROCESSCOLORMODEL_RGB)
32 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults::Paper)
33 IPC_STRUCT_TRAITS_MEMBER(display_name)
34 IPC_STRUCT_TRAITS_MEMBER(vendor_id)
35 IPC_STRUCT_TRAITS_MEMBER(size_um)
36 IPC_STRUCT_TRAITS_END()
38 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults)
39 IPC_STRUCT_TRAITS_MEMBER(collate_capable)
40 IPC_STRUCT_TRAITS_MEMBER(collate_default)
41 IPC_STRUCT_TRAITS_MEMBER(copies_capable)
42 IPC_STRUCT_TRAITS_MEMBER(duplex_capable)
43 IPC_STRUCT_TRAITS_MEMBER(duplex_default)
44 IPC_STRUCT_TRAITS_MEMBER(color_changeable)
45 IPC_STRUCT_TRAITS_MEMBER(color_default)
46 IPC_STRUCT_TRAITS_MEMBER(color_model)
47 IPC_STRUCT_TRAITS_MEMBER(bw_model)
48 IPC_STRUCT_TRAITS_MEMBER(papers)
49 IPC_STRUCT_TRAITS_MEMBER(default_paper)
50 IPC_STRUCT_TRAITS_MEMBER(dpis)
51 IPC_STRUCT_TRAITS_MEMBER(default_dpi)
52 IPC_STRUCT_TRAITS_END()
54 IPC_ENUM_TRAITS(printing::PwgRasterTransformType)
56 IPC_STRUCT_TRAITS_BEGIN(printing::PwgRasterSettings)
57 IPC_STRUCT_TRAITS_MEMBER(odd_page_transform)
58 IPC_STRUCT_TRAITS_MEMBER(rotate_all_pages)
59 IPC_STRUCT_TRAITS_MEMBER(reverse_page_order)
60 IPC_STRUCT_TRAITS_END()
62 //------------------------------------------------------------------------------
63 // Utility process messages:
64 // These are messages from the browser to the utility process.
66 // Tell the utility process to render the given PDF into a PWGRaster.
67 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToPWGRaster,
68 IPC::PlatformFileForTransit, /* Input PDF file */
69 printing::PdfRenderSettings, /* PDF render settings */
70 // PWG transform settings.
71 printing::PwgRasterSettings,
72 IPC::PlatformFileForTransit /* Output PWG file */)
74 // Tells the utility process to get capabilities and defaults for the specified
75 // printer. Used on Windows to isolate the service process from printer driver
76 // crashes by executing this in a separate process. This does not run in a
77 // sandbox.
78 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults,
79 std::string /* printer name */)
81 // Tells the utility process to get capabilities and defaults for the specified
82 // printer. Used on Windows to isolate the service process from printer driver
83 // crashes by executing this in a separate process. This does not run in a
84 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults.
85 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults,
86 std::string /* printer name */)
89 #if defined(WIN_PDF_METAFILE_FOR_PRINTING)
90 // Tell the utility process to render the given PDF into a metafile.
91 // The metafile path will have ".%d" inserted where the %d is the page number.
92 // If no page range is specified, all pages will be converted.
93 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToMetafiles,
94 IPC::PlatformFileForTransit, // PDF file
95 base::FilePath, // Base location for output metafile
96 printing::PdfRenderSettings, // PDF render settings
97 std::vector<printing::PageRange>)
98 #endif
100 //------------------------------------------------------------------------------
101 // Utility process host messages:
102 // These are messages from the utility process to the browser.
104 // Reply when the utility process has succeeded in rendering the PDF to PWG.
105 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded)
107 // Reply when an error occurred rendering the PDF to PWG.
108 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed)
110 // Reply when the utility process has succeeded in obtaining the printer
111 // capabilities and defaults.
112 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded,
113 std::string /* printer name */,
114 printing::PrinterCapsAndDefaults)
116 // Reply when the utility process has succeeded in obtaining the printer
117 // semantic capabilities and defaults.
118 IPC_MESSAGE_CONTROL2(
119 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Succeeded,
120 std::string /* printer name */,
121 printing::PrinterSemanticCapsAndDefaults)
123 // Reply when the utility process has failed to obtain the printer
124 // capabilities and defaults.
125 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed,
126 std::string /* printer name */)
128 // Reply when the utility process has failed to obtain the printer
129 // semantic capabilities and defaults.
130 IPC_MESSAGE_CONTROL1(
131 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed,
132 std::string /* printer name */)
134 #if defined(WIN_PDF_METAFILE_FOR_PRINTING)
135 // Reply when the utility process has succeeded in rendering the PDF.
136 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded,
137 std::vector<printing::PageRange>, // Pages rendered
138 double) // Scale factor
140 // Reply when an error occurred rendering the PDF.
141 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToMetafile_Failed)
142 #endif