nss: upgrade to release 3.73
[LibreOffice.git] / include / i18nutil / paper.hxx
blob7b99c0861e489a7d67e5b49e0a6972abfe3feefe
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_I18NUTIL_PAPER_HXX
21 #define INCLUDED_I18NUTIL_PAPER_HXX
23 #include <i18nutil/i18nutildllapi.h>
24 #include <rtl/string.hxx>
25 #include <tools/long.hxx>
27 namespace com::sun::star::lang
29 struct Locale;
32 //!! The values of the following enumerators must correspond to the array position
33 //!! of the respective paper size in the file i18nutil/source/utility/paper.cxx
34 //!! Thus don't reorder the enum values here without changing the code there as well.
35 enum Paper : unsigned
37 PAPER_A0,
38 PAPER_A1,
39 PAPER_A2,
40 PAPER_A3,
41 PAPER_A4,
42 PAPER_A5,
43 PAPER_B4_ISO,
44 PAPER_B5_ISO,
45 PAPER_LETTER,
46 PAPER_LEGAL,
47 PAPER_TABLOID,
48 PAPER_USER,
49 PAPER_B6_ISO,
50 PAPER_ENV_C4,
51 PAPER_ENV_C5,
52 PAPER_ENV_C6,
53 PAPER_ENV_C65,
54 PAPER_ENV_DL,
55 PAPER_SLIDE_DIA,
56 PAPER_SCREEN_4_3,
57 PAPER_C,
58 PAPER_D,
59 PAPER_E,
60 PAPER_EXECUTIVE,
61 PAPER_FANFOLD_LEGAL_DE,
62 PAPER_ENV_MONARCH,
63 PAPER_ENV_PERSONAL,
64 PAPER_ENV_9,
65 PAPER_ENV_10,
66 PAPER_ENV_11,
67 PAPER_ENV_12,
68 PAPER_KAI16,
69 PAPER_KAI32,
70 PAPER_KAI32BIG,
71 PAPER_B4_JIS,
72 PAPER_B5_JIS,
73 PAPER_B6_JIS,
74 PAPER_LEDGER,
75 PAPER_STATEMENT,
76 PAPER_QUARTO,
77 PAPER_10x14,
78 PAPER_ENV_14,
79 PAPER_ENV_C3,
80 PAPER_ENV_ITALY,
81 PAPER_FANFOLD_US,
82 PAPER_FANFOLD_DE,
83 PAPER_POSTCARD_JP,
84 PAPER_9x11,
85 PAPER_10x11,
86 PAPER_15x11,
87 PAPER_ENV_INVITE,
88 PAPER_A_PLUS,
89 PAPER_B_PLUS,
90 PAPER_LETTER_PLUS,
91 PAPER_A4_PLUS,
92 PAPER_DOUBLEPOSTCARD_JP,
93 PAPER_A6,
94 PAPER_12x11,
95 PAPER_A7,
96 PAPER_A8,
97 PAPER_A9,
98 PAPER_A10,
99 PAPER_B0_ISO,
100 PAPER_B1_ISO,
101 PAPER_B2_ISO,
102 PAPER_B3_ISO,
103 PAPER_B7_ISO,
104 PAPER_B8_ISO,
105 PAPER_B9_ISO,
106 PAPER_B10_ISO,
107 PAPER_ENV_C2,
108 PAPER_ENV_C7,
109 PAPER_ENV_C8,
110 PAPER_ARCHA,
111 PAPER_ARCHB,
112 PAPER_ARCHC,
113 PAPER_ARCHD,
114 PAPER_ARCHE,
115 PAPER_SCREEN_16_9,
116 PAPER_SCREEN_16_10,
117 PAPER_16K_195x270,
118 PAPER_16K_197x273
121 // defined for 'equal size' test with the implementation array
122 #define NUM_PAPER_ENTRIES (PAPER_16K_197x273 - PAPER_A0 + 1)
124 class I18NUTIL_DLLPUBLIC PaperInfo
126 Paper m_eType;
127 tools::Long m_nPaperWidth; // width in 100thMM
128 tools::Long m_nPaperHeight; // height in 100thMM
129 public:
130 PaperInfo(Paper eType);
131 PaperInfo(tools::Long nPaperWidth, tools::Long nPaperHeight);
133 Paper getPaper() const { return m_eType; }
134 tools::Long getWidth() const { return m_nPaperWidth; }
135 tools::Long getHeight() const { return m_nPaperHeight; }
136 bool sloppyEqual(const PaperInfo& rOther) const;
137 void doSloppyFit(bool bAlsoTryRotated = false);
139 static PaperInfo getSystemDefaultPaper();
140 static PaperInfo getDefaultPaperForLocale(const css::lang::Locale& rLocale);
142 static Paper fromPSName(const OString& rName);
143 static OString toPSName(Paper eType);
145 static tools::Long sloppyFitPageDimension(tools::Long nDimension);
148 #endif // INCLUDED_I18NUTIL_PAPER_HXX
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */