[email protected] | 71f40a7 | 2012-05-16 07:26:59 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
[email protected] | 8ff1d42 | 2009-07-07 21:31:39 | [diff] [blame] | 5 | #ifndef PRINTING_PRINT_SETTINGS_H_ |
| 6 | #define PRINTING_PRINT_SETTINGS_H_ |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 7 | |
rbpotter | 116c2e1 | 2017-04-04 19:21:28 | [diff] [blame] | 8 | #include <algorithm> |
[email protected] | dcd1e886 | 2011-08-09 06:06:58 | [diff] [blame] | 9 | #include <string> |
| 10 | |
Vladislav Kuzkokov | 1999822 | 2019-08-12 14:26:09 | [diff] [blame] | 11 | #include "base/macros.h" |
Jesse Schettler | 1e5d89d | 2019-12-07 01:41:57 | [diff] [blame] | 12 | #include "base/optional.h" |
[email protected] | 896d161f | 2013-06-11 22:52:24 | [diff] [blame] | 13 | #include "base/strings/string16.h" |
Julie Jeongeun Kim | e454f260 | 2020-04-30 05:20:07 | [diff] [blame] | 14 | #include "printing/mojom/print.mojom.h" |
[email protected] | 8ff1d42 | 2009-07-07 21:31:39 | [diff] [blame] | 15 | #include "printing/page_range.h" |
| 16 | #include "printing/page_setup.h" |
[email protected] | 1c23b4e8 | 2011-10-15 22:30:48 | [diff] [blame] | 17 | #include "printing/print_job_constants.h" |
[email protected] | 63313ae | 2011-10-13 00:40:39 | [diff] [blame] | 18 | #include "printing/printing_export.h" |
tfarina | 3b0452d | 2014-12-31 15:20:09 | [diff] [blame] | 19 | #include "ui/gfx/geometry/rect.h" |
rbpotter | 213a4f7 | 2017-12-22 22:58:09 | [diff] [blame] | 20 | #include "ui/gfx/geometry/size.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 21 | |
Vladislav Kuzkokov | d4e4ff3 | 2019-09-13 11:55:56 | [diff] [blame] | 22 | #if defined(OS_CHROMEOS) |
| 23 | #include <map> |
| 24 | |
| 25 | #include "base/values.h" |
| 26 | #endif // defined(OS_CHROMEOS) |
| 27 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 28 | namespace printing { |
| 29 | |
Jesse Schettler | 1e5d89d | 2019-12-07 01:41:57 | [diff] [blame] | 30 | // Returns true if |color_mode| is color and not B&W. Must be called with a |
| 31 | // |color_mode| from printing::ColorModel, excluding UNKNOWN_COLOR_MODEL. |
| 32 | PRINTING_EXPORT base::Optional<bool> IsColorModelSelected(int color_mode); |
[email protected] | 63313ae | 2011-10-13 00:40:39 | [diff] [blame] | 33 | |
[email protected] | fa879e51 | 2011-11-08 20:39:01 | [diff] [blame] | 34 | #if defined(USE_CUPS) |
| 35 | // Get the color model setting name and value for the |color_mode|. |
| 36 | PRINTING_EXPORT void GetColorModelForMode(int color_mode, |
| 37 | std::string* color_setting_name, |
| 38 | std::string* color_value); |
[email protected] | 63313ae | 2011-10-13 00:40:39 | [diff] [blame] | 39 | #endif |
| 40 | |
halcanary | 73b63fd | 2015-11-06 00:02:14 | [diff] [blame] | 41 | // Inform the printing system that it may embed this user-agent string |
| 42 | // in its output's metadata. |
| 43 | PRINTING_EXPORT void SetAgent(const std::string& user_agent); |
| 44 | PRINTING_EXPORT const std::string& GetAgent(); |
| 45 | |
[email protected] | 69f5b1e6 | 2011-09-01 06:34:04 | [diff] [blame] | 46 | class PRINTING_EXPORT PrintSettings { |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 47 | public: |
rbpotter | 58bc882e | 2017-02-01 03:44:24 | [diff] [blame] | 48 | #if defined(OS_WIN) |
| 49 | enum PrinterType { |
| 50 | TYPE_NONE = 0, |
rbpotter | 0437a171 | 2017-07-14 21:23:24 | [diff] [blame] | 51 | TYPE_TEXTONLY, |
rbpotter | 58bc882e | 2017-02-01 03:44:24 | [diff] [blame] | 52 | TYPE_XPS, |
| 53 | TYPE_POSTSCRIPT_LEVEL2, |
| 54 | TYPE_POSTSCRIPT_LEVEL3 |
| 55 | }; |
| 56 | #endif |
| 57 | |
[email protected] | 72ddef9 | 2014-06-12 08:08:06 | [diff] [blame] | 58 | // Media properties requested by the user. Default instance represents |
| 59 | // default media selection. |
| 60 | struct RequestedMedia { |
| 61 | // Size of the media, in microns. |
| 62 | gfx::Size size_microns; |
| 63 | // Platform specific id to map it back to the particular media. |
| 64 | std::string vendor_id; |
| 65 | |
| 66 | bool IsDefault() const { |
| 67 | return size_microns.IsEmpty() && vendor_id.empty(); |
| 68 | } |
| 69 | }; |
| 70 | |
Vladislav Kuzkokov | d4e4ff3 | 2019-09-13 11:55:56 | [diff] [blame] | 71 | #if defined(OS_CHROMEOS) |
| 72 | using AdvancedSettings = std::map<std::string, base::Value>; |
| 73 | #endif // defined(OS_CHROMEOS) |
| 74 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 75 | PrintSettings(); |
[email protected] | 20f0487a | 2010-09-30 20:06:30 | [diff] [blame] | 76 | ~PrintSettings(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 77 | |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 78 | // Reinitialize the settings to the default values. |
| 79 | void Clear(); |
| 80 | |
[email protected] | b076a08 | 2011-10-20 01:26:32 | [diff] [blame] | 81 | void SetCustomMargins(const PageMargins& requested_margins_in_points); |
[email protected] | c95198b | 2014-06-12 16:56:55 | [diff] [blame] | 82 | const PageMargins& requested_custom_margins_in_points() const { |
| 83 | return requested_custom_margins_in_points_; |
| 84 | } |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 85 | void set_margin_type(MarginType margin_type) { margin_type_ = margin_type; } |
| 86 | MarginType margin_type() const { return margin_type_; } |
[email protected] | 1c23b4e8 | 2011-10-15 22:30:48 | [diff] [blame] | 87 | |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 88 | // Updates the orientation and flip the page if needed. |
| 89 | void SetOrientation(bool landscape); |
| 90 | bool landscape() const { return landscape_; } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 91 | |
[email protected] | 72ddef9 | 2014-06-12 08:08:06 | [diff] [blame] | 92 | // Updates user requested media. |
| 93 | void set_requested_media(const RequestedMedia& media) { |
| 94 | requested_media_ = media; |
| 95 | } |
| 96 | // Media properties requested by the user. Translated into device media by the |
| 97 | // platform specific layers. |
Lei Zhang | 01a1d3c0 | 2019-05-21 04:59:10 | [diff] [blame] | 98 | const RequestedMedia& requested_media() const { return requested_media_; } |
[email protected] | 72ddef9 | 2014-06-12 08:08:06 | [diff] [blame] | 99 | |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 100 | // Set printer printable area in in device units. |
| 101 | // Some platforms already provide flipped area. Set |landscape_needs_flip| |
| 102 | // to false on those platforms to avoid double flipping. |
Vladislav Kuzkokov | a3f4af8f | 2017-11-28 15:20:26 | [diff] [blame] | 103 | // This method assumes correct DPI is already set. |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 104 | void SetPrinterPrintableArea(const gfx::Size& physical_size_device_units, |
| 105 | const gfx::Rect& printable_area_device_units, |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 106 | bool landscape_needs_flip); |
| 107 | const PageSetup& page_setup_device_units() const { |
| 108 | return page_setup_device_units_; |
| 109 | } |
| 110 | |
[email protected] | b5fa4ee | 2013-10-01 07:19:07 | [diff] [blame] | 111 | void set_device_name(const base::string16& device_name) { |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 112 | device_name_ = device_name; |
| 113 | } |
[email protected] | b5fa4ee | 2013-10-01 07:19:07 | [diff] [blame] | 114 | const base::string16& device_name() const { return device_name_; } |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 115 | |
rbpotter | 213a4f7 | 2017-12-22 22:58:09 | [diff] [blame] | 116 | void set_dpi(int dpi) { dpi_ = gfx::Size(dpi, dpi); } |
rbpotter | 116c2e1 | 2017-04-04 19:21:28 | [diff] [blame] | 117 | void set_dpi_xy(int dpi_horizontal, int dpi_vertical) { |
rbpotter | 213a4f7 | 2017-12-22 22:58:09 | [diff] [blame] | 118 | dpi_ = gfx::Size(dpi_horizontal, dpi_vertical); |
rbpotter | 116c2e1 | 2017-04-04 19:21:28 | [diff] [blame] | 119 | } |
rbpotter | 213a4f7 | 2017-12-22 22:58:09 | [diff] [blame] | 120 | |
| 121 | int dpi() const { return std::max(dpi_.width(), dpi_.height()); } |
| 122 | int dpi_horizontal() const { return dpi_.width(); } |
| 123 | int dpi_vertical() const { return dpi_.height(); } |
rbpotter | e33e8e62 | 2018-01-25 01:10:33 | [diff] [blame] | 124 | const gfx::Size& dpi_size() const { return dpi_; } |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 125 | |
rbpotter | 769ffdf | 2016-10-26 00:53:57 | [diff] [blame] | 126 | void set_scale_factor(double scale_factor) { scale_factor_ = scale_factor; } |
| 127 | double scale_factor() const { return scale_factor_; } |
| 128 | |
rbpotter | 0fab35602 | 2016-12-28 22:00:23 | [diff] [blame] | 129 | void set_rasterize_pdf(bool rasterize_pdf) { rasterize_pdf_ = rasterize_pdf; } |
| 130 | bool rasterize_pdf() const { return rasterize_pdf_; } |
| 131 | |
[email protected] | b2b0fce | 2011-01-12 16:34:40 | [diff] [blame] | 132 | void set_supports_alpha_blend(bool supports_alpha_blend) { |
| 133 | supports_alpha_blend_ = supports_alpha_blend; |
| 134 | } |
| 135 | bool supports_alpha_blend() const { return supports_alpha_blend_; } |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 136 | |
[email protected] | 6ab86ac | 2010-05-29 07:18:29 | [diff] [blame] | 137 | int device_units_per_inch() const { |
| 138 | #if defined(OS_MACOSX) |
| 139 | return 72; |
Lei Zhang | 01a1d3c0 | 2019-05-21 04:59:10 | [diff] [blame] | 140 | #else // defined(OS_MACOSX) |
[email protected] | 6ab86ac | 2010-05-29 07:18:29 | [diff] [blame] | 141 | return dpi(); |
| 142 | #endif // defined(OS_MACOSX) |
| 143 | } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 144 | |
thestig | e85e6b6 | 2016-08-25 00:00:06 | [diff] [blame] | 145 | void set_ranges(const PageRanges& ranges) { ranges_ = ranges; } |
| 146 | const PageRanges& ranges() const { return ranges_; } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 147 | |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 148 | void set_selection_only(bool selection_only) { |
| 149 | selection_only_ = selection_only; |
| 150 | } |
| 151 | bool selection_only() const { return selection_only_; } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 152 | |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 153 | void set_should_print_backgrounds(bool should_print_backgrounds) { |
| 154 | should_print_backgrounds_ = should_print_backgrounds; |
| 155 | } |
| 156 | bool should_print_backgrounds() const { return should_print_backgrounds_; } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 157 | |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 158 | void set_display_header_footer(bool display_header_footer) { |
| 159 | display_header_footer_ = display_header_footer; |
| 160 | } |
| 161 | bool display_header_footer() const { return display_header_footer_; } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 162 | |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 163 | void set_title(const base::string16& title) { title_ = title; } |
| 164 | const base::string16& title() const { return title_; } |
[email protected] | c8ad40c | 2009-06-08 17:05:21 | [diff] [blame] | 165 | |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 166 | void set_url(const base::string16& url) { url_ = url; } |
| 167 | const base::string16& url() const { return url_; } |
| 168 | |
| 169 | void set_collate(bool collate) { collate_ = collate; } |
| 170 | bool collate() const { return collate_; } |
| 171 | |
| 172 | void set_color(ColorModel color) { color_ = color; } |
| 173 | ColorModel color() const { return color_; } |
| 174 | |
| 175 | void set_copies(int copies) { copies_ = copies; } |
| 176 | int copies() const { return copies_; } |
| 177 | |
Julie Jeongeun Kim | e454f260 | 2020-04-30 05:20:07 | [diff] [blame] | 178 | void set_duplex_mode(mojom::DuplexMode duplex_mode) { |
| 179 | duplex_mode_ = duplex_mode; |
| 180 | } |
| 181 | mojom::DuplexMode duplex_mode() const { return duplex_mode_; } |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 182 | |
thestig | e85e6b6 | 2016-08-25 00:00:06 | [diff] [blame] | 183 | #if defined(OS_WIN) |
| 184 | void set_print_text_with_gdi(bool use_gdi) { print_text_with_gdi_ = use_gdi; } |
| 185 | bool print_text_with_gdi() const { return print_text_with_gdi_; } |
thestig | 1f8436b | 2016-10-06 01:09:25 | [diff] [blame] | 186 | |
rbpotter | 58bc882e | 2017-02-01 03:44:24 | [diff] [blame] | 187 | void set_printer_type(PrinterType type) { printer_type_ = type; } |
rbpotter | 0437a171 | 2017-07-14 21:23:24 | [diff] [blame] | 188 | bool printer_is_textonly() const { |
| 189 | return printer_type_ == PrinterType::TYPE_TEXTONLY; |
| 190 | } |
Lei Zhang | 01a1d3c0 | 2019-05-21 04:59:10 | [diff] [blame] | 191 | bool printer_is_xps() const { return printer_type_ == PrinterType::TYPE_XPS; } |
rbpotter | 58bc882e | 2017-02-01 03:44:24 | [diff] [blame] | 192 | bool printer_is_ps2() const { |
| 193 | return printer_type_ == PrinterType::TYPE_POSTSCRIPT_LEVEL2; |
| 194 | } |
| 195 | bool printer_is_ps3() const { |
| 196 | return printer_type_ == PrinterType::TYPE_POSTSCRIPT_LEVEL3; |
| 197 | } |
thestig | e85e6b6 | 2016-08-25 00:00:06 | [diff] [blame] | 198 | #endif |
| 199 | |
Wei Li | 02720a4 | 2017-10-25 22:06:48 | [diff] [blame] | 200 | void set_is_modifiable(bool is_modifiable) { is_modifiable_ = is_modifiable; } |
| 201 | bool is_modifiable() const { return is_modifiable_; } |
| 202 | |
xlou | 6bd7c2d | 2018-07-10 01:35:40 | [diff] [blame] | 203 | int pages_per_sheet() const { return pages_per_sheet_; } |
| 204 | void set_pages_per_sheet(int pages_per_sheet) { |
| 205 | pages_per_sheet_ = pages_per_sheet; |
xlou | 19420756 | 2018-04-26 23:42:44 | [diff] [blame] | 206 | } |
| 207 | |
Vladislav Kuzkokov | 48b1500 | 2019-01-30 17:13:35 | [diff] [blame] | 208 | #if defined(OS_CHROMEOS) |
| 209 | void set_send_user_info(bool send_user_info) { |
| 210 | send_user_info_ = send_user_info; |
| 211 | } |
| 212 | bool send_user_info() const { return send_user_info_; } |
| 213 | |
| 214 | void set_username(const std::string& username) { username_ = username; } |
| 215 | const std::string& username() const { return username_; } |
Nikita Podguzov | c1bf3f8 | 2019-03-19 15:23:23 | [diff] [blame] | 216 | |
| 217 | void set_pin_value(const std::string& pin_value) { pin_value_ = pin_value; } |
| 218 | const std::string& pin_value() const { return pin_value_; } |
Vladislav Kuzkokov | d4e4ff3 | 2019-09-13 11:55:56 | [diff] [blame] | 219 | |
| 220 | AdvancedSettings& advanced_settings() { return advanced_settings_; } |
| 221 | const AdvancedSettings& advanced_settings() const { |
| 222 | return advanced_settings_; |
| 223 | } |
| 224 | #endif // defined(OS_CHROMEOS) |
Vladislav Kuzkokov | 48b1500 | 2019-01-30 17:13:35 | [diff] [blame] | 225 | |
[email protected] | d30e8e64 | 2008-08-06 12:05:24 | [diff] [blame] | 226 | // Cookie generator. It is used to initialize PrintedDocument with its |
| 227 | // associated PrintSettings, to be sure that each generated PrintedPage is |
| 228 | // correctly associated with its corresponding PrintedDocument. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 229 | static int NewCookie(); |
| 230 | |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 231 | private: |
| 232 | // Multi-page printing. Each PageRange describes a from-to page combination. |
| 233 | // This permits printing selected pages only. |
| 234 | PageRanges ranges_; |
| 235 | |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 236 | // Indicates if the user only wants to print the current selection. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 237 | bool selection_only_; |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 238 | |
| 239 | // Indicates what kind of margins should be applied to the printable area. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 240 | MarginType margin_type_; |
[email protected] | c48bee2 | 2011-03-29 02:36:26 | [diff] [blame] | 241 | |
[email protected] | 55b23a0 | 2011-08-17 23:09:36 | [diff] [blame] | 242 | // Strings to be printed as headers and footers if requested by the user. |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 243 | base::string16 title_; |
| 244 | base::string16 url_; |
[email protected] | 55b23a0 | 2011-08-17 23:09:36 | [diff] [blame] | 245 | |
| 246 | // True if the user wants headers and footers to be displayed. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 247 | bool display_header_footer_; |
[email protected] | 55b23a0 | 2011-08-17 23:09:36 | [diff] [blame] | 248 | |
[email protected] | 19d1c2d | 2013-01-14 00:59:46 | [diff] [blame] | 249 | // True if the user wants to print CSS backgrounds. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 250 | bool should_print_backgrounds_; |
[email protected] | 19d1c2d | 2013-01-14 00:59:46 | [diff] [blame] | 251 | |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 252 | // True if the user wants to print with collate. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 253 | bool collate_; |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 254 | |
| 255 | // True if the user wants to print with collate. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 256 | ColorModel color_; |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 257 | |
| 258 | // Number of copies user wants to print. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 259 | int copies_; |
[email protected] | e5324b5 | 2013-10-29 03:16:37 | [diff] [blame] | 260 | |
| 261 | // Duplex type user wants to use. |
Julie Jeongeun Kim | e454f260 | 2020-04-30 05:20:07 | [diff] [blame] | 262 | mojom::DuplexMode duplex_mode_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 263 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 264 | // Printer device name as opened by the OS. |
[email protected] | b5fa4ee | 2013-10-01 07:19:07 | [diff] [blame] | 265 | base::string16 device_name_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 266 | |
[email protected] | 72ddef9 | 2014-06-12 08:08:06 | [diff] [blame] | 267 | // Media requested by the user. |
| 268 | RequestedMedia requested_media_; |
| 269 | |
[email protected] | 6ab86ac | 2010-05-29 07:18:29 | [diff] [blame] | 270 | // Page setup in device units. |
| 271 | PageSetup page_setup_device_units_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 272 | |
rbpotter | 116c2e1 | 2017-04-04 19:21:28 | [diff] [blame] | 273 | // Printer's device effective dots per inch in both axes. The two values will |
| 274 | // generally be identical. However, on Windows, there are a few rare printers |
| 275 | // that support resolutions with different DPI in different dimensions. |
rbpotter | 213a4f7 | 2017-12-22 22:58:09 | [diff] [blame] | 276 | gfx::Size dpi_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 277 | |
rbpotter | 769ffdf | 2016-10-26 00:53:57 | [diff] [blame] | 278 | // Scale factor |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 279 | double scale_factor_; |
rbpotter | 769ffdf | 2016-10-26 00:53:57 | [diff] [blame] | 280 | |
rbpotter | 0fab35602 | 2016-12-28 22:00:23 | [diff] [blame] | 281 | // True if PDF should be printed as a raster PDF |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 282 | bool rasterize_pdf_; |
rbpotter | 0fab35602 | 2016-12-28 22:00:23 | [diff] [blame] | 283 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 284 | // Is the orientation landscape or portrait. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 285 | bool landscape_; |
[email protected] | b2b0fce | 2011-01-12 16:34:40 | [diff] [blame] | 286 | |
| 287 | // True if this printer supports AlphaBlend. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 288 | bool supports_alpha_blend_; |
[email protected] | 1c23b4e8 | 2011-10-15 22:30:48 | [diff] [blame] | 289 | |
thestig | e85e6b6 | 2016-08-25 00:00:06 | [diff] [blame] | 290 | #if defined(OS_WIN) |
| 291 | // True to print text with GDI. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 292 | bool print_text_with_gdi_; |
thestig | 1f8436b | 2016-10-06 01:09:25 | [diff] [blame] | 293 | |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 294 | PrinterType printer_type_; |
thestig | e85e6b6 | 2016-08-25 00:00:06 | [diff] [blame] | 295 | #endif |
| 296 | |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 297 | bool is_modifiable_; |
Wei Li | 02720a4 | 2017-10-25 22:06:48 | [diff] [blame] | 298 | |
[email protected] | b076a08 | 2011-10-20 01:26:32 | [diff] [blame] | 299 | // If margin type is custom, this is what was requested. |
| 300 | PageMargins requested_custom_margins_in_points_; |
xlou | 19420756 | 2018-04-26 23:42:44 | [diff] [blame] | 301 | |
| 302 | // Number of pages per sheet. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 303 | int pages_per_sheet_; |
Vladislav Kuzkokov | 48b1500 | 2019-01-30 17:13:35 | [diff] [blame] | 304 | |
| 305 | #if defined(OS_CHROMEOS) |
| 306 | // Whether to send user info. |
Vladislav Kuzkokov | 56e6bbbd | 2019-08-21 18:48:18 | [diff] [blame] | 307 | bool send_user_info_; |
Vladislav Kuzkokov | 48b1500 | 2019-01-30 17:13:35 | [diff] [blame] | 308 | |
| 309 | // Username if it's required by the printer. |
| 310 | std::string username_; |
Nikita Podguzov | c1bf3f8 | 2019-03-19 15:23:23 | [diff] [blame] | 311 | |
| 312 | // PIN code entered by the user. |
| 313 | std::string pin_value_; |
Vladislav Kuzkokov | d4e4ff3 | 2019-09-13 11:55:56 | [diff] [blame] | 314 | |
| 315 | // Advanced settings. |
| 316 | AdvancedSettings advanced_settings_; |
Vladislav Kuzkokov | 48b1500 | 2019-01-30 17:13:35 | [diff] [blame] | 317 | #endif |
Vladislav Kuzkokov | 1999822 | 2019-08-12 14:26:09 | [diff] [blame] | 318 | |
| 319 | DISALLOW_COPY_AND_ASSIGN(PrintSettings); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 320 | }; |
| 321 | |
| 322 | } // namespace printing |
| 323 | |
[email protected] | 8ff1d42 | 2009-07-07 21:31:39 | [diff] [blame] | 324 | #endif // PRINTING_PRINT_SETTINGS_H_ |