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