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