24#ifndef JKQTMATHTEXTBOXINSTRUCTIONNODE_H
25#define JKQTMATHTEXTBOXINSTRUCTIONNODE_H
26#include "jkqtmathtext/jkqtmathtext_imexport.h"
27#include "jkqtmathtext/jkqtmathtexttools.h"
28#include "jkqtmathtext/nodes/jkqtmathtextnode.h"
29#include "jkqtmathtext/nodes/jkqtmathtextinstructionnode.h"
63 static void modifyInMathEnvironment(
const QString& instructionName,
bool& insideMath,
bool &insideMathTextStyle,
const QStringList ¶ms=QStringList());
subclass representing an instruction node which draws a (possibly colored) box around it's contents i...
Definition jkqtmathtextboxinstructionnode.h:41
virtual double draw(QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override
draw the contents at the designated position
static size_t countParametersOfInstruction(const QString &instructionName)
returns the number of additional string parameters, required for the given instructionName
virtual bool toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const override
convert node to HTML and returns true on success
static const QHash< QString, InstructionProperties > & instructions()
defines all implemented instructions in this node
static bool supportsInstructionName(const QString &instructionName)
returns true, if the given instructionName can be represented by this node
JKQTMathTextBoxInstructionNode(JKQTMathText *parent, const QString &name, JKQTMathTextNode *child, const QStringList ¶meters=QStringList())
virtual QString getTypeName() const override
return the name of this class as a string
virtual JKQTMathTextNodeSize getSizeInternal(QPainter &painter, JKQTMathTextEnvironment currentEv) const override
determine the size of the node, overwrite this function in derived classes
virtual ~JKQTMathTextBoxInstructionNode() override
static void modifyInMathEnvironment(const QString &instructionName, bool &insideMath, bool &insideMathTextStyle, const QStringList ¶ms=QStringList())
sets insideMath to true if inside the node is to be parsed in math mode and false else
bool setupMTenvironment(JKQTMathTextEnvironment &ev) const
set all properties in ev, as appropriate for the represented instruction
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
subclass representing one node in the syntax tree
Definition jkqtmathtextnode.h:37
#define JKQTMATHTEXT_LIB_EXPORT
Definition jkqtmathtext_imexport.h:108
defines the implementation of an instruction represented by JKQTMathTextModifiedTextPropsInstructionN...
Definition jkqtmathtextboxinstructionnode.h:71
std::function< QBrush(JKQTMathTextEnvironment &ev, const QStringList ¶meters, JKQTMathText *parent)> GetBoxBrushFunctor
this functor returns the QBrush to use for the box fill
Definition jkqtmathtextboxinstructionnode.h:82
ModifyEnvironmentFunctor modifier
functor that modifies a JKQTMathTextEnvironment
Definition jkqtmathtextboxinstructionnode.h:96
double paddingFactor
padding of the box, as a factor to xWidth of the current font
Definition jkqtmathtextboxinstructionnode.h:102
static ModifyEnvironmentFunctor NoModification
Definition jkqtmathtextboxinstructionnode.h:74
InstructionProperties(const ModifyEnvironmentFunctor &_modifier, const GetBoxPenFunctor &_pen, const GetBoxBrushFunctor &_brush, double _paddingFactor=DefaultPadding, size_t _NParams=0)
constructor
static GetBoxBrushFunctor NoBrush
generates an invisible QBrush
Definition jkqtmathtextboxinstructionnode.h:84
static GetBoxPenFunctor NoPen
generates an invisible pen with 0 width
Definition jkqtmathtextboxinstructionnode.h:80
InstructionProperties(const GetBoxPenFunctor &_pen, const GetBoxBrushFunctor &_brush, double _paddingFactor=DefaultPadding, size_t _NParams=0)
constructor
size_t NParams
number of parameters for this node
Definition jkqtmathtextboxinstructionnode.h:94
std::function< void(JKQTMathTextEnvironment &ev, const QStringList ¶meters)> ModifyEnvironmentFunctor
this functor implements the instruction
Definition jkqtmathtextboxinstructionnode.h:73
static double DefaultPadding
default padding factor 0.5 xWidth
Definition jkqtmathtextboxinstructionnode.h:86
static GetBoxPenFunctor DefaultPen
generates a QPen with the lineWidth associated with the QFont of the environment (using QFontMetricsF...
Definition jkqtmathtextboxinstructionnode.h:78
bool doubleLine
draw a double-line
Definition jkqtmathtextboxinstructionnode.h:104
std::function< QPen(JKQTMathTextEnvironment &ev, const QStringList ¶meters, JKQTMathText *parent)> GetBoxPenFunctor
this functor returns the QPen to use for the box outline
Definition jkqtmathtextboxinstructionnode.h:76
GetBoxPenFunctor pen
functor that creates a QPen for the box outline
Definition jkqtmathtextboxinstructionnode.h:98
GetBoxBrushFunctor brush
functor that creates a QBrush for the box fill
Definition jkqtmathtextboxinstructionnode.h:100
double roundingFactor
rounding radius (rx=ry) of the box, as a factor to xWidth of the current font
Definition jkqtmathtextboxinstructionnode.h:106
InstructionProperties()
default constructor, creates a NOP-instruction that does nothing
describes the current drawing environment (base fontname ...)
Definition jkqtmathtexttools.h:304
beschreibt die Größe(n) eines Knotens
Definition jkqtmathtexttools.h:393