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 | |
150 // Cookie generator. It is used to initialize PrintedDocument with its | 146 // Cookie generator. It is used to initialize PrintedDocument with its |
151 // associated PrintSettings, to be sure that each generated PrintedPage is | 147 // associated PrintSettings, to be sure that each generated PrintedPage is |
152 // correctly associated with its corresponding PrintedDocument. | 148 // correctly associated with its corresponding PrintedDocument. |
153 static int NewCookie(); | 149 static int NewCookie(); |
154 | 150 |
155 private: | 151 private: |
156 // Multi-page printing. Each PageRange describes a from-to page combination. | 152 // Multi-page printing. Each PageRange describes a from-to page combination. |
157 // This permits printing selected pages only. | 153 // This permits printing selected pages only. |
158 PageRanges ranges_; | 154 PageRanges ranges_; |
159 | 155 |
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 | |
173 // Desired visible dots per inch rendering for output. Printing should be | 156 // Desired visible dots per inch rendering for output. Printing should be |
174 // scaled to ScreenDpi/dpix*desired_dpi. | 157 // scaled to ScreenDpi/dpix*desired_dpi. |
175 int desired_dpi_; | 158 int desired_dpi_; |
176 | 159 |
177 // Indicates if the user only wants to print the current selection. | 160 // Indicates if the user only wants to print the current selection. |
178 bool selection_only_; | 161 bool selection_only_; |
179 | 162 |
180 // Indicates what kind of margins should be applied to the printable area. | 163 // Indicates what kind of margins should be applied to the printable area. |
181 MarginType margin_type_; | 164 MarginType margin_type_; |
182 | 165 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // True if this printer supports AlphaBlend. | 203 // True if this printer supports AlphaBlend. |
221 bool supports_alpha_blend_; | 204 bool supports_alpha_blend_; |
222 | 205 |
223 // If margin type is custom, this is what was requested. | 206 // If margin type is custom, this is what was requested. |
224 PageMargins requested_custom_margins_in_points_; | 207 PageMargins requested_custom_margins_in_points_; |
225 }; | 208 }; |
226 | 209 |
227 } // namespace printing | 210 } // namespace printing |
228 | 211 |
229 #endif // PRINTING_PRINT_SETTINGS_H_ | 212 #endif // PRINTING_PRINT_SETTINGS_H_ |
OLD | NEW |