| 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 CHROME_BROWSER_PRINTING_PRINT_SETTINGS_H__ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_SETTINGS_H__ | 6 #define CHROME_BROWSER_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 "chrome/browser/printing/page_overlays.h" |
| 10 #include "chrome/browser/printing/page_range.h" | 10 #include "chrome/browser/printing/page_range.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // Reinitialize the settings to the default values. | 24 // Reinitialize the settings to the default values. |
| 25 void Clear(); | 25 void Clear(); |
| 26 | 26 |
| 27 #ifdef WIN32 | 27 #ifdef WIN32 |
| 28 // Reads the settings from the selected device context. Calculates derived | 28 // Reads the settings from the selected device context. Calculates derived |
| 29 // values like printable_area_. | 29 // values like printable_area_. |
| 30 void Init(HDC hdc, | 30 void Init(HDC hdc, |
| 31 const DEVMODE& dev_mode, | 31 const DEVMODE& dev_mode, |
| 32 const PageRanges& new_ranges, | 32 const PageRanges& new_ranges, |
| 33 const std::wstring& new_device_name); | 33 const std::wstring& new_device_name, |
| 34 bool selection_only); |
| 34 #endif | 35 #endif |
| 35 | 36 |
| 36 // Set printer printable area in in pixels. | 37 // Set printer printable area in in pixels. |
| 37 void SetPrinterPrintableArea(gfx::Size const& physical_size_pixels, | 38 void SetPrinterPrintableArea(gfx::Size const& physical_size_pixels, |
| 38 gfx::Rect const& printable_area_pixels); | 39 gfx::Rect const& printable_area_pixels); |
| 39 | 40 |
| 40 // Initializes the print parameters that needs to be sent to the renderer | 41 // Initializes the print parameters that needs to be sent to the renderer |
| 41 // process. | 42 // process. |
| 42 void RenderParams(ViewMsg_Print_Params* params) const; | 43 void RenderParams(ViewMsg_Print_Params* params) const; |
| 43 | 44 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 71 // behavior matches MacIE and Mozilla, at least) | 72 // behavior matches MacIE and Mozilla, at least) |
| 72 double max_shrink; | 73 double max_shrink; |
| 73 | 74 |
| 74 // Desired visible dots per inch rendering for output. Printing should be | 75 // Desired visible dots per inch rendering for output. Printing should be |
| 75 // scaled to ScreenDpi/dpix*desired_dpi. | 76 // scaled to ScreenDpi/dpix*desired_dpi. |
| 76 int desired_dpi; | 77 int desired_dpi; |
| 77 | 78 |
| 78 // The various overlays (headers and footers). | 79 // The various overlays (headers and footers). |
| 79 PageOverlays overlays; | 80 PageOverlays overlays; |
| 80 | 81 |
| 82 // Indicates if the user only wants to print the current selection. |
| 83 bool selection_only; |
| 84 |
| 81 // Cookie generator. It is used to initialize PrintedDocument with its | 85 // Cookie generator. It is used to initialize PrintedDocument with its |
| 82 // associated PrintSettings, to be sure that each generated PrintedPage is | 86 // associated PrintSettings, to be sure that each generated PrintedPage is |
| 83 // correctly associated with its corresponding PrintedDocument. | 87 // correctly associated with its corresponding PrintedDocument. |
| 84 static int NewCookie(); | 88 static int NewCookie(); |
| 85 | 89 |
| 86 private: | 90 private: |
| 87 ////////////////////////////////////////////////////////////////////////////// | 91 ////////////////////////////////////////////////////////////////////////////// |
| 88 // Settings that can't be changed without side-effects. | 92 // Settings that can't be changed without side-effects. |
| 89 | 93 |
| 90 // Printer name as shown to the user. | 94 // Printer name as shown to the user. |
| 91 std::wstring printer_name_; | 95 std::wstring printer_name_; |
| 92 | 96 |
| 93 // Printer device name as opened by the OS. | 97 // Printer device name as opened by the OS. |
| 94 std::wstring device_name_; | 98 std::wstring device_name_; |
| 95 | 99 |
| 96 // Page setup in pixel units, dpi adjusted. | 100 // Page setup in pixel units, dpi adjusted. |
| 97 PageSetup page_setup_pixels_; | 101 PageSetup page_setup_pixels_; |
| 98 | 102 |
| 99 // Printer's device effective dots per inch in both axis. | 103 // Printer's device effective dots per inch in both axis. |
| 100 int dpi_; | 104 int dpi_; |
| 101 | 105 |
| 102 // Is the orientation landscape or portrait. | 106 // Is the orientation landscape or portrait. |
| 103 bool landscape_; | 107 bool landscape_; |
| 104 }; | 108 }; |
| 105 | 109 |
| 106 } // namespace printing | 110 } // namespace printing |
| 107 | 111 |
| 108 #endif // CHROME_BROWSER_PRINTING_PRINT_SETTINGS_H__ | 112 #endif // CHROME_BROWSER_PRINTING_PRINT_SETTINGS_H__ |
| OLD | NEW |