OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_PRINTING_PRINT_SETTINGS_H__ | 5 #ifndef PRINTING_PRINT_SETTINGS_H_ |
6 #define CHROME_BROWSER_PRINTING_PRINT_SETTINGS_H__ | 6 #define PRINTING_PRINT_SETTINGS_H_ |
7 | 7 |
8 #include "base/gfx/rect.h" | 8 #include "base/gfx/rect.h" |
9 #include "chrome/browser/printing/page_overlays.h" | 9 #include "printing/page_overlays.h" |
10 #include "chrome/browser/printing/page_range.h" | 10 #include "printing/page_range.h" |
11 #include "chrome/browser/printing/page_setup.h" | 11 #include "printing/page_setup.h" |
12 | 12 |
13 struct ViewMsg_Print_Params; | |
14 typedef struct HDC__* HDC; | 13 typedef struct HDC__* HDC; |
15 typedef struct _devicemodeW DEVMODE; | 14 typedef struct _devicemodeW DEVMODE; |
16 | 15 |
17 namespace printing { | 16 namespace printing { |
18 | 17 |
19 // OS-independent print settings. | 18 // OS-independent print settings. |
20 class PrintSettings { | 19 class PrintSettings { |
21 public: | 20 public: |
22 PrintSettings(); | 21 PrintSettings(); |
23 | 22 |
24 // Reinitialize the settings to the default values. | 23 // Reinitialize the settings to the default values. |
25 void Clear(); | 24 void Clear(); |
26 | 25 |
27 #ifdef WIN32 | 26 #ifdef WIN32 |
28 // Reads the settings from the selected device context. Calculates derived | 27 // Reads the settings from the selected device context. Calculates derived |
29 // values like printable_area_. | 28 // values like printable_area_. |
30 void Init(HDC hdc, | 29 void Init(HDC hdc, |
31 const DEVMODE& dev_mode, | 30 const DEVMODE& dev_mode, |
32 const PageRanges& new_ranges, | 31 const PageRanges& new_ranges, |
33 const std::wstring& new_device_name, | 32 const std::wstring& new_device_name, |
34 bool selection_only); | 33 bool selection_only); |
35 #endif | 34 #endif |
36 | 35 |
37 // Set printer printable area in in pixels. | 36 // Set printer printable area in in pixels. |
38 void SetPrinterPrintableArea(gfx::Size const& physical_size_pixels, | 37 void SetPrinterPrintableArea(gfx::Size const& physical_size_pixels, |
39 gfx::Rect const& printable_area_pixels); | 38 gfx::Rect const& printable_area_pixels); |
40 | 39 |
41 // Initializes the print parameters that needs to be sent to the renderer | |
42 // process. | |
43 void RenderParams(ViewMsg_Print_Params* params) const; | |
44 | |
45 // Equality operator. | 40 // Equality operator. |
46 // NOTE: printer_name is NOT tested for equality since it doesn't affect the | 41 // NOTE: printer_name is NOT tested for equality since it doesn't affect the |
47 // output. | 42 // output. |
48 bool Equals(const PrintSettings& rhs) const; | 43 bool Equals(const PrintSettings& rhs) const; |
49 | 44 |
50 const std::wstring& printer_name() const { return printer_name_; } | 45 const std::wstring& printer_name() const { return printer_name_; } |
51 void set_device_name(const std::wstring& device_name) { | 46 void set_device_name(const std::wstring& device_name) { |
52 device_name_ = device_name; | 47 device_name_ = device_name; |
53 } | 48 } |
54 const std::wstring& device_name() const { return device_name_; } | 49 const std::wstring& device_name() const { return device_name_; } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 97 |
103 // Printer's device effective dots per inch in both axis. | 98 // Printer's device effective dots per inch in both axis. |
104 int dpi_; | 99 int dpi_; |
105 | 100 |
106 // Is the orientation landscape or portrait. | 101 // Is the orientation landscape or portrait. |
107 bool landscape_; | 102 bool landscape_; |
108 }; | 103 }; |
109 | 104 |
110 } // namespace printing | 105 } // namespace printing |
111 | 106 |
112 #endif // CHROME_BROWSER_PRINTING_PRINT_SETTINGS_H__ | 107 #endif // PRINTING_PRINT_SETTINGS_H_ |
OLD | NEW |