LibreOffice Module i18nutil (master)  1
paper.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_I18NUTIL_PAPER_HXX
21 #define INCLUDED_I18NUTIL_PAPER_HXX
22 
24 #include <rtl/string.hxx>
25 #include <tools/long.hxx>
26 
27 namespace com::sun::star::lang
28 {
29 struct Locale;
30 }
31 
35 
39 enum Paper : unsigned
40 {
123  PAPER_WIDESCREEN, //PowerPoint Widescreen
124  PAPER_ONSCREENSHOW_4_3, //PowerPoint On-screen Show (4:3)
125  PAPER_ONSCREENSHOW_16_9, //PowerPoint On-screen Show (16:9)
126  PAPER_ONSCREENSHOW_16_10 //PowerPoint On-screen Show (16:10)
127 };
128 
129 // defined for 'equal size' test with the implementation array
130 #define NUM_PAPER_ENTRIES (PAPER_ONSCREENSHOW_16_10 - PAPER_A0 + 1)
131 
133 {
134  Paper m_eType;
135  tools::Long m_nPaperWidth; // width in 100thMM
136  tools::Long m_nPaperHeight; // height in 100thMM
137 public:
139  PaperInfo(tools::Long nPaperWidth, tools::Long nPaperHeight);
140 
141  Paper getPaper() const { return m_eType; }
142  tools::Long getWidth() const { return m_nPaperWidth; }
143  tools::Long getHeight() const { return m_nPaperHeight; }
144  bool sloppyEqual(const PaperInfo& rOther) const;
145  void doSloppyFit(bool bAlsoTryRotated = false);
146 
147  static PaperInfo getSystemDefaultPaper();
148  static PaperInfo getDefaultPaperForLocale(const css::lang::Locale& rLocale);
149 
150  static Paper fromPSName(const OString& rName);
151  static OString toPSName(Paper eType);
152 
153  static tools::Long sloppyFitPageDimension(tools::Long nDimension);
154 };
155 
156 #endif // INCLUDED_I18NUTIL_PAPER_HXX
157 
158 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define I18NUTIL_DLLPUBLIC
long Long
DocumentType eType
Paper
! The values of the following enumerators must correspond to the array position ! of the respective p...
Definition: paper.hxx:39
const EnumerationType m_eType