JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
jkqtmathtextparser.h
1/*
2 Copyright (c) 2008-2024 Jan W. Krieger (<jan@jkrieger.de>)
3 with contributions from: Razi Alavizadeh
4
5
6
7 This software is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License (LGPL) as published by
9 the Free Software Foundation, either version 2.1 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 Lesser General Public License (LGPL) for more details.
16
17 You should have received a copy of the GNU Lesser General Public License (LGPL)
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21
22
23
24
25#ifndef JKQTMATHTEXTPARSER_H
26#define JKQTMATHTEXTPARSER_H
27
28#include "jkqtmathtext/jkqtmathtext_imexport.h"
29#include "jkqtmathtext/jkqtmathtext.h"
30#include <QFlags>
31#include <QObject>
32#include <QString>
33
34
35class JKQTMathTextNode; // forward
36
37/*! \brief base class for all math markup parsers used by JKQTMathText
38 \ingroup jkqtmathtext_parser
39
40 \see JKQTMathTextLatexParser for an implementation of a JKQTMathTextParser that parses LaTeX markup.
41
42 */
44 Q_OBJECT
45 public:
46 /** \brief class constructor */
47 JKQTMathTextParser(JKQTMathText * parent = nullptr);
48 /** \brief class destructor */
50 /** \brief parse the given mathematical markup string.
51 *
52 * \param text the markup to be parsed
53 * \param options Options for parsing, \see ParseOptions
54 *
55 * \returns the memory representation of the markup \c nullptr on failure.
56 */
58
59 /** \brief parentMathText */
61 /** \brief parentMathText */
63 protected:
64 /** \brief JKQTMathText that instanciated and uses this parser */
66 /** \brief adds a new error to the JKQTMathText referenced by parentMathText
67 *
68 * \see JKQTMathText::addToErrorList()
69 */
70 void addToErrorList(const QString& error);
71 /** \brief clears the error list in the JKQTMathText referenced by parentMathText
72 *
73 * \see JKQTMathText::clearErrorList()
74 */
76
77};
78
79
80#endif // JKQTMATHTEXTPARSER_H
81
82
83
84
85
86
87
88
89
this class parses a mathematical markup string and can then draw the contained text/equation onto a Q...
Definition jkqtmathtext.h:192
QFlags< ParseOption > ParseOptions
Definition jkqtmathtext.h:217
@ DefaultParseOptions
Definition jkqtmathtext.h:215
subclass representing one node in the syntax tree
Definition jkqtmathtextnode.h:37
base class for all math markup parsers used by JKQTMathText
Definition jkqtmathtextparser.h:43
JKQTMathTextParser(JKQTMathText *parent=nullptr)
class constructor
const JKQTMathText * getParentMathText() const
parentMathText
JKQTMathText * parentMathText
JKQTMathText that instanciated and uses this parser.
Definition jkqtmathtextparser.h:65
void addToErrorList(const QString &error)
adds a new error to the JKQTMathText referenced by parentMathText
JKQTMathText * getParentMathText()
parentMathText
void clearErrorList()
clears the error list in the JKQTMathText referenced by parentMathText
virtual JKQTMathTextNode * parse(const QString &text, JKQTMathText::ParseOptions options=JKQTMathText::DefaultParseOptions)=0
parse the given mathematical markup string.
virtual ~JKQTMathTextParser()
class destructor
#define JKQTMATHTEXT_LIB_EXPORT
Definition jkqtmathtext_imexport.h:108