wxMaxima
Loading...
Searching...
No Matches
WorksheetExport.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) 2012-2013 Doug Ilijev <doug.ilijev@gmail.com>
5// (C) 2015-2026 Gunter Königsmann <wxMaxima@physikbuch.de>
6//
7// This program is free software; you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation; either version 2 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21//
22// SPDX-License-Identifier: GPL-2.0+
23
38#ifndef WORKSHEETEXPORT_H
39#define WORKSHEETEXPORT_H
40
41#include <wx/gdicmn.h>
42#include <wx/string.h>
43#include <wx/textfile.h>
44#include <memory>
45#include <vector>
46
47class Cell;
48class CellPointers;
49class GroupCell;
50class Configuration;
51
52namespace WorksheetExport {
62bool ExportToHTML(GroupCell *tree, Configuration *configuration,
63 const wxString &file,
64 CellPointers *cellPointers, GroupCell *hCaret);
65
72std::unique_ptr<Cell> CopySelection(Cell *start, Cell *end, bool asData = false);
73
75wxSize CopyToFile(const wxString &file, Cell *start, Cell *end, bool asData,
76 double scale, const Configuration *const *configuration);
77
79bool ExportToTeX(GroupCell *tree, Configuration *configuration,
80 const wxString &file);
81
88void ExportToMAC(wxTextFile &output, GroupCell *tree, bool wxm,
89 const std::vector<int> &cellMap, bool fixReorderedIndices);
90
92void AddLineToFile(wxTextFile &output, const wxString &s);
93
99void CalculateReorderedCellIndices(GroupCell *tree, int &cellIndex,
100 std::vector<int> &cellMap);
101
103wxString RTFStart(Configuration *configuration);
104
106wxString RTFEnd();
107} // namespace WorksheetExport
108
109#endif // WORKSHEETEXPORT_H
void CalculateReorderedCellIndices(GroupCell *tree, int &cellIndex, std::vector< int > &cellMap)
Determine the (iN)/(oN) indices a fresh evaluation would assign.
Definition: WorksheetExport.cpp:132
wxString RTFStart(Configuration *configuration)
The RTF document header: font, color and stylesheet tables.
Definition: WorksheetExport.cpp:333
bool ExportToHTML(GroupCell *tree, Configuration *configuration, const wxString &file, CellPointers *cellPointers, GroupCell *hCaret)
Export the tree to an HTML file.
Definition: WorksheetExport.cpp:428
wxSize CopyToFile(const wxString &file, Cell *start, Cell *end, bool asData, double scale, const Configuration *const *configuration)
Render the cell range into an image file; returns the image's size.
Definition: WorksheetExport.cpp:419
wxString RTFEnd()
The RTF document footer matching RTFStart().
Definition: WorksheetExport.cpp:385
void ExportToMAC(wxTextFile &output, GroupCell *tree, bool wxm, const std::vector< int > &cellMap, bool fixReorderedIndices)
Serialize the tree as .wxm (wxm = true) or .mac lines into output.
Definition: WorksheetExport.cpp:183
std::unique_ptr< Cell > CopySelection(Cell *start, Cell *end, bool asData=false)
Copy the cell range into a fresh list of cells.
Definition: WorksheetExport.cpp:390
void AddLineToFile(wxTextFile &output, const wxString &s)
Add a (possibly multi-line) string to output as individual lines.
Definition: WorksheetExport.cpp:117
bool ExportToTeX(GroupCell *tree, Configuration *configuration, const wxString &file)
Export the tree to a LaTeX document; images go to a <name>_img directory.
Definition: WorksheetExport.cpp:221
The storage for pointers to cells.
Definition: CellPointers.h:45
The base class all cell types the worksheet can consist of are derived from.
Definition: Cell.h:141
The configuration storage for the current worksheet.
Definition: Configuration.h:97
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:87