OpenXLSX 1.9.1
Loading...
Searching...
No Matches
XLPageSetup.hpp
Go to the documentation of this file.
1#ifndef OPENXLSX_XLPAGESETUP_HPP
2#define OPENXLSX_XLPAGESETUP_HPP
3
4// ===== OpenXLSX Includes ===== //
5#include "OpenXLSX-Exports.hpp"
6#include "XLConstants.hpp"
7#include "XLXmlParser.hpp"
8
9namespace OpenXLSX
10{
15
19 class OPENXLSX_EXPORT XLPageMargins
20 {
21 public:
22 XLPageMargins() = default;
23 explicit XLPageMargins(const XMLNode& node);
24
25 double left() const;
26 XLPageMargins& setLeft(double value);
27 XLPageMargins& setLeft(XLDistance value);
28
29 double right() const;
30 XLPageMargins& setRight(double value);
31 XLPageMargins& setRight(XLDistance value);
32
33 double top() const;
34 XLPageMargins& setTop(double value);
35 XLPageMargins& setTop(XLDistance value);
36
37 double bottom() const;
38 XLPageMargins& setBottom(double value);
39 XLPageMargins& setBottom(XLDistance value);
40
41 double header() const;
42 XLPageMargins& setHeader(double value);
43 XLPageMargins& setHeader(XLDistance value);
44
45 double footer() const;
46 XLPageMargins& setFooter(double value);
47 XLPageMargins& setFooter(XLDistance value);
48
49 private:
50 XMLNode m_node;
51 };
52
56 class OPENXLSX_EXPORT XLPrintOptions
57 {
58 public:
59 XLPrintOptions() = default;
60 explicit XLPrintOptions(const XMLNode& node);
61
62 bool gridLines() const;
63 void setGridLines(bool value);
64
65 bool headings() const;
66 void setHeadings(bool value);
67
68 bool horizontalCentered() const;
69 void setHorizontalCentered(bool value);
70
71 bool verticalCentered() const;
72 void setVerticalCentered(bool value);
73
74 private:
75 XMLNode m_node;
76 };
77
84 class OPENXLSX_EXPORT XLHeaderFooter
85 {
86 public:
87 XLHeaderFooter() = default;
88 explicit XLHeaderFooter(const XMLNode& node);
89
90 [[nodiscard]] bool differentFirst() const;
91 void setDifferentFirst(bool value);
92
93 [[nodiscard]] bool differentOddEven() const;
94 void setDifferentOddEven(bool value);
95
96 [[nodiscard]] bool scaleWithDoc() const;
97 void setScaleWithDoc(bool value);
98
99 [[nodiscard]] bool alignWithMargins() const;
100 void setAlignWithMargins(bool value);
101
102 [[nodiscard]] std::string oddHeader() const;
103 void setOddHeader(std::string_view value);
104
105 [[nodiscard]] std::string oddFooter() const;
106 void setOddFooter(std::string_view value);
107
108 [[nodiscard]] std::string evenHeader() const;
109 void setEvenHeader(std::string_view value);
110
111 [[nodiscard]] std::string evenFooter() const;
112 void setEvenFooter(std::string_view value);
113
114 [[nodiscard]] std::string firstHeader() const;
115 void setFirstHeader(std::string_view value);
116
117 [[nodiscard]] std::string firstFooter() const;
118 void setFirstFooter(std::string_view value);
119
120 private:
121 XMLNode m_node;
122 };
123
124 class OPENXLSX_EXPORT XLPageSetup
125 {
126 public:
127 XLPageSetup() = default;
128 explicit XLPageSetup(const XMLNode& node);
129
130 uint32_t paperSize() const;
131 XLPageSetup& setPaperSize(uint32_t value);
132
133 XLPageOrientation orientation() const;
134 XLPageSetup& setOrientation(XLPageOrientation value);
135
136 uint32_t scale() const;
137 XLPageSetup& setScale(uint32_t value);
138
139 uint32_t fitToWidth() const;
140 XLPageSetup& setFitToWidth(uint32_t value);
141
142 uint32_t fitToHeight() const;
143 XLPageSetup& setFitToHeight(uint32_t value);
144
145 [[nodiscard]] std::string pageOrder() const;
146 XLPageSetup& setPageOrder(std::string_view value);
147
148 [[nodiscard]] bool useFirstPageNumber() const;
149 XLPageSetup& setUseFirstPageNumber(bool value);
150
151 [[nodiscard]] uint32_t firstPageNumber() const;
152 XLPageSetup& setFirstPageNumber(uint32_t value);
153
154 bool blackAndWhite() const;
155 XLPageSetup& setBlackAndWhite(bool value);
156
157 private:
158 XMLNode m_node;
159 };
160
161} // namespace OpenXLSX
162
163#endif // OPENXLSX_XLPAGESETUP_HPP
Definition XLXmlParser.hpp:84
Definition XLConstants.hpp:32
A class representing the page setup of a worksheet.
Definition XLPageSetup.hpp:85
A class representing the page margins of a worksheet.
Definition XLPageSetup.hpp:20
Definition XLPageSetup.hpp:125
A class representing the print options of a worksheet.
Definition XLPageSetup.hpp:57
Definition IZipArchive.hpp:18
XLPageOrientation
Enum defining page orientation.
Definition XLPageSetup.hpp:14