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 30 matching lines...) Expand all Loading... |
41 int units_per_inch); | 41 int units_per_inch); |
42 | 42 |
43 void SetCustomMargins(const PageMargins& requested_margins_in_points); | 43 void SetCustomMargins(const PageMargins& requested_margins_in_points); |
44 | 44 |
45 // Equality operator. | 45 // Equality operator. |
46 // NOTE: printer_name is NOT tested for equality since it doesn't affect the | 46 // NOTE: printer_name is NOT tested for equality since it doesn't affect the |
47 // output. | 47 // output. |
48 bool Equals(const PrintSettings& rhs) const; | 48 bool Equals(const PrintSettings& rhs) const; |
49 | 49 |
50 void set_landscape(bool landscape) { landscape_ = landscape; } | 50 void set_landscape(bool landscape) { landscape_ = landscape; } |
51 void set_printer_name(const string16& printer_name) { | 51 void set_printer_name(const base::string16& printer_name) { |
52 printer_name_ = printer_name; | 52 printer_name_ = printer_name; |
53 } | 53 } |
54 const string16& printer_name() const { return printer_name_; } | 54 const base::string16& printer_name() const { return printer_name_; } |
55 void set_device_name(const string16& device_name) { | 55 void set_device_name(const base::string16& device_name) { |
56 device_name_ = device_name; | 56 device_name_ = device_name; |
57 } | 57 } |
58 const string16& device_name() const { return device_name_; } | 58 const base::string16& device_name() const { return device_name_; } |
59 void set_dpi(int dpi) { dpi_ = dpi; } | 59 void set_dpi(int dpi) { dpi_ = dpi; } |
60 int dpi() const { return dpi_; } | 60 int dpi() const { return dpi_; } |
61 void set_supports_alpha_blend(bool supports_alpha_blend) { | 61 void set_supports_alpha_blend(bool supports_alpha_blend) { |
62 supports_alpha_blend_ = supports_alpha_blend; | 62 supports_alpha_blend_ = supports_alpha_blend; |
63 } | 63 } |
64 bool supports_alpha_blend() const { return supports_alpha_blend_; } | 64 bool supports_alpha_blend() const { return supports_alpha_blend_; } |
65 const PageSetup& page_setup_device_units() const { | 65 const PageSetup& page_setup_device_units() const { |
66 return page_setup_device_units_; | 66 return page_setup_device_units_; |
67 } | 67 } |
68 int device_units_per_inch() const { | 68 int device_units_per_inch() const { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 // Cookie generator. It is used to initialize PrintedDocument with its | 103 // Cookie generator. It is used to initialize PrintedDocument with its |
104 // associated PrintSettings, to be sure that each generated PrintedPage is | 104 // associated PrintSettings, to be sure that each generated PrintedPage is |
105 // correctly associated with its corresponding PrintedDocument. | 105 // correctly associated with its corresponding PrintedDocument. |
106 static int NewCookie(); | 106 static int NewCookie(); |
107 | 107 |
108 // Updates the orientation and flip the page if needed. | 108 // Updates the orientation and flip the page if needed. |
109 void SetOrientation(bool landscape); | 109 void SetOrientation(bool landscape); |
110 | 110 |
111 // Strings to be printed as headers and footers if requested by the user. | 111 // Strings to be printed as headers and footers if requested by the user. |
112 string16 date; | 112 base::string16 date; |
113 string16 title; | 113 base::string16 title; |
114 string16 url; | 114 base::string16 url; |
115 | 115 |
116 // True if the user wants headers and footers to be displayed. | 116 // True if the user wants headers and footers to be displayed. |
117 bool display_header_footer; | 117 bool display_header_footer; |
118 | 118 |
119 // True if the user wants to print CSS backgrounds. | 119 // True if the user wants to print CSS backgrounds. |
120 bool should_print_backgrounds; | 120 bool should_print_backgrounds; |
121 | 121 |
122 private: | 122 private: |
123 ////////////////////////////////////////////////////////////////////////////// | 123 ////////////////////////////////////////////////////////////////////////////// |
124 // Settings that can't be changed without side-effects. | 124 // Settings that can't be changed without side-effects. |
125 | 125 |
126 // Printer name as shown to the user. | 126 // Printer name as shown to the user. |
127 string16 printer_name_; | 127 base::string16 printer_name_; |
128 | 128 |
129 // Printer device name as opened by the OS. | 129 // Printer device name as opened by the OS. |
130 string16 device_name_; | 130 base::string16 device_name_; |
131 | 131 |
132 // Page setup in device units. | 132 // Page setup in device units. |
133 PageSetup page_setup_device_units_; | 133 PageSetup page_setup_device_units_; |
134 | 134 |
135 // Printer's device effective dots per inch in both axis. | 135 // Printer's device effective dots per inch in both axis. |
136 int dpi_; | 136 int dpi_; |
137 | 137 |
138 // Is the orientation landscape or portrait. | 138 // Is the orientation landscape or portrait. |
139 bool landscape_; | 139 bool landscape_; |
140 | 140 |
141 // True if this printer supports AlphaBlend. | 141 // True if this printer supports AlphaBlend. |
142 bool supports_alpha_blend_; | 142 bool supports_alpha_blend_; |
143 | 143 |
144 // If margin type is custom, this is what was requested. | 144 // If margin type is custom, this is what was requested. |
145 PageMargins requested_custom_margins_in_points_; | 145 PageMargins requested_custom_margins_in_points_; |
146 }; | 146 }; |
147 | 147 |
148 } // namespace printing | 148 } // namespace printing |
149 | 149 |
150 #endif // PRINTING_PRINT_SETTINGS_H_ | 150 #endif // PRINTING_PRINT_SETTINGS_H_ |
OLD | NEW |