Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / printing / pdf_render_settings.h
blob3f8f38bab3b0b844e25b0f0ac4faf69fafd40fac
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
3 // found in the LICENSE file.
5 #ifndef PRINTING_PDF_RENDER_SETTINGS_H_
6 #define PRINTING_PDF_RENDER_SETTINGS_H_
8 #include "base/tuple.h"
9 #include "ipc/ipc_param_traits.h"
10 #include "printing/printing_export.h"
11 #include "ui/gfx/geometry/rect.h"
13 namespace printing {
15 // Defining PDF rendering settings here as a Tuple as following:
16 // gfx::Rect - render area
17 // int - render dpi
18 // bool - autorotate pages to fit paper
19 typedef base::Tuple<gfx::Rect, int, bool> PdfRenderSettingsBase;
21 class PdfRenderSettings : public PdfRenderSettingsBase {
22 public:
23 PdfRenderSettings() : PdfRenderSettingsBase() {}
24 PdfRenderSettings(gfx::Rect area, int dpi, bool autorotate)
25 : PdfRenderSettingsBase(area, dpi, autorotate) {}
26 ~PdfRenderSettings() {}
28 const gfx::Rect& area() const { return base::get<0>(*this); }
29 int dpi() const { return base::get<1>(*this); }
30 bool autorotate() const { return base::get<2>(*this); }
33 } // namespace printing
35 namespace IPC {
36 template <>
37 struct SimilarTypeTraits<printing::PdfRenderSettings> {
38 typedef printing::PdfRenderSettingsBase Type;
41 } // namespace IPC
43 #endif // PRINTING_PDF_RENDER_SETTINGS_H_