24#ifndef JKQTMATHTEXTINSTRUCTIONNODE_H
25#define JKQTMATHTEXTINSTRUCTIONNODE_H
26#include "jkqtmathtext/jkqtmathtext_imexport.h"
27#include "jkqtmathtext/jkqtmathtexttools.h"
28#include "jkqtmathtext/nodes/jkqtmathtextnode.h"
this class parses a mathematical markup string and can then draw the contained text/equation onto a Q...
Definition jkqtmathtext.h:192
subclass representing an instruction node with exactly one argument and possibly additional parameter...
Definition jkqtmathtextinstructionnode.h:45
virtual ~JKQTMathTextInstruction1Node() override
QString instructionName
instruction name
Definition jkqtmathtextinstructionnode.h:55
JKQTMathTextInstruction1Node(JKQTMathText *parent, const QString &name, JKQTMathTextNode *child, const QStringList ¶meters=QStringList())
const QStringList & getParameters() const
additional string-parameters
QStringList parameters
additional string-parameters
Definition jkqtmathtextinstructionnode.h:57
const QString & getInstructionName() const
instruction name
subclass representing one node in the syntax tree
Definition jkqtmathtextnode.h:37
subclass representing a simple instruction node which only accepts string arguments,...
Definition jkqtmathtextinstructionnode.h:66
virtual JKQTMathTextNodeSize getSizeInternal(QPainter &painter, JKQTMathTextEnvironment currentEv) const override
determine the size of the node, overwrite this function in derived classes
QString instructionName
instruction name
Definition jkqtmathtextinstructionnode.h:114
virtual bool toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const override
convert node to HTML and returns true on success
static bool supportsInstructionName(const QString &instructionName)
returns true, if the given instructionName can be represented by this node
virtual double draw(QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override
draw the contents at the designated position
QString executeInstruction() const
executes the instruction on ev
JKQTMathTextSimpleInstructionNode(JKQTMathText *parent, const QString &name, const QStringList ¶meters=QStringList())
QStringList parameters
additional string-parameters
Definition jkqtmathtextinstructionnode.h:116
virtual ~JKQTMathTextSimpleInstructionNode() override
static size_t countParametersOfInstruction(const QString &instructionName)
returns the number of additional string parameters, required for the given instructionName
static const QHash< QString, InstructionProperties > & instructions()
defines all implemented instructions in this node
virtual QString getTypeName() const override
return the name of this class as a string
const QStringList & getParameters() const
additional string-parameters
const QString & getInstructionName() const
instruction name
subclass representing a node in the syntax tree, that has one child
Definition jkqtmathtextnode.h:174
#define JKQTMATHTEXT_LIB_EXPORT
Definition jkqtmathtext_imexport.h:108
describes the current drawing environment (base fontname ...)
Definition jkqtmathtexttools.h:304
beschreibt die Größe(n) eines Knotens
Definition jkqtmathtexttools.h:393
defines the implementation of an instruction represented by JKQTMathTextModifiedTextPropsInstructionN...
Definition jkqtmathtextinstructionnode.h:94
std::function< QString(const QStringList ¶meters)> EvaluateInstructionFunctor
this functor implements the instruction
Definition jkqtmathtextinstructionnode.h:96
EvaluateInstructionFunctor evaluator
output of the instruction
Definition jkqtmathtextinstructionnode.h:104
InstructionProperties()
default constructor, creates a NOP-instruction that does nothing
size_t NParams
number of parameters for this node
Definition jkqtmathtextinstructionnode.h:102
InstructionProperties(const EvaluateInstructionFunctor &_evaluator, size_t _NParams=0)
constructor which gets a functor _modifier and a number of required parameters _NParams