wxMaxima
Loading...
Searching...
No Matches
MaximaOutputAppender.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) 2026 Gunter Königsmann <wxMaxima@physikbuch.de>
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//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19//
20// SPDX-License-Identifier: GPL-2.0+
21
33#ifndef MAXIMAOUTPUTAPPENDER_H
34#define MAXIMAOUTPUTAPPENDER_H
35
36#include <wx/string.h>
37#include <wx/xml/xml.h>
38#include "cells/Cell.h" // CellType
39
40class wxMaxima;
41class TextCell;
42
44public:
45 explicit MaximaOutputAppender(wxMaxima &wxm) : m_wxMaxima(wxm) {}
46
48 enum AppendOpt {
49 NewLine = 1,
50 BigSkip = 2,
51 PromptToolTip = 4,
52 DefaultOpt = NewLine | BigSkip
53 };
54
57 TextCell *ConsoleAppend(wxString s, CellType type);
58
60 void ConsoleAppend(wxXmlDocument xml, CellType type,
61 const wxString &userLabel = {});
62
64 void DoConsoleAppend(wxString s, CellType type, AppendOpt opts = DefaultOpt,
65 const wxString &userLabel = {});
66
72 TextCell *DoRawConsoleAppend(wxString s, CellType type, AppendOpt opts = {});
73
74private:
77 wxMaxima &m_wxMaxima;
78};
79
80#endif // MAXIMAOUTPUTAPPENDER_H
The definition of the base class of all cells the worksheet consists of.
CellType
The supported types of math cells.
Definition: Cell.h:64
Definition: MaximaOutputAppender.h:43
TextCell * ConsoleAppend(wxString s, CellType type)
Append one line s of the given type to the console, dispatching on the type (plain text goes verbatim...
Definition: MaximaOutputAppender.cpp:88
AppendOpt
Options controlling how an appended cell is laid out. A bit set.
Definition: MaximaOutputAppender.h:48
TextCell * DoRawConsoleAppend(wxString s, CellType type, AppendOpt opts={})
Append one or more lines of ordinary unicode text to the console.
Definition: MaximaOutputAppender.cpp:212
void DoConsoleAppend(wxString s, CellType type, AppendOpt opts=DefaultOpt, const wxString &userLabel={})
Parse s as MathML-like XML into a cell and insert it.
Definition: MaximaOutputAppender.cpp:177
A Text cell.
Definition: TextCell.h:38
Definition: wxMaxima.h:75