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