Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: printing/print_settings.h

Issue 2633573002: Add Postscript Printing (Closed)
Patch Set: Merge Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « printing/pdf_render_settings.h ('k') | printing/print_settings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 16 matching lines...) Expand all
27 #endif 27 #endif
28 28
29 // Inform the printing system that it may embed this user-agent string 29 // Inform the printing system that it may embed this user-agent string
30 // in its output's metadata. 30 // in its output's metadata.
31 PRINTING_EXPORT void SetAgent(const std::string& user_agent); 31 PRINTING_EXPORT void SetAgent(const std::string& user_agent);
32 PRINTING_EXPORT const std::string& GetAgent(); 32 PRINTING_EXPORT const std::string& GetAgent();
33 33
34 // OS-independent print settings. 34 // OS-independent print settings.
35 class PRINTING_EXPORT PrintSettings { 35 class PRINTING_EXPORT PrintSettings {
36 public: 36 public:
37 #if defined(OS_WIN)
38 enum PrinterType {
39 TYPE_NONE = 0,
40 TYPE_XPS,
41 TYPE_POSTSCRIPT_LEVEL2,
42 TYPE_POSTSCRIPT_LEVEL3
43 };
44 #endif
45
37 // Media properties requested by the user. Default instance represents 46 // Media properties requested by the user. Default instance represents
38 // default media selection. 47 // default media selection.
39 struct RequestedMedia { 48 struct RequestedMedia {
40 // Size of the media, in microns. 49 // Size of the media, in microns.
41 gfx::Size size_microns; 50 gfx::Size size_microns;
42 // Platform specific id to map it back to the particular media. 51 // Platform specific id to map it back to the particular media.
43 std::string vendor_id; 52 std::string vendor_id;
44 53
45 bool IsDefault() const { 54 bool IsDefault() const {
46 return size_microns.IsEmpty() && vendor_id.empty(); 55 return size_microns.IsEmpty() && vendor_id.empty();
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 156
148 void set_duplex_mode(DuplexMode duplex_mode) { duplex_mode_ = duplex_mode; } 157 void set_duplex_mode(DuplexMode duplex_mode) { duplex_mode_ = duplex_mode; }
149 DuplexMode duplex_mode() const { return duplex_mode_; } 158 DuplexMode duplex_mode() const { return duplex_mode_; }
150 159
151 int desired_dpi() const { return desired_dpi_; } 160 int desired_dpi() const { return desired_dpi_; }
152 161
153 #if defined(OS_WIN) 162 #if defined(OS_WIN)
154 void set_print_text_with_gdi(bool use_gdi) { print_text_with_gdi_ = use_gdi; } 163 void set_print_text_with_gdi(bool use_gdi) { print_text_with_gdi_ = use_gdi; }
155 bool print_text_with_gdi() const { return print_text_with_gdi_; } 164 bool print_text_with_gdi() const { return print_text_with_gdi_; }
156 165
157 void set_printer_is_xps(bool is_xps) { printer_is_xps_ = is_xps; } 166 void set_printer_type(PrinterType type) { printer_type_ = type; }
158 bool printer_is_xps() const { return printer_is_xps_; } 167 bool printer_is_xps() const { return printer_type_ == PrinterType::TYPE_XPS;}
168 bool printer_is_ps2() const {
169 return printer_type_ == PrinterType::TYPE_POSTSCRIPT_LEVEL2;
170 }
171 bool printer_is_ps3() const {
172 return printer_type_ == PrinterType::TYPE_POSTSCRIPT_LEVEL3;
173 }
159 #endif 174 #endif
160 175
161 // Cookie generator. It is used to initialize PrintedDocument with its 176 // Cookie generator. It is used to initialize PrintedDocument with its
162 // associated PrintSettings, to be sure that each generated PrintedPage is 177 // associated PrintSettings, to be sure that each generated PrintedPage is
163 // correctly associated with its corresponding PrintedDocument. 178 // correctly associated with its corresponding PrintedDocument.
164 static int NewCookie(); 179 static int NewCookie();
165 180
166 private: 181 private:
167 // Multi-page printing. Each PageRange describes a from-to page combination. 182 // Multi-page printing. Each PageRange describes a from-to page combination.
168 // This permits printing selected pages only. 183 // This permits printing selected pages only.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // Is the orientation landscape or portrait. 236 // Is the orientation landscape or portrait.
222 bool landscape_; 237 bool landscape_;
223 238
224 // True if this printer supports AlphaBlend. 239 // True if this printer supports AlphaBlend.
225 bool supports_alpha_blend_; 240 bool supports_alpha_blend_;
226 241
227 #if defined(OS_WIN) 242 #if defined(OS_WIN)
228 // True to print text with GDI. 243 // True to print text with GDI.
229 bool print_text_with_gdi_; 244 bool print_text_with_gdi_;
230 245
231 // True if the printer is an XPS printer. 246 PrinterType printer_type_;
232 bool printer_is_xps_;
233 #endif 247 #endif
234 248
235 // If margin type is custom, this is what was requested. 249 // If margin type is custom, this is what was requested.
236 PageMargins requested_custom_margins_in_points_; 250 PageMargins requested_custom_margins_in_points_;
237 }; 251 };
238 252
239 } // namespace printing 253 } // namespace printing
240 254
241 #endif // PRINTING_PRINT_SETTINGS_H_ 255 #endif // PRINTING_PRINT_SETTINGS_H_
OLDNEW
« no previous file with comments | « printing/pdf_render_settings.h ('k') | printing/print_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698