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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 ColorModel color() const { return color_; } | 136 ColorModel color() const { return color_; } |
137 | 137 |
138 void set_copies(int copies) { copies_ = copies; } | 138 void set_copies(int copies) { copies_ = copies; } |
139 int copies() const { return copies_; } | 139 int copies() const { return copies_; } |
140 | 140 |
141 void set_duplex_mode(DuplexMode duplex_mode) { duplex_mode_ = duplex_mode; } | 141 void set_duplex_mode(DuplexMode duplex_mode) { duplex_mode_ = duplex_mode; } |
142 DuplexMode duplex_mode() const { return duplex_mode_; } | 142 DuplexMode duplex_mode() const { return duplex_mode_; } |
143 | 143 |
144 int desired_dpi() const { return desired_dpi_; } | 144 int desired_dpi() const { return desired_dpi_; } |
145 | 145 |
| 146 double max_shrink() const { return max_shrink_; } |
| 147 |
| 148 double min_shrink() const { return min_shrink_; } |
| 149 |
146 // Cookie generator. It is used to initialize PrintedDocument with its | 150 // Cookie generator. It is used to initialize PrintedDocument with its |
147 // associated PrintSettings, to be sure that each generated PrintedPage is | 151 // associated PrintSettings, to be sure that each generated PrintedPage is |
148 // correctly associated with its corresponding PrintedDocument. | 152 // correctly associated with its corresponding PrintedDocument. |
149 static int NewCookie(); | 153 static int NewCookie(); |
150 | 154 |
151 private: | 155 private: |
152 // Multi-page printing. Each PageRange describes a from-to page combination. | 156 // Multi-page printing. Each PageRange describes a from-to page combination. |
153 // This permits printing selected pages only. | 157 // This permits printing selected pages only. |
154 PageRanges ranges_; | 158 PageRanges ranges_; |
155 | 159 |
| 160 // By imaging to a width a little wider than the available pixels, thin pages |
| 161 // will be scaled down a little, matching the way they print in IE and Camino. |
| 162 // This lets them use fewer sheets than they would otherwise, which is |
| 163 // presumably why other browsers do this. Wide pages will be scaled down more |
| 164 // than this. |
| 165 double min_shrink_; |
| 166 |
| 167 // This number determines how small we are willing to reduce the page content |
| 168 // in order to accommodate the widest line. If the page would have to be |
| 169 // reduced smaller to make the widest line fit, we just clip instead (this |
| 170 // behavior matches MacIE and Mozilla, at least) |
| 171 double max_shrink_; |
| 172 |
156 // Desired visible dots per inch rendering for output. Printing should be | 173 // Desired visible dots per inch rendering for output. Printing should be |
157 // scaled to ScreenDpi/dpix*desired_dpi. | 174 // scaled to ScreenDpi/dpix*desired_dpi. |
158 int desired_dpi_; | 175 int desired_dpi_; |
159 | 176 |
160 // Indicates if the user only wants to print the current selection. | 177 // Indicates if the user only wants to print the current selection. |
161 bool selection_only_; | 178 bool selection_only_; |
162 | 179 |
163 // Indicates what kind of margins should be applied to the printable area. | 180 // Indicates what kind of margins should be applied to the printable area. |
164 MarginType margin_type_; | 181 MarginType margin_type_; |
165 | 182 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // True if this printer supports AlphaBlend. | 220 // True if this printer supports AlphaBlend. |
204 bool supports_alpha_blend_; | 221 bool supports_alpha_blend_; |
205 | 222 |
206 // If margin type is custom, this is what was requested. | 223 // If margin type is custom, this is what was requested. |
207 PageMargins requested_custom_margins_in_points_; | 224 PageMargins requested_custom_margins_in_points_; |
208 }; | 225 }; |
209 | 226 |
210 } // namespace printing | 227 } // namespace printing |
211 | 228 |
212 #endif // PRINTING_PRINT_SETTINGS_H_ | 229 #endif // PRINTING_PRINT_SETTINGS_H_ |
OLD | NEW |