Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PAGE_SETUP_H_ | 5 #ifndef PRINTING_PAGE_SETUP_H_ |
| 6 #define PRINTING_PAGE_SETUP_H_ | 6 #define PRINTING_PAGE_SETUP_H_ |
| 7 | 7 |
| 8 #include "printing/printing_export.h" | 8 #include "printing/printing_export.h" |
| 9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 const gfx::Size& physical_size() const { return physical_size_; } | 58 const gfx::Size& physical_size() const { return physical_size_; } |
| 59 const gfx::Rect& overlay_area() const { return overlay_area_; } | 59 const gfx::Rect& overlay_area() const { return overlay_area_; } |
| 60 const gfx::Rect& content_area() const { return content_area_; } | 60 const gfx::Rect& content_area() const { return content_area_; } |
| 61 const gfx::Rect& printable_area() const { return printable_area_; } | 61 const gfx::Rect& printable_area() const { return printable_area_; } |
| 62 const PageMargins& effective_margins() const { | 62 const PageMargins& effective_margins() const { |
| 63 return effective_margins_; | 63 return effective_margins_; |
| 64 } | 64 } |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 // Calculate overlay_area_, effective_margins_, and content_area_, based on | 67 // Calculate overlay_area_, effective_margins_, and content_area_, based on |
| 68 // a constraint of |bounds|. | 68 // a constraint of |bounds|. |
|
dpapad
2011/10/17 23:03:03
Nit: Update comment.
vandebo (ex-Chrome)
2011/10/17 23:16:54
Done.
| |
| 69 void CalculateSizesWithinRect(const gfx::Rect& bounds); | 69 void CalculateSizesWithinRect(const gfx::Rect& bounds, int text_height); |
| 70 | 70 |
| 71 // Physical size of the page, including non-printable margins. | 71 // Physical size of the page, including non-printable margins. |
| 72 gfx::Size physical_size_; | 72 gfx::Size physical_size_; |
| 73 | 73 |
| 74 // The printable area as specified by the printer driver. We can't get | 74 // The printable area as specified by the printer driver. We can't get |
| 75 // larger than this. | 75 // larger than this. |
| 76 gfx::Rect printable_area_; | 76 gfx::Rect printable_area_; |
| 77 | 77 |
| 78 // The printable area for headers and footers. | 78 // The printable area for headers and footers. |
| 79 gfx::Rect overlay_area_; | 79 gfx::Rect overlay_area_; |
| 80 | 80 |
| 81 // The printable area as selected by the user's margins. | 81 // The printable area as selected by the user's margins. |
| 82 gfx::Rect content_area_; | 82 gfx::Rect content_area_; |
| 83 | 83 |
| 84 // Effective margins. | 84 // Effective margins. |
| 85 PageMargins effective_margins_; | 85 PageMargins effective_margins_; |
| 86 | 86 |
| 87 // Requested margins. | 87 // Requested margins. |
| 88 PageMargins requested_margins_; | 88 PageMargins requested_margins_; |
| 89 | 89 |
| 90 // Space that must be kept free for the overlays. | 90 // Space that must be kept free for the overlays. |
| 91 int text_height_; | 91 int text_height_; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace printing | 94 } // namespace printing |
| 95 | 95 |
| 96 #endif // PRINTING_PAGE_SETUP_H_ | 96 #endif // PRINTING_PAGE_SETUP_H_ |
| OLD | NEW |