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