wxMaxima
Loading...
Searching...
No Matches
pdfgridctrl.h
Go to the documentation of this file.
1
2// Name: pdfgridctrl.h
3// Purpose:
4// Author: Blake Madden
5// Created: 2026-06-22
6// Copyright: (c) Blake Madden
7// Licence: wxWindows licence
9
11
12#ifndef _PDF_GRIDCTRL_H_
13#define _PDF_GRIDCTRL_H_
14
15#if wxUSE_GRID
16
17// wxWidgets headers
18#include <wx/defs.h>
19#include <wx/bitmap.h>
20#include <wx/font.h>
21
22#include <functional>
23
24// wxPdfDocument headers
25#include "wx/pdfdocdef.h"
26#include "wx/pdfcolour.h"
27#include "wx/pdffont.h"
28
29class wxGrid;
30
32enum wxPdfGridStyle
33{
34 wxPDF_GRID_STYLE_GRID,
35 wxPDF_GRID_STYLE_SIMPLE
36};
37
39
66class WXDLLIMPEXP_PDFDOC wxPdfGridBitmapProvider
67{
68public:
70 virtual wxBitmap GetCellBitmap(int WXUNUSED(row), int WXUNUSED(col)) const { return wxNullBitmap; }
71
73 virtual wxBitmap GetColHeaderBitmap(int WXUNUSED(col)) const { return wxNullBitmap; }
74
75 virtual ~wxPdfGridBitmapProvider() = default;
76};
77
79
108class WXDLLIMPEXP_PDFDOC wxPdfGridOptions
109{
110public:
112 wxPdfGridOptions();
113
115 void SetHeaderFont(const wxFont& font) { m_headerFont = font; }
117 wxFont GetHeaderFont() const { return m_headerFont; }
118
120 void SetBodyFont(const wxFont& font) { m_bodyFont = font; }
122 wxFont GetBodyFont() const { return m_bodyFont; }
123
125 void SetHeaderPdfFont(const wxPdfFont& font) { m_headerPdfFont = font; }
127 wxPdfFont GetHeaderPdfFont() const { return m_headerPdfFont; }
128
130 void SetBodyPdfFont(const wxPdfFont& font) { m_bodyPdfFont = font; }
132 wxPdfFont GetBodyPdfFont() const { return m_bodyPdfFont; }
133
135 void SetHeaderBackgroundColour(const wxPdfColour& colour) { m_headerBackgroundColour = colour; }
137 wxPdfColour GetHeaderBackgroundColour() const { return m_headerBackgroundColour; }
138
140 void SetHeaderTextColour(const wxPdfColour& colour) { m_headerTextColour = colour; }
142 wxPdfColour GetHeaderTextColour() const { return m_headerTextColour; }
143
145 void SetAlternateRowBackgroundColour(const wxPdfColour& colour) { m_alternateRowBackgroundColour = colour; }
147 wxPdfColour GetAlternateRowBackgroundColour() const { return m_alternateRowBackgroundColour; }
148
150 void SetBorderColour(const wxPdfColour& colour) { m_borderColour = colour; }
152 wxPdfColour GetBorderColour() const { return m_borderColour; }
153
155 void SetDrawRowBorders(bool draw) { m_drawRowBorders = draw; }
157 bool GetDrawRowBorders() const { return m_drawRowBorders; }
158
160 void SetDrawColumnBorders(bool draw) { m_drawColumnBorders = draw; }
162 bool GetDrawColumnBorders() const { return m_drawColumnBorders; }
163
165 void SetShowContinued(bool show) { m_showContinued = show; }
167 bool GetShowContinued() const { return m_showContinued; }
168
170
176 void SetFitToPage(bool fit) { m_fitToPage = fit; }
178 bool GetFitToPage() const { return m_fitToPage; }
179
181
187 void SetStyle(wxPdfGridStyle style) { m_style = style; }
189 wxPdfGridStyle GetStyle() const { return m_style; }
190
192 void SetFromRow(int row) { m_fromRow = row; }
194 int GetFromRow() const { return m_fromRow; }
195
197 void SetFromColumn(int column) { m_fromColumn = column; }
199 int GetFromColumn() const { return m_fromColumn; }
200
202 void SetToRow(int row) { m_toRow = row; }
204 int GetToRow() const { return m_toRow; }
205
207 void SetToColumn(int column) { m_toColumn = column; }
209 int GetToColumn() const { return m_toColumn; }
210
212 void SetIncludeColumnHeaders(bool include) { m_includeColumnHeaders = include; }
214 bool GetIncludeColumnHeaders() const { return m_includeColumnHeaders; }
215
217
222 void SetIncludeRowLabels(bool include) { m_includeRowLabels = include; }
224 bool GetIncludeRowLabels() const { return m_includeRowLabels; }
225
227
232 void SetUseCellAttributes(bool use) { m_useCellAttributes = use; }
234 bool GetUseCellAttributes() const { return m_useCellAttributes; }
235
237
243 void SetBitmapProvider(const wxPdfGridBitmapProvider* provider) { m_bitmapProvider = provider; }
245 const wxPdfGridBitmapProvider* GetBitmapProvider() const { return m_bitmapProvider; }
246
248
252 void SetPageBreakHandler(const std::function<void()>& handler) { m_pageBreakHandler = handler; }
254 const std::function<void()>& GetPageBreakHandler() const { return m_pageBreakHandler; }
255
256private:
257 wxFont m_headerFont;
258 wxFont m_bodyFont;
259 wxPdfFont m_headerPdfFont;
260 wxPdfFont m_bodyPdfFont;
261 wxPdfColour m_headerBackgroundColour;
262 wxPdfColour m_headerTextColour;
263 wxPdfColour m_alternateRowBackgroundColour;
264 wxPdfColour m_borderColour;
265 bool m_drawRowBorders;
266 bool m_drawColumnBorders;
267 bool m_showContinued;
268 bool m_fitToPage;
269 wxPdfGridStyle m_style;
270 int m_fromRow;
271 int m_fromColumn;
272 int m_toRow;
273 int m_toColumn;
274 bool m_includeColumnHeaders;
275 bool m_includeRowLabels;
276 bool m_useCellAttributes;
277 const wxPdfGridBitmapProvider* m_bitmapProvider;
278 std::function<void()> m_pageBreakHandler;
279};
280
281#endif // wxUSE_GRID
282
283#endif // _PDF_GRIDCTRL_H_
Class representing wxPdfDocument colours.
Definition: pdfcolour.h:40
Class representing a font providing a basic interface.
Definition: pdffont.h:29
Interface of the wxPdfColour class.
Compile time switches for the wxPdfDocument component.
Interface of wxPdfFont class.