| 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_PDF_RENDER_SETTINGS_H_ | 5 #ifndef PRINTING_PDF_RENDER_SETTINGS_H_ |
| 6 #define PRINTING_PDF_RENDER_SETTINGS_H_ | 6 #define PRINTING_PDF_RENDER_SETTINGS_H_ |
| 7 | 7 |
| 8 #include "base/tuple.h" | 8 #include "base/tuple.h" |
| 9 #include "ipc/ipc_param_traits.h" | 9 #include "ipc/ipc_param_traits.h" |
| 10 #include "printing/printing_export.h" | 10 #include "printing/printing_export.h" |
| 11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
| 12 | 12 |
| 13 namespace printing { | 13 namespace printing { |
| 14 | 14 |
| 15 // Defining PDF rendering settings here as a Tuple as following: | 15 // Defining PDF rendering settings here as a Tuple as following: |
| 16 // gfx::Rect - render area | 16 // gfx::Rect - render area |
| 17 // int - render dpi | 17 // int - render dpi |
| 18 // bool - autorotate pages to fit paper | 18 // bool - autorotate pages to fit paper |
| 19 typedef Tuple3<gfx::Rect, int, bool> PdfRenderSettingsBase; | 19 typedef Tuple3<gfx::Rect, int, bool> PdfRenderSettingsBase; |
| 20 | 20 |
| 21 struct PdfRenderSettings : public PdfRenderSettingsBase { | 21 class PdfRenderSettings : public PdfRenderSettingsBase { |
| 22 public: | 22 public: |
| 23 PdfRenderSettings() : PdfRenderSettingsBase() {} | 23 PdfRenderSettings() : PdfRenderSettingsBase() {} |
| 24 PdfRenderSettings(gfx::Rect area, int dpi, bool autorotate) | 24 PdfRenderSettings(gfx::Rect area, int dpi, bool autorotate) |
| 25 : PdfRenderSettingsBase(area, dpi, autorotate) {} | 25 : PdfRenderSettingsBase(area, dpi, autorotate) {} |
| 26 ~PdfRenderSettings() {} | 26 ~PdfRenderSettings() {} |
| 27 | 27 |
| 28 const gfx::Rect& area() const { return a; } | 28 const gfx::Rect& area() const { return a; } |
| 29 int dpi() const { return b; } | 29 int dpi() const { return b; } |
| 30 bool autorotate() const { return c; } | 30 bool autorotate() const { return c; } |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace printing | 33 } // namespace printing |
| 34 | 34 |
| 35 namespace IPC { | 35 namespace IPC { |
| 36 template <> | 36 template <> |
| 37 struct SimilarTypeTraits<printing::PdfRenderSettings> { | 37 struct SimilarTypeTraits<printing::PdfRenderSettings> { |
| 38 typedef printing::PdfRenderSettingsBase Type; | 38 typedef printing::PdfRenderSettingsBase Type; |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace IPC | 41 } // namespace IPC |
| 42 | 42 |
| 43 #endif // PRINTING_PDF_RENDER_SETTINGS_H_ | 43 #endif // PRINTING_PDF_RENDER_SETTINGS_H_ |
| 44 | 44 |
| OLD | NEW |