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 "i18nutildllapi.h"
24 #include <rtl/string.hxx>
25 #include <com/sun/star/lang/Locale.hpp>
27 //!! WARNING: be aware of cui/source/tabpages/page.h where someone had the broken idea
28 //!! of duplicating the values of this enum in order to use those defines within
30 //!! Thus don't reorder the enum values here without changing the code there as well.
57 PAPER_FANFOLD_LEGAL_DE
,
88 PAPER_DOUBLEPOSTCARD_JP
,
115 // defined for 'equal size' test with the implementation array
116 #define NUM_PAPER_ENTRIES (PAPER_SCREEN_16_10 - PAPER_A0 + 1)
122 class I18NUTIL_DLLPUBLIC PaperInfo
125 long m_nPaperWidth
; // width in 100thMM
126 long m_nPaperHeight
; // height in 100thMM
128 PaperInfo(Paper eType
);
129 PaperInfo(long nPaperWidth
, long nPaperHeight
);
131 Paper
getPaper() const { return m_eType
; }
132 long getWidth() const { return m_nPaperWidth
; }
133 long getHeight() const { return m_nPaperHeight
; }
134 bool sloppyEqual(const PaperInfo
&rOther
) const;
137 static PaperInfo
getSystemDefaultPaper();
138 static PaperInfo
getDefaultPaperForLocale(const ::com::sun::star::lang::Locale
& rLocale
);
140 static Paper
fromPSName(const OString
&rName
);
141 static OString
toPSName(Paper eType
);
143 static long sloppyFitPageDimension(long nDimension
);
146 #endif // INCLUDED_I18NUTIL_PAPER_HXX
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */