Enable chrome with aura for tizen
[platform/framework/web/chromium-efl.git] / printing / units.h
1 // Copyright 2011 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PRINTING_UNITS_H_
6 #define PRINTING_UNITS_H_
7
8 #include "base/component_export.h"
9
10 namespace printing {
11
12 // Length of an inch in 0.001mm unit.
13 constexpr int kMicronsPerInch = 25400;
14
15 // Mil is a thousandth of an inch.
16 constexpr float kMicronsPerMil = 25.4f;
17 constexpr int kMilsPerInch = 1000;
18
19 // Length of an inch in CSS's 1pt unit.
20 // http://dev.w3.org/csswg/css3-values/#absolute-length-units-cm-mm.-in-pt-pc
21 constexpr int kPointsPerInch = 72;
22
23 // Length of an inch in CSS's 1px unit.
24 // http://dev.w3.org/csswg/css3-values/#the-px-unit
25 constexpr int kPixelsPerInch = 96;
26
27 // Dpi used to save to PDF or Cloud Print.
28 constexpr int kDefaultPdfDpi = 300;
29
30 // LETTER: 8.5 x 11 inches
31 constexpr float kLetterWidthInch = 8.5f;
32 constexpr float kLetterHeightInch = 11.0f;
33
34 // LEGAL: 8.5 x 14 inches
35 constexpr float kLegalWidthInch = 8.5f;
36 constexpr float kLegalHeightInch = 14.0f;
37
38 // A4: 8.27 x 11.69 inches
39 constexpr float kA4WidthInch = 8.27f;
40 constexpr float kA4HeightInch = 11.69f;
41
42 // A3: 11.69 x 16.54 inches
43 constexpr float kA3WidthInch = 11.69f;
44 constexpr float kA3HeightInch = 16.54f;
45
46 // Converts from one unit system to another using integer arithmetics.
47 COMPONENT_EXPORT(PRINTING_BASE)
48 int ConvertUnit(float value, int old_unit, int new_unit);
49
50 // Converts from one unit system to another using floats.
51 COMPONENT_EXPORT(PRINTING_BASE)
52 float ConvertUnitFloat(float value, float old_unit, float new_unit);
53
54 }  // namespace printing
55
56 #endif  // PRINTING_UNITS_H_