Implement getDirectory, signal+slot
[LibreOffice.git] / include / i18nutil / paper.hxx
blob75f77de05401eec8500ebbc335608bfd7e0e6a96
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 <com/sun/star/lang/Locale.hpp>
27 //!! The values of the following enumerators must correspond to the array position
28 //!! of the respective paper size in the file i18nutil/source/utility/paper.cxx
29 //!! Thus don't reorder the enum values here without changing the code there as well.
30 enum Paper
32 PAPER_A0,
33 PAPER_A1,
34 PAPER_A2,
35 PAPER_A3,
36 PAPER_A4,
37 PAPER_A5,
38 PAPER_B4_ISO,
39 PAPER_B5_ISO,
40 PAPER_LETTER,
41 PAPER_LEGAL,
42 PAPER_TABLOID,
43 PAPER_USER,
44 PAPER_B6_ISO,
45 PAPER_ENV_C4,
46 PAPER_ENV_C5,
47 PAPER_ENV_C6,
48 PAPER_ENV_C65,
49 PAPER_ENV_DL,
50 PAPER_SLIDE_DIA,
51 PAPER_SCREEN_4_3,
52 PAPER_C,
53 PAPER_D,
54 PAPER_E,
55 PAPER_EXECUTIVE,
56 PAPER_FANFOLD_LEGAL_DE,
57 PAPER_ENV_MONARCH,
58 PAPER_ENV_PERSONAL,
59 PAPER_ENV_9,
60 PAPER_ENV_10,
61 PAPER_ENV_11,
62 PAPER_ENV_12,
63 PAPER_KAI16,
64 PAPER_KAI32,
65 PAPER_KAI32BIG,
66 PAPER_B4_JIS,
67 PAPER_B5_JIS,
68 PAPER_B6_JIS,
69 PAPER_LEDGER,
70 PAPER_STATEMENT,
71 PAPER_QUARTO,
72 PAPER_10x14,
73 PAPER_ENV_14,
74 PAPER_ENV_C3,
75 PAPER_ENV_ITALY,
76 PAPER_FANFOLD_US,
77 PAPER_FANFOLD_DE,
78 PAPER_POSTCARD_JP,
79 PAPER_9x11,
80 PAPER_10x11,
81 PAPER_15x11,
82 PAPER_ENV_INVITE,
83 PAPER_A_PLUS,
84 PAPER_B_PLUS,
85 PAPER_LETTER_PLUS,
86 PAPER_A4_PLUS,
87 PAPER_DOUBLEPOSTCARD_JP,
88 PAPER_A6,
89 PAPER_12x11,
90 PAPER_A7,
91 PAPER_A8,
92 PAPER_A9,
93 PAPER_A10,
94 PAPER_B0_ISO,
95 PAPER_B1_ISO,
96 PAPER_B2_ISO,
97 PAPER_B3_ISO,
98 PAPER_B7_ISO,
99 PAPER_B8_ISO,
100 PAPER_B9_ISO,
101 PAPER_B10_ISO,
102 PAPER_ENV_C2,
103 PAPER_ENV_C7,
104 PAPER_ENV_C8,
105 PAPER_ARCHA,
106 PAPER_ARCHB,
107 PAPER_ARCHC,
108 PAPER_ARCHD,
109 PAPER_ARCHE,
110 PAPER_SCREEN_16_9,
111 PAPER_SCREEN_16_10
114 // defined for 'equal size' test with the implementation array
115 #define NUM_PAPER_ENTRIES (PAPER_SCREEN_16_10 - PAPER_A0 + 1)
118 class I18NUTIL_DLLPUBLIC PaperInfo
120 Paper m_eType;
121 long m_nPaperWidth; // width in 100thMM
122 long m_nPaperHeight; // height in 100thMM
123 public:
124 PaperInfo(Paper eType);
125 PaperInfo(long nPaperWidth, long nPaperHeight);
127 Paper getPaper() const { return m_eType; }
128 long getWidth() const { return m_nPaperWidth; }
129 long getHeight() const { return m_nPaperHeight; }
130 bool sloppyEqual(const PaperInfo &rOther) const;
131 void doSloppyFit();
133 static PaperInfo getSystemDefaultPaper();
134 static PaperInfo getDefaultPaperForLocale(const css::lang::Locale & rLocale);
136 static Paper fromPSName(const OString &rName);
137 static OString toPSName(Paper eType);
139 static long sloppyFitPageDimension(long nDimension);
142 #endif // INCLUDED_I18NUTIL_PAPER_HXX
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */