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