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;
49class GroupCell;
50class Configuration;
51
52namespace WorksheetExport {
62bool ExportToHTML(GroupCell *tree, Configuration *configuration,
63 const wxString &file,
64 ViewCellPointers *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, ViewCellPointers *cellPointers,
81 GroupCell *hCaret);
82
89void ExportToMAC(wxTextFile &output, GroupCell *tree, bool wxm,
90 const std::vector<int> &cellMap, bool fixReorderedIndices);
91
93void AddLineToFile(wxTextFile &output, const wxString &s);
94
100void CalculateReorderedCellIndices(GroupCell *tree, int &cellIndex,
101 std::vector<int> &cellMap);
102
104wxString RTFStart(Configuration *configuration);
105
107wxString RTFEnd();
108
127wxString SelectionToSelfContainedHTML(GroupCell *startGroup,
128 GroupCell *endGroup,
129 Configuration *configuration);
130} // namespace WorksheetExport
131
132#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:596
wxString RTFStart(Configuration *configuration)
The RTF document header: font, color and stylesheet tables.
Definition: WorksheetExport.cpp:838
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:924
wxString RTFEnd()
The RTF document footer matching RTFStart().
Definition: WorksheetExport.cpp:890
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:647
wxString SelectionToSelfContainedHTML(GroupCell *startGroup, GroupCell *endGroup, Configuration *configuration)
Render a range of GroupCells as one self-contained HTML document (GH #2265/#2266/#2267): the styleshe...
Definition: WorksheetExport.cpp:1706
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:895
bool ExportToTeX(GroupCell *tree, Configuration *configuration, const wxString &file, ViewCellPointers *cellPointers, GroupCell *hCaret)
Export the tree to a LaTeX document; images go to a <name>_img directory.
Definition: WorksheetExport.cpp:784
void AddLineToFile(wxTextFile &output, const wxString &s)
Add a (possibly multi-line) string to output as individual lines.
Definition: WorksheetExport.cpp:581
bool ExportToHTML(GroupCell *tree, Configuration *configuration, const wxString &file, ViewCellPointers *cellPointers, GroupCell *hCaret)
Export the tree to an HTML file.
Definition: WorksheetExport.cpp:1589
The base class all cell types the worksheet can consist of are derived from.
Definition: Cell.h:148
The configuration storage for the current worksheet.
Definition: Configuration.h:98
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:88
The view/interaction half of the cell-pointer registry.
Definition: CellPointers.h:187