Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
|
Sam McNally
2017/01/05 06:23:15
Happy new year!
tibell
2017/01/12 03:30:15
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module printing.mojom; | |
| 6 | |
| 7 import "mojo/common/file.mojom"; | |
| 8 import "mojo/common/string16.mojom"; | |
| 9 | |
| 10 [Native] | |
| 11 struct PwgRasterSettings; | |
| 12 | |
| 13 [Native] | |
| 14 struct PrinterCapsAndDefaults; | |
| 15 | |
| 16 [Native] | |
| 17 struct PrinterSemanticCapsAndDefaults; | |
| 18 | |
| 19 [Native] | |
| 20 struct LOGFONT; // Windows-only | |
| 21 | |
| 22 [Native] | |
| 23 struct PdfRenderSettings; | |
| 24 | |
| 25 // Called by the utility process to have the browser do font pre-caching. | |
| 26 interface FontPreCaching { | |
| 27 // Windows-only: | |
| 28 | |
| 29 // Request that the given font characters be loaded by the browser so it's | |
| 30 // cached by the OS. Please see | |
| 31 // PdfToEmfUtilityProcessHostClient::OnPreCacheFontCharacters for details. | |
| 32 [Sync] | |
| 33 PreCacheFontCharacters(LOGFONT font_data, | |
| 34 mojo.common.mojom.String16 characters) => (); | |
| 35 }; | |
| 36 | |
| 37 // These are messages from the browser to the utility process. | |
| 38 interface Printing { | |
| 39 // Tell the utility process to render the given PDF into a PWGRaster. Returns | |
| 40 // whether the rendering the PDF to PWG succeeded or not. | |
| 41 RenderPDFPagesToPWGRaster( | |
| 42 mojo.common.mojom.File input_pdf_file, | |
| 43 PdfRenderSettings settings, | |
| 44 PwgRasterSettings bitmap_settings, | |
| 45 mojo.common.mojom.File output_pwg_file) => (bool success); | |
| 46 | |
| 47 // Tells the utility process to get capabilities and defaults for the | |
| 48 // specified printer. Used on Windows to isolate the service process from | |
| 49 // printer driver crashes by executing this in a separate process. This does | |
| 50 // not run in a sandbox. If the method fails |caps_and_defaults| will be null. | |
| 51 GetPrinterCapsAndDefaults(string printer_name) => | |
| 52 (PrinterCapsAndDefaults? caps_and_defaults); | |
| 53 | |
| 54 // Tells the utility process to get capabilities and defaults for the | |
| 55 // specified printer. Used on Windows to isolate the service process from | |
| 56 // printer driver crashes by executing this in a separate process. This does | |
| 57 // not run in a sandbox. Returns result as | |
| 58 // printing::PrinterSemanticCapsAndDefaults. If the method fails | |
| 59 // |caps_and_defaults| will be null. | |
| 60 GetPrinterSemanticCapsAndDefaults(string printer_name) => | |
| 61 (PrinterSemanticCapsAndDefaults? caps_and_defaults); | |
| 62 | |
| 63 // Windows-only: | |
| 64 | |
| 65 // Tell the utility process to start rendering the given PDF into a | |
| 66 // metafile. |page_count| is 0, if loading failed. Utility process would be | |
| 67 // alive until RenderPDFPagesToMetafiles_Stop is called. | |
| 68 // | |
| 69 // TODO(tibell): Use a null |page_count| for failure. | |
|
Sam McNally
2017/01/05 06:23:15
I don't think primitive types are nullable.
tibell
2017/01/12 03:30:15
Done.
| |
| 70 RenderPDFPagesToMetafiles( | |
| 71 mojo.common.mojom.File input_file, | |
| 72 PdfRenderSettings settings, | |
| 73 bool print_text_with_gdi) => (int32 page_count); | |
| 74 | |
| 75 // Requests conversion of the next page. | |
| 76 RenderPDFPagesToMetafilesGetPage(int32 page_number, | |
| 77 mojo.common.mojom.File output_file) => | |
| 78 (bool success, float scale_factor); | |
| 79 }; | |
| 80 | |
| 81 // Create a printing interface. This is done using a factory so we can pass a | |
| 82 // |FontPreCaching| callback interface to the receiver side before any of the | |
| 83 // methods on |Printing| are called. | |
| 84 interface PrintingFactory { | |
| 85 // Creates a new connection using the |printing| pipe. | |
| 86 MakePrinting(Printing& printing, FontPreCaching? font_pre_caching); | |
| 87 }; | |
| OLD | NEW |