OpenCPN Partial API docs
Loading...
Searching...
No Matches
printout_base.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2010 by David S. Register *
3 * Copyright (C) 2025 by NoCodeHummel *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
25#ifndef PRINTOUT_BASE_H
26#define PRINTOUT_BASE_H
27
28#include <string>
29#include <wx/dc.h>
30#include <wx/print.h>
31
35class BasePrintout : public wxPrintout {
36public:
37 BasePrintout(const std::string &title = _("OpenCPN print").ToStdString());
38
39 // Methods required by wxPrintout.
40 bool HasPage(int page) override;
41 bool OnBeginDocument(int startPage, int endPage) override;
42 void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom,
43 int *selPageTo) override;
44 bool OnPrintPage(int page) override;
45
46protected:
47 int m_pages;
48 int m_margin_x;
49 int m_margin_y;
50
56 virtual void DrawPage(wxDC *dc, int page) = 0;
57};
58
59#endif // PRINTOUT_BASE_H
Application print support.
virtual void DrawPage(wxDC *dc, int page)=0
Called by the print framework to draw the page.