wxMaxima
Loading...
Searching...
No Matches
pdflistctrl.h
Go to the documentation of this file.
1
2// Name: pdflistctrl.h
3// Purpose:
4// Author: Blake Madden
5// Created: 2026-06-10
6// Copyright: (c) Blake Madden
7// Licence: wxWindows licence
9
11
12#ifndef _PDF_LISTCTRL_H_
13#define _PDF_LISTCTRL_H_
14
15// wxWidgets headers
16#include <wx/defs.h>
17#include <wx/font.h>
18
19#include <functional>
20
21// wxPdfDocument headers
22#include "wx/pdfdocdef.h"
23#include "wx/pdfcolour.h"
24#include "wx/pdffont.h"
25
26class wxListCtrl;
27
30{
33};
34
36
65class WXDLLIMPEXP_PDFDOC wxPdfListCtrlOptions
66{
67public:
70
72
75 void SetHeaderFont(const wxFont& font) { m_headerFont = font; }
76
78
81 wxFont GetHeaderFont() const { return m_headerFont; }
82
84
87 void SetBodyFont(const wxFont& font) { m_bodyFont = font; }
88
90
93 wxFont GetBodyFont() const { return m_bodyFont; }
94
96
99 void SetHeaderPdfFont(const wxPdfFont& font) { m_headerPdfFont = font; }
100
102
105 wxPdfFont GetHeaderPdfFont() const { return m_headerPdfFont; }
106
108
111 void SetBodyPdfFont(const wxPdfFont& font) { m_bodyPdfFont = font; }
112
114
117 wxPdfFont GetBodyPdfFont() const { return m_bodyPdfFont; }
118
120
123 void SetHeaderBackgroundColour(const wxPdfColour& colour) { m_headerBackgroundColour = colour; }
124
126
129 wxPdfColour GetHeaderBackgroundColour() const { return m_headerBackgroundColour; }
130
132
135 void SetHeaderTextColour(const wxPdfColour& colour) { m_headerTextColour = colour; }
136
138
141 wxPdfColour GetHeaderTextColour() const { return m_headerTextColour; }
142
144
147 void SetAlternateRowBackgroundColour(const wxPdfColour& colour) { m_alternateRowBackgroundColour = colour; }
148
150
153 wxPdfColour GetAlternateRowBackgroundColour() const { return m_alternateRowBackgroundColour; }
154
156
159 void SetBorderColour(const wxPdfColour& colour) { m_borderColour = colour; }
160
162
165 wxPdfColour GetBorderColour() const { return m_borderColour; }
166
168
171 void SetDrawRowBorders(bool draw) { m_drawRowBorders = draw; }
172
174
177 bool GetDrawRowBorders() const { return m_drawRowBorders; }
178
180
183 void SetDrawColumnBorders(bool draw) { m_drawColumnBorders = draw; }
184
186
189 bool GetDrawColumnBorders() const { return m_drawColumnBorders; }
190
192
195 void SetShowContinued(bool show) { m_showContinued = show; }
196
198
201 bool GetShowContinued() const { return m_showContinued; }
202
204
211 void SetFitToPage(bool fit) { m_fitToPage = fit; }
212
214
217 bool GetFitToPage() const { return m_fitToPage; }
218
220
226 void SetStyle(wxPdfListCtrlStyle style) { m_style = style; }
227
229
232 wxPdfListCtrlStyle GetStyle() const { return m_style; }
233
235
238 void SetFromRow(int row) { m_fromRow = row; }
239
241
244 int GetFromRow() const { return m_fromRow; }
245
247
250 void SetFromColumn(int column) { m_fromColumn = column; }
251
253
256 int GetFromColumn() const { return m_fromColumn; }
257
259
262 void SetToRow(int row) { m_toRow = row; }
263
265
268 int GetToRow() const { return m_toRow; }
269
271
274 void SetToColumn(int column) { m_toColumn = column; }
275
277
280 int GetToColumn() const { return m_toColumn; }
281
283
286 void SetIncludeColumnHeaders(bool include) { m_includeColumnHeaders = include; }
287
289
292 bool GetIncludeColumnHeaders() const { return m_includeColumnHeaders; }
293
295
299 void SetPageBreakHandler(const std::function<void()>& handler) { m_pageBreakHandler = handler; }
300
302
305 const std::function<void()>& GetPageBreakHandler() const { return m_pageBreakHandler; }
306
307private:
308 wxFont m_headerFont;
309 wxFont m_bodyFont;
310 wxPdfFont m_headerPdfFont;
311 wxPdfFont m_bodyPdfFont;
312 wxPdfColour m_headerBackgroundColour;
313 wxPdfColour m_headerTextColour;
314 wxPdfColour m_alternateRowBackgroundColour;
315 wxPdfColour m_borderColour;
316 bool m_drawRowBorders;
317 bool m_drawColumnBorders;
318 bool m_showContinued;
319 bool m_fitToPage;
320 wxPdfListCtrlStyle m_style;
321 int m_fromRow;
322 int m_fromColumn;
323 int m_toRow;
324 int m_toColumn;
325 bool m_includeColumnHeaders;
326 std::function<void()> m_pageBreakHandler;
327};
328
329#endif
Class representing wxPdfDocument colours.
Definition: pdfcolour.h:40
Class representing a font providing a basic interface.
Definition: pdffont.h:29
Options that control how a wxListCtrl is rendered into a PDF document.
Definition: pdflistctrl.h:66
void SetFromRow(int row)
Set the starting row (1-indexed)
Definition: pdflistctrl.h:238
void SetBodyPdfFont(const wxPdfFont &font)
Set the PDF font for the list items (takes precedence over SetBodyFont())
Definition: pdflistctrl.h:111
void SetStyle(wxPdfListCtrlStyle style)
Set the table rendering style.
Definition: pdflistctrl.h:226
int GetToRow() const
Get the ending row (1-indexed, -1 for all)
Definition: pdflistctrl.h:268
void SetShowContinued(bool show)
Set whether to show "Continued on next page" and "(continued)" labels.
Definition: pdflistctrl.h:195
bool GetDrawColumnBorders() const
Check whether to draw vertical borders between columns.
Definition: pdflistctrl.h:189
void SetFromColumn(int column)
Set the starting column (1-indexed)
Definition: pdflistctrl.h:250
const std::function< void()> & GetPageBreakHandler() const
Get the function that starts each continuation page of the table.
Definition: pdflistctrl.h:305
int GetFromColumn() const
Get the starting column (1-indexed)
Definition: pdflistctrl.h:256
wxPdfListCtrlOptions()
Default constructor.
void SetHeaderBackgroundColour(const wxPdfColour &colour)
Set the background colour for the column headers.
Definition: pdflistctrl.h:123
wxPdfFont GetBodyPdfFont() const
Get the PDF font for the list items.
Definition: pdflistctrl.h:117
void SetIncludeColumnHeaders(bool include)
Set whether column headers should be exported.
Definition: pdflistctrl.h:286
wxPdfColour GetHeaderTextColour() const
Get the text colour for the column headers.
Definition: pdflistctrl.h:141
bool GetDrawRowBorders() const
Check whether to draw horizontal borders between rows.
Definition: pdflistctrl.h:177
int GetFromRow() const
Get the starting row (1-indexed)
Definition: pdflistctrl.h:244
wxPdfFont GetHeaderPdfFont() const
Get the PDF font for the column headers.
Definition: pdflistctrl.h:105
bool GetIncludeColumnHeaders() const
Check whether column headers should be exported.
Definition: pdflistctrl.h:292
void SetDrawColumnBorders(bool draw)
Set whether to draw vertical borders between columns.
Definition: pdflistctrl.h:183
int GetToColumn() const
Get the ending column (1-indexed, -1 for all)
Definition: pdflistctrl.h:280
wxPdfColour GetHeaderBackgroundColour() const
Get the background colour for the column headers.
Definition: pdflistctrl.h:129
void SetAlternateRowBackgroundColour(const wxPdfColour &colour)
Set the background colour for alternate rows.
Definition: pdflistctrl.h:147
wxPdfColour GetBorderColour() const
Get the colour for borders.
Definition: pdflistctrl.h:165
void SetFitToPage(bool fit)
Set whether to stretch the table to the full printable page width.
Definition: pdflistctrl.h:211
void SetHeaderPdfFont(const wxPdfFont &font)
Set the PDF font for the column headers (takes precedence over SetHeaderFont())
Definition: pdflistctrl.h:99
wxFont GetHeaderFont() const
Get the font for the column headers.
Definition: pdflistctrl.h:81
void SetDrawRowBorders(bool draw)
Set whether to draw horizontal borders between rows.
Definition: pdflistctrl.h:171
void SetBorderColour(const wxPdfColour &colour)
Set the colour for borders.
Definition: pdflistctrl.h:159
void SetToColumn(int column)
Set the ending column (1-indexed, -1 for all)
Definition: pdflistctrl.h:274
wxPdfListCtrlStyle GetStyle() const
Get the table rendering style.
Definition: pdflistctrl.h:232
void SetToRow(int row)
Set the ending row (1-indexed, -1 for all)
Definition: pdflistctrl.h:262
void SetHeaderTextColour(const wxPdfColour &colour)
Set the text colour for the column headers.
Definition: pdflistctrl.h:135
wxFont GetBodyFont() const
Get the font for the list items.
Definition: pdflistctrl.h:93
void SetPageBreakHandler(const std::function< void()> &handler)
Set a function to call instead of wxPdfDocument::AddPage() when the table fills a page.
Definition: pdflistctrl.h:299
bool GetFitToPage() const
Check whether the table is stretched to the full printable page width.
Definition: pdflistctrl.h:217
void SetHeaderFont(const wxFont &font)
Set the font for the column headers.
Definition: pdflistctrl.h:75
wxPdfColour GetAlternateRowBackgroundColour() const
Get the background colour for alternate rows.
Definition: pdflistctrl.h:153
bool GetShowContinued() const
Check whether to show "Continued on next page" and "(continued)" labels.
Definition: pdflistctrl.h:201
void SetBodyFont(const wxFont &font)
Set the font for the list items.
Definition: pdflistctrl.h:87
Interface of the wxPdfColour class.
Compile time switches for the wxPdfDocument component.
Interface of wxPdfFont class.
wxPdfListCtrlStyle
Table rendering style for wxListCtrl export.
Definition: pdflistctrl.h:30
@ wxPDF_LISTCTRL_STYLE_SIMPLE
Horizontal rules only — no vertical lines or cell fills (LaTeX booktabs style)
Definition: pdflistctrl.h:32
@ wxPDF_LISTCTRL_STYLE_GRID
Full grid with borders and optional cell fills (default)
Definition: pdflistctrl.h:31