24#ifndef JKQTMATHTEXTWHITESPACENODE_H
25#define JKQTMATHTEXTWHITESPACENODE_H
26#include "jkqtmathtext/jkqtmathtext_imexport.h"
27#include "jkqtmathtext/jkqtmathtexttools.h"
28#include "jkqtmathtext/nodes/jkqtmathtextnode.h"
29#include "jkqtmathtext/nodes/jkqtmathtextinstructionnode.h"
subclass representing an empty bbox with defined width/height in the syntax tree
Definition jkqtmathtextwhitespacenode.h:115
Units getHeightUnit() const
units to interpret height
double height
height of the (empty) box, units of this value defined in heightUnit
Definition jkqtmathtextwhitespacenode.h:152
double Units2PixelWidth(double value, Units unit, JKQTMathTextEnvironment currentEv, QPaintDevice *pd) const
converts Types type into its width in pixels, based on currentEv and pd
virtual double draw(QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override
draw the contents at the designated position
double getWidth() const
width of the (empty) box, units of this value defined in widthUnit
Units getWidthUnit() const
units to interpret width
virtual QString getTypeName() const override
return the name of this class as a string
double width
width of the (empty) box, units of this value defined in widthUnit
Definition jkqtmathtextwhitespacenode.h:148
virtual bool toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const override
convert node to HTML and returns true on success
double getHeight() const
height of the (empty) box, units of this value defined in heightUnit
Units
Definition jkqtmathtextwhitespacenode.h:117
@ EBUex
1ex = xHeight
Definition jkqtmathtextwhitespacenode.h:119
@ EBUem
1em = width('M')
Definition jkqtmathtextwhitespacenode.h:118
JKQTMathTextEmptyBoxNode(JKQTMathText *parent, double width_, Units widthUnit_, double height_, Units heightUnit_)
constructs a node
virtual ~JKQTMathTextEmptyBoxNode() override
Units heightUnit
units to interpret height
Definition jkqtmathtextwhitespacenode.h:154
virtual JKQTMathTextNodeSize getSizeInternal(QPainter &painter, JKQTMathTextEnvironment currentEv) const override
determine the size of the node, overwrite this function in derived classes
static Units String2Units(QString type)
converts Types type into a string
static QString Units2String(Units type)
converts Types type into a string
Units widthUnit
units to interpret width
Definition jkqtmathtextwhitespacenode.h:150
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
generates whitespace with the size of the contained node
Definition jkqtmathtextwhitespacenode.h:163
virtual QString getTypeName() const override
return the name of this class as a string
static bool supportsInstructionName(const QString &instructionName)
returns true, if the given instructionName can be represented by this node
JKQTMathTextPhantomNode(JKQTMathText *parent, const QString &mode, JKQTMathTextNode *child)
JKQTMathTextPhantomNode(JKQTMathText *parent, Mode mode, JKQTMathTextNode *child)
virtual bool toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const override
convert node to HTML and returns true on success
virtual double draw(QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override
draw the contents at the designated position
virtual JKQTMathTextNodeSize getSizeInternal(QPainter &painter, JKQTMathTextEnvironment currentEv) const override
determine the size of the node, overwrite this function in derived classes
Mode
type of the phantom instrcution
Definition jkqtmathtextwhitespacenode.h:166
@ FMwidth
implementes \hphantom{CHILD} which is whitespace in the width of CHILD and height 0.
Definition jkqtmathtextwhitespacenode.h:168
@ FMwidthAndHeight
implementes \phantom{CHILD} which is whitespace in the width and height of CHILD
Definition jkqtmathtextwhitespacenode.h:167
static const QHash< QString, Mode > & instructions()
defines all implemented instructions in this node
virtual ~JKQTMathTextPhantomNode() override
static QString Mode2Instruction(Mode mode)
convert a Mode into a LaTeX instruction name
subclass representing one whitepsace node in the syntax tree
Definition jkqtmathtextwhitespacenode.h:41
Types getWhitespaceType() const
type of the whitespace represented by this node
JKQTMathTextWhitespaceNode(JKQTMathText *parent)
constructs a node with count=1 and type=WSTNormal
JKQTMathTextWhitespaceNode(const QString &type, JKQTMathText *parent)
constructs a node with count=1 and the width derived from the instruction name type
WhitespaceProps whitespace
properties of the whitespace represented by this node
Definition jkqtmathtextwhitespacenode.h:100
static const QHash< QString, WhitespaceProps > & supportedInstructions()
translation table between latex instruction and WhitespaceProps
static bool supportsInstructionName(const QString &instruction)
checks whether a given LaTeX instruction name is supported by this node class type
virtual JKQTMathTextNodeSize getSizeInternal(QPainter &painter, JKQTMathTextEnvironment currentEv) const override
determine the size of the node, overwrite this function in derived classes
double Type2PixelWidth(Types type, JKQTMathTextEnvironment currentEv, QPaintDevice *pd) const
converts Types type into its width in pixels, based on currentEv and pd
Types
Definition jkqtmathtextwhitespacenode.h:43
@ WSThair
hair (thinner than thin) whitespace (1/12 em = pointsize/12)
Definition jkqtmathtextwhitespacenode.h:49
@ WSTthicker
thicker whitespace (1/3 em = pointsize/3)
Definition jkqtmathtextwhitespacenode.h:56
@ WST1en
1en (= 0.5 * pointsize of the font) whitespace
Definition jkqtmathtextwhitespacenode.h:46
@ WSTnegthin
negative thin whitespace (-1/6 em = -pointsize/6)
Definition jkqtmathtextwhitespacenode.h:51
@ WSTmedium
medium whitespace (2/9 em = pointsize*2/9)
Definition jkqtmathtextwhitespacenode.h:52
@ WSTNormal
a normal-width whitespace
Definition jkqtmathtextwhitespacenode.h:44
@ WST1em
1em (= pointsize of the font) whitespace
Definition jkqtmathtextwhitespacenode.h:47
@ WSTnegthick
negative thick whitespace (-5/18 em = -pointsize*5/18)
Definition jkqtmathtextwhitespacenode.h:55
@ WSTnegmedium
negative medium whitespace (-2/9 em = -pointsize*2/9)
Definition jkqtmathtextwhitespacenode.h:53
@ WSTthin
thin whitespace (1/6 em = pointsize/6)
Definition jkqtmathtextwhitespacenode.h:50
@ WSTNonbreaking
a normal-width, non-breaking whitespace
Definition jkqtmathtextwhitespacenode.h:45
@ WSTthick
thick whitespace (5/18 em = pointsize*5/18)
Definition jkqtmathtextwhitespacenode.h:54
static QString Type2String(Types type)
converts Types type into a string
static QString Type2HTML(Types type)
converts Types type into its HTML representation
virtual ~JKQTMathTextWhitespaceNode() override
virtual double draw(QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override
draw the contents at the designated position
virtual QString getTypeName() const override
return the name of this class as a string
JKQTMathTextWhitespaceNode(Types type, JKQTMathText *parent)
constructs a node with count=1 and the given type
virtual bool toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const override
convert node to HTML and returns true on success
JKQTMathTextWhitespaceNode(const QString &type, size_t count, JKQTMathText *parent)
constructs a node with the specified count and the width derived from the instruction name type
JKQTMathTextWhitespaceNode(Types type, size_t cound, JKQTMathText *parent)
constructs a node with the given type and count
size_t getWhitespaceCount() const
number of whitespaces of the given type, represented by this node (default: 1)
#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
describes a whitespace
Definition jkqtmathtextwhitespacenode.h:90
Types type
type of the whitespace represented by this node
Definition jkqtmathtextwhitespacenode.h:95
size_t count
number of whitespaces of the given type, represented by this node (default: 1)
Definition jkqtmathtextwhitespacenode.h:97
WhitespaceProps & operator=(const WhitespaceProps &other)
WhitespaceProps(const WhitespaceProps &other)
WhitespaceProps(Types type=WSTNormal, size_t count=1)