tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / sc / source / filter / inc / xlpage.hxx
blobd200e8b804ab6400be778ad16f6e2a7698683ae4
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 #pragma once
22 #include <tools/gen.hxx>
23 #include "ftools.hxx"
24 #include <memory>
26 // Constants and Enumerations =================================================
28 // (0x0014, 0x0015) HEADER, FOOTER --------------------------------------------
30 const sal_uInt16 EXC_ID_HEADER = 0x0014;
31 const sal_uInt16 EXC_ID_FOOTER = 0x0015;
33 // (0x0016, 0x0017) EVEN HEADER, EVEN FOOTER ----------------------------------
35 const sal_uInt16 EXC_ID_HEADER_EVEN = 0x0016;
36 const sal_uInt16 EXC_ID_FOOTER_EVEN = 0x0017;
38 // (0x0018, 0x0019) FIRST HEADER, FIRST FOOTER ----------------------------------
40 const sal_uInt16 EXC_ID_HEADER_FIRST = 0x0018;
41 const sal_uInt16 EXC_ID_FOOTER_FIRST = 0x0019;
43 // (0x001A, 0x001B) VERTICAL-, HORIZONTALPAGEBREAKS ---------------------------
45 const sal_uInt16 EXC_ID_VERPAGEBREAKS = 0x001A;
46 const sal_uInt16 EXC_ID_HORPAGEBREAKS = 0x001B;
48 // (0x0026, 0x0027, 0x0028, 0x0029) LEFT-, RIGHT-, TOP-, BOTTOMMARGIN ---------
50 const sal_uInt16 EXC_ID_LEFTMARGIN = 0x0026;
51 const sal_uInt16 EXC_ID_RIGHTMARGIN = 0x0027;
52 const sal_uInt16 EXC_ID_TOPMARGIN = 0x0028;
53 const sal_uInt16 EXC_ID_BOTTOMMARGIN = 0x0029;
55 const sal_Int32 EXC_MARGIN_DEFAULT_LR = 1900; /// Left/right default margin in 1/100mm.
56 const sal_Int32 EXC_MARGIN_DEFAULT_TB = 2500; /// Top/bottom default margin in 1/100mm.
57 const sal_Int32 EXC_MARGIN_DEFAULT_HF = 1300; /// Header/footer default margin in 1/100mm.
58 const sal_Int32 EXC_MARGIN_DEFAULT_HLR = 1900; /// Left/right header default margin in 1/100mm.
59 const sal_Int32 EXC_MARGIN_DEFAULT_FLR = 1900; /// Left/right footer default margin in 1/100mm.
61 // (0x002A, 0x002B) PRINTHEADERS, PRINTGRIDLINES ------------------------------
63 const sal_uInt16 EXC_ID_PRINTHEADERS = 0x002A;
64 const sal_uInt16 EXC_ID_PRINTGRIDLINES = 0x002B;
66 // (0x0033) PRINTSIZE ---------------------------------------------------------
68 const sal_uInt16 EXC_ID_PRINTSIZE = 0x0033;
70 const sal_uInt16 EXC_PRINTSIZE_SCREEN = 1;
71 const sal_uInt16 EXC_PRINTSIZE_PAGE = 2;
72 const sal_uInt16 EXC_PRINTSIZE_FULL = 3;
74 // (0x0082, 0x0083, 0x0084) GRIDSET, HCENTER, VCENTER -------------------------
76 const sal_uInt16 EXC_ID_GRIDSET = 0x0082;
77 const sal_uInt16 EXC_ID_HCENTER = 0x0083;
78 const sal_uInt16 EXC_ID_VCENTER = 0x0084;
80 // (0x00A1) SETUP -------------------------------------------------------------
82 const sal_uInt16 EXC_ID_SETUP = 0x00A1;
84 const sal_uInt16 EXC_SETUP_INROWS = 0x0001;
85 const sal_uInt16 EXC_SETUP_PORTRAIT = 0x0002;
86 const sal_uInt16 EXC_SETUP_INVALID = 0x0004;
87 const sal_uInt16 EXC_SETUP_BLACKWHITE = 0x0008;
88 const sal_uInt16 EXC_SETUP_DRAFT = 0x0010;
89 const sal_uInt16 EXC_SETUP_PRINTNOTES = 0x0020;
90 const sal_uInt16 EXC_SETUP_STARTPAGE = 0x0080;
91 const sal_uInt16 EXC_SETUP_NOTES_END = 0x0200;
93 const sal_uInt16 EXC_PAPERSIZE_DEFAULT = 0;
94 const sal_uInt16 EXC_PAPERSIZE_USER = 0xFFFF;
96 // Page settings ==============================================================
98 class SvxBrushItem;
100 /** Contains all page (print) settings for a single sheet. */
101 struct XclPageData
103 /** noncopyable */
104 XclPageData(const XclPageData&) = delete;
105 const XclPageData& operator=(const XclPageData&) = delete;
107 typedef std::unique_ptr< SvxBrushItem > SvxBrushItemPtr;
109 ScfUInt16Vec maHorPageBreaks; /// Horizontal page breaks.
110 ScfUInt16Vec maVerPageBreaks; /// Vertical page breaks.
111 SvxBrushItemPtr mxBrushItem; /// Background bitmap.
112 OUString maHeader; /// Excel header string (empty = off).
113 OUString maFooter; /// Excel footer string (empty = off).
114 OUString maHeaderEven; /// Excel header string for even pages (empty = off).
115 OUString maFooterEven; /// Excel footer string for even pages (empty = off).
116 OUString maHeaderFirst; /// Excel header string for first page (empty = off).
117 OUString maFooterFirst; /// Excel footer string for first page (empty = off).
118 double mfLeftMargin; /// Left margin in inches.
119 double mfRightMargin; /// Right margin in inches.
120 double mfTopMargin; /// Top margin in inches.
121 double mfBottomMargin; /// Bottom margin in inches.
122 double mfHeaderMargin; /// Margin main page to header.
123 double mfFooterMargin; /// Margin main page to footer.
124 double mfHdrLeftMargin; /// Left margin to header.
125 double mfHdrRightMargin; /// Right margin to header.
126 double mfFtrLeftMargin; /// Left margin to footer.
127 double mfFtrRightMargin; /// Right margin to footer.
128 sal_uInt16 mnPaperSize; /// Index into paper size table.
129 sal_uInt16 mnStrictPaperSize; /// Same as papersize - but for ooxml (considering stricter dimensions)
130 sal_uInt16 mnPaperWidth; /// Paper Width in mm
131 sal_uInt16 mnPaperHeight; /// Paper Height in mm
132 sal_uInt16 mnCopies; /// Number of copies.
133 sal_uInt16 mnStartPage; /// Start page number.
134 sal_uInt16 mnScaling; /// Scaling in percent.
135 sal_uInt16 mnFitToWidth; /// Fit to number of pages in width.
136 sal_uInt16 mnFitToHeight; /// Fit to number of pages in height.
137 sal_uInt16 mnHorPrintRes; /// Horizontal printing resolution.
138 sal_uInt16 mnVerPrintRes; /// Vertical printing resolution.
139 bool mbUseEvenHF; /// True = use maHeaderEven/maFooterEven.
140 bool mbUseFirstHF; /// True = use maHeaderFirst/maFooterFirst.
141 bool mbValid; /// false = some of the values are not valid.
142 bool mbPortrait; /// true = portrait; false = landscape.
143 bool mbPrintInRows; /// true = in rows; false = in columns.
144 bool mbBlackWhite; /// true = black/white; false = colors.
145 bool mbDraftQuality; /// true = draft; false = default quality.
146 bool mbPrintNotes; /// true = print notes.
147 bool mbManualStart; /// true = mnStartPage valid; false = automatic.
148 bool mbFitToPages; /// true = fit to pages; false = scale in percent.
149 bool mbHorCenter; /// true = centered horizontally; false = left aligned.
150 bool mbVerCenter; /// true = centered vertically; false = top aligned.
151 bool mbPrintHeadings; /// true = print column and row headings.
152 bool mbPrintGrid; /// true = print grid lines.
154 explicit XclPageData();
155 ~XclPageData();
157 /** Sets Excel default page settings. */
158 void SetDefaults();
160 /** Returns the real paper size (twips) from the paper size index and paper orientation. */
161 Size GetScPaperSize() const;
162 /** Sets the Excel paper size index and paper orientation from Calc paper size (twips). */
163 void SetScPaperSize( const Size& rSize, bool bPortrait, bool bStrict = false );
166 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */