OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PRINTING_PRINT_SETTINGS_H_ | 5 #ifndef PRINTING_PRINT_SETTINGS_H_ |
6 #define PRINTING_PRINT_SETTINGS_H_ | 6 #define PRINTING_PRINT_SETTINGS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 bool supports_alpha_blend() const { return supports_alpha_blend_; } | 99 bool supports_alpha_blend() const { return supports_alpha_blend_; } |
100 | 100 |
101 int device_units_per_inch() const { | 101 int device_units_per_inch() const { |
102 #if defined(OS_MACOSX) | 102 #if defined(OS_MACOSX) |
103 return 72; | 103 return 72; |
104 #else // defined(OS_MACOSX) | 104 #else // defined(OS_MACOSX) |
105 return dpi(); | 105 return dpi(); |
106 #endif // defined(OS_MACOSX) | 106 #endif // defined(OS_MACOSX) |
107 } | 107 } |
108 | 108 |
109 void set_ranges(const PageRanges& ranges) { ranges_ = ranges; }; | 109 void set_ranges(const PageRanges& ranges) { ranges_ = ranges; } |
110 const PageRanges& ranges() const { return ranges_; }; | 110 const PageRanges& ranges() const { return ranges_; } |
111 | 111 |
112 void set_selection_only(bool selection_only) { | 112 void set_selection_only(bool selection_only) { |
113 selection_only_ = selection_only; | 113 selection_only_ = selection_only; |
114 } | 114 } |
115 bool selection_only() const { return selection_only_; } | 115 bool selection_only() const { return selection_only_; } |
116 | 116 |
117 void set_should_print_backgrounds(bool should_print_backgrounds) { | 117 void set_should_print_backgrounds(bool should_print_backgrounds) { |
118 should_print_backgrounds_ = should_print_backgrounds; | 118 should_print_backgrounds_ = should_print_backgrounds; |
119 } | 119 } |
120 bool should_print_backgrounds() const { return should_print_backgrounds_; } | 120 bool should_print_backgrounds() const { return should_print_backgrounds_; } |
(...skipping 16 matching lines...) Expand all Loading... |
137 ColorModel color() const { return color_; } | 137 ColorModel color() const { return color_; } |
138 | 138 |
139 void set_copies(int copies) { copies_ = copies; } | 139 void set_copies(int copies) { copies_ = copies; } |
140 int copies() const { return copies_; } | 140 int copies() const { return copies_; } |
141 | 141 |
142 void set_duplex_mode(DuplexMode duplex_mode) { duplex_mode_ = duplex_mode; } | 142 void set_duplex_mode(DuplexMode duplex_mode) { duplex_mode_ = duplex_mode; } |
143 DuplexMode duplex_mode() const { return duplex_mode_; } | 143 DuplexMode duplex_mode() const { return duplex_mode_; } |
144 | 144 |
145 int desired_dpi() const { return desired_dpi_; } | 145 int desired_dpi() const { return desired_dpi_; } |
146 | 146 |
| 147 #if defined(OS_WIN) |
| 148 void set_print_text_with_gdi(bool use_gdi) { print_text_with_gdi_ = use_gdi; } |
| 149 bool print_text_with_gdi() const { return print_text_with_gdi_; } |
| 150 #endif |
| 151 |
147 // Cookie generator. It is used to initialize PrintedDocument with its | 152 // Cookie generator. It is used to initialize PrintedDocument with its |
148 // associated PrintSettings, to be sure that each generated PrintedPage is | 153 // associated PrintSettings, to be sure that each generated PrintedPage is |
149 // correctly associated with its corresponding PrintedDocument. | 154 // correctly associated with its corresponding PrintedDocument. |
150 static int NewCookie(); | 155 static int NewCookie(); |
151 | 156 |
152 private: | 157 private: |
153 // Multi-page printing. Each PageRange describes a from-to page combination. | 158 // Multi-page printing. Each PageRange describes a from-to page combination. |
154 // This permits printing selected pages only. | 159 // This permits printing selected pages only. |
155 PageRanges ranges_; | 160 PageRanges ranges_; |
156 | 161 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 202 |
198 // Printer's device effective dots per inch in both axis. | 203 // Printer's device effective dots per inch in both axis. |
199 int dpi_; | 204 int dpi_; |
200 | 205 |
201 // Is the orientation landscape or portrait. | 206 // Is the orientation landscape or portrait. |
202 bool landscape_; | 207 bool landscape_; |
203 | 208 |
204 // True if this printer supports AlphaBlend. | 209 // True if this printer supports AlphaBlend. |
205 bool supports_alpha_blend_; | 210 bool supports_alpha_blend_; |
206 | 211 |
| 212 #if defined(OS_WIN) |
| 213 // True to print text with GDI. |
| 214 bool print_text_with_gdi_; |
| 215 #endif |
| 216 |
207 // If margin type is custom, this is what was requested. | 217 // If margin type is custom, this is what was requested. |
208 PageMargins requested_custom_margins_in_points_; | 218 PageMargins requested_custom_margins_in_points_; |
209 }; | 219 }; |
210 | 220 |
211 } // namespace printing | 221 } // namespace printing |
212 | 222 |
213 #endif // PRINTING_PRINT_SETTINGS_H_ | 223 #endif // PRINTING_PRINT_SETTINGS_H_ |
OLD | NEW |