wxMaxima
Loading...
Searching...
No Matches
Printout.h
Go to the documentation of this file.
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4// (C) 2016 Gunter Königsmann <wxMaxima@physikbuch.de>
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 2 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16//
17// You should have received a copy of the GNU General Public License
18// along with this program; if not, write to the Free Software
19// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20//
21// SPDX-License-Identifier: GPL-2.0+
22
29#ifndef MATHPRINTOUT_H
30#define MATHPRINTOUT_H
31
32#include "precomp.h"
33#include <wx/wx.h>
34#include <wx/print.h>
35#include <wx/dcmemory.h>
36
37#include <vector>
38
39#include "cells/GroupCell.h"
40
41class Printout : public wxPrintout
42{
43public:
44 Printout(wxString title, GroupCell *tree, double scaleFactor);
45
46 /* Determine which cells are the Right places to start a page
47 */
48 void BreakPages();
49
52 void Recalculate();
53
55 virtual bool OnPrintPage(int num) override;
56
57 virtual bool HasPage(int num) override;
58
59 virtual void GetPageInfo(int *minPage, int *maxPage, int *fromPage, int *toPage) override;
60
61 virtual bool OnBeginDocument(int startPage, int endPage) override;
62
63 virtual void OnPreparePrinting() override;
64
65private:
67 std::unique_ptr<GroupCell> m_tree;
69 std::vector<const Cell *> m_pages;
71 Configuration m_configuration;
73 Configuration *const m_configPointer;
74 const double m_scaleFactor;
75 // Sets Configuration::Printing() to true while we print
76 Printing m_printing;
77};
78
79#endif // MATHPRINTOUT_H
This file defines the class GroupCell that bundles input and output in the worksheet.
The configuration storage for the current worksheet.
Definition: Configuration.h:85
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:74
Sets the configuration's "printing" flag until this class is left.
Definition: Configuration.h:1282
Definition: Printout.h:42
void Recalculate()
Determine the sizes of all worksheet objects.
Definition: Printout.cpp:275
virtual bool OnPrintPage(int num) override
Is called by wxWidgets when it wants us to print a specific page.
Definition: Printout.cpp:75