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 <algorithm> | 8 #include <algorithm> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 // Inform the printing system that it may embed this user-agent string | 30 // Inform the printing system that it may embed this user-agent string |
31 // in its output's metadata. | 31 // in its output's metadata. |
32 PRINTING_EXPORT void SetAgent(const std::string& user_agent); | 32 PRINTING_EXPORT void SetAgent(const std::string& user_agent); |
33 PRINTING_EXPORT const std::string& GetAgent(); | 33 PRINTING_EXPORT const std::string& GetAgent(); |
34 | 34 |
35 class PRINTING_EXPORT PrintSettings { | 35 class PRINTING_EXPORT PrintSettings { |
36 public: | 36 public: |
37 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
38 enum PrinterType { | 38 enum PrinterType { |
39 TYPE_NONE = 0, | 39 TYPE_NONE = 0, |
| 40 TYPE_TEXTONLY, |
40 TYPE_XPS, | 41 TYPE_XPS, |
41 TYPE_POSTSCRIPT_LEVEL2, | 42 TYPE_POSTSCRIPT_LEVEL2, |
42 TYPE_POSTSCRIPT_LEVEL3 | 43 TYPE_POSTSCRIPT_LEVEL3 |
43 }; | 44 }; |
44 #endif | 45 #endif |
45 | 46 |
46 // Media properties requested by the user. Default instance represents | 47 // Media properties requested by the user. Default instance represents |
47 // default media selection. | 48 // default media selection. |
48 struct RequestedMedia { | 49 struct RequestedMedia { |
49 // Size of the media, in microns. | 50 // Size of the media, in microns. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 int copies() const { return copies_; } | 165 int copies() const { return copies_; } |
165 | 166 |
166 void set_duplex_mode(DuplexMode duplex_mode) { duplex_mode_ = duplex_mode; } | 167 void set_duplex_mode(DuplexMode duplex_mode) { duplex_mode_ = duplex_mode; } |
167 DuplexMode duplex_mode() const { return duplex_mode_; } | 168 DuplexMode duplex_mode() const { return duplex_mode_; } |
168 | 169 |
169 #if defined(OS_WIN) | 170 #if defined(OS_WIN) |
170 void set_print_text_with_gdi(bool use_gdi) { print_text_with_gdi_ = use_gdi; } | 171 void set_print_text_with_gdi(bool use_gdi) { print_text_with_gdi_ = use_gdi; } |
171 bool print_text_with_gdi() const { return print_text_with_gdi_; } | 172 bool print_text_with_gdi() const { return print_text_with_gdi_; } |
172 | 173 |
173 void set_printer_type(PrinterType type) { printer_type_ = type; } | 174 void set_printer_type(PrinterType type) { printer_type_ = type; } |
| 175 bool printer_is_textonly() const { |
| 176 return printer_type_ == PrinterType::TYPE_TEXTONLY; |
| 177 } |
174 bool printer_is_xps() const { return printer_type_ == PrinterType::TYPE_XPS;} | 178 bool printer_is_xps() const { return printer_type_ == PrinterType::TYPE_XPS;} |
175 bool printer_is_ps2() const { | 179 bool printer_is_ps2() const { |
176 return printer_type_ == PrinterType::TYPE_POSTSCRIPT_LEVEL2; | 180 return printer_type_ == PrinterType::TYPE_POSTSCRIPT_LEVEL2; |
177 } | 181 } |
178 bool printer_is_ps3() const { | 182 bool printer_is_ps3() const { |
179 return printer_type_ == PrinterType::TYPE_POSTSCRIPT_LEVEL3; | 183 return printer_type_ == PrinterType::TYPE_POSTSCRIPT_LEVEL3; |
180 } | 184 } |
181 #endif | 185 #endif |
182 | 186 |
183 // Cookie generator. It is used to initialize PrintedDocument with its | 187 // Cookie generator. It is used to initialize PrintedDocument with its |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 PrinterType printer_type_; | 255 PrinterType printer_type_; |
252 #endif | 256 #endif |
253 | 257 |
254 // If margin type is custom, this is what was requested. | 258 // If margin type is custom, this is what was requested. |
255 PageMargins requested_custom_margins_in_points_; | 259 PageMargins requested_custom_margins_in_points_; |
256 }; | 260 }; |
257 | 261 |
258 } // namespace printing | 262 } // namespace printing |
259 | 263 |
260 #endif // PRINTING_PRINT_SETTINGS_H_ | 264 #endif // PRINTING_PRINT_SETTINGS_H_ |
OLD | NEW |