1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
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.
61 PAPER_FANFOLD_LEGAL_DE
,
92 PAPER_DOUBLEPOSTCARD_JP
,
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
127 tools::Long m_nPaperWidth
; // width in 100thMM
128 tools::Long m_nPaperHeight
; // height in 100thMM
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: */