#include <symbolelement.h>
Public Member Functions | |
| SymbolElement (SymbolType type=EmptyBracket, BasicElement *parent=0) | |
| SymbolElement (const SymbolElement &) | |
| virtual SymbolElement * | clone () |
| virtual bool | accept (ElementVisitor *visitor) |
| virtual BasicElement * | goToPos (FormulaCursor *, bool &handled, const LuPixelPoint &point, const LuPixelPoint &parentOrigin) |
| virtual void | calcSizes (const ContextStyle &cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style) |
| virtual void | draw (TQPainter &painter, const LuPixelRect &r, const ContextStyle &context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style, const LuPixelPoint &parentOrigin) |
| virtual void | dispatchFontCommand (FontCommand *cmd) |
| virtual void | moveLeft (FormulaCursor *cursor, BasicElement *from) |
| virtual void | moveRight (FormulaCursor *cursor, BasicElement *from) |
| virtual void | moveUp (FormulaCursor *cursor, BasicElement *from) |
| virtual void | moveDown (FormulaCursor *cursor, BasicElement *from) |
| virtual SequenceElement * | getMainChild () |
| virtual void | insert (FormulaCursor *, TQPtrList< BasicElement > &, Direction) |
| virtual void | remove (FormulaCursor *, TQPtrList< BasicElement > &, Direction) |
| virtual void | normalize (FormulaCursor *, Direction) |
| virtual BasicElement * | getChild (FormulaCursor *, Direction=beforeCursor) |
| virtual void | selectChild (FormulaCursor *cursor, BasicElement *child) |
| bool | hasUpper () const |
| bool | hasLower () const |
| void | setToUpper (FormulaCursor *cursor) |
| void | setToLower (FormulaCursor *cursor) |
| void | moveToUpper (FormulaCursor *, Direction) |
| void | moveToLower (FormulaCursor *, Direction) |
| ElementIndexPtr | getUpperIndex () |
| ElementIndexPtr | getLowerIndex () |
| ElementIndexPtr | getIndex (int position) |
| virtual TQString | toLatex () |
| virtual TQString | formulaString () |
| virtual void | writeMathML (TQDomDocument &doc, TQDomNode &parent, bool oasisFormat=false) const |
Public Member Functions inherited from BasicElement | |
| BasicElement (BasicElement *parent=0) | |
| BasicElement (const BasicElement &) | |
| virtual bool | readOnly (const BasicElement *child) const |
| virtual FormulaElement * | formula () |
| virtual const FormulaElement * | formula () const |
| virtual TQChar | getCharacter () const |
| virtual TokenType | getTokenType () const |
| virtual bool | isInvisible () const |
| LuPixelPoint | widgetPos () |
| virtual void | moveHome (FormulaCursor *) |
| virtual void | moveEnd (FormulaCursor *) |
| virtual void | goInside (FormulaCursor *cursor) |
| virtual void | entered (SequenceElement *) |
| virtual bool | isSenseless () |
| virtual void | childWillVanish (FormulaCursor *, BasicElement *) |
| virtual void | registerTab (BasicElement *) |
| virtual KCommand * | buildCommand (Container *, Request *) |
| virtual KCommand * | input (Container *, TQKeyEvent *) |
| const BasicElement * | getParent () const |
| BasicElement * | getParent () |
| void | setParent (BasicElement *p) |
| luPixel | getX () const |
| luPixel | getY () const |
| void | setX (luPixel x) |
| void | setY (luPixel y) |
| luPixel | getWidth () const |
| luPixel | getHeight () const |
| void | setWidth (luPixel width) |
| void | setHeight (luPixel height) |
| luPixel | getBaseline () const |
| void | setBaseline (luPixel line) |
| luPixel | axis (const ContextStyle &style, ContextStyle::TextStyle tstyle, double factor) const |
| TQDomElement | getElementDom (TQDomDocument &doc) |
| bool | buildFromDom (TQDomElement element) |
| int | buildFromMathMLDom (TQDomElement element) |
| ElementType * | getElementType () const |
| virtual void | setElementType (ElementType *t) |
| virtual void | setStyle (StyleElement *) |
| virtual TQString | getElementName () const |
Protected Member Functions | |
| virtual TQString | getTagName () const |
| virtual void | writeDom (TQDomElement element) |
| virtual bool | readAttributesFromDom (TQDomElement element) |
| virtual bool | readContentFromDom (TQDomNode &node) |
Protected Member Functions inherited from BasicElement | |
| virtual void | writeMathMLAttributes (TQDomElement &) const |
| virtual void | writeMathMLContent (TQDomDocument &, TQDomElement &, bool) const |
| bool | buildChild (SequenceElement *child, TQDomNode node, TQString name) |
| virtual bool | readAttributesFromMathMLDom (const TQDomElement &element) |
| virtual int | readContentFromMathMLDom (TQDomNode &node) |
| double | getSize (const TQString &str, SizeType *st) |
| SizeType | getSpace (const TQString &str) |
Additional Inherited Members | |
Static Public Member Functions inherited from BasicElement | |
| static int | getEvilDestructionCount () |
Detailed Description
A symbol is simply a piece of art.
Definition at line 33 of file symbolelement.h.
Constructor & Destructor Documentation
◆ SymbolElement() [1/2]
| SymbolElement::SymbolElement | ( | SymbolType | type = EmptyBracket, |
| BasicElement * | parent = 0 |
||
| ) |
Definition at line 90 of file symbolelement.cpp.
◆ ~SymbolElement()
| SymbolElement::~SymbolElement | ( | ) |
Definition at line 98 of file symbolelement.cpp.
◆ SymbolElement() [2/2]
| SymbolElement::SymbolElement | ( | const SymbolElement & | other | ) |
Definition at line 107 of file symbolelement.cpp.
Member Function Documentation
◆ accept()
|
virtual |
Visit this element.
An implementation of the visitor pattern.
Implements BasicElement.
Definition at line 130 of file symbolelement.cpp.
◆ calcSizes()
|
virtual |
Calculates our width and height and our children's parentPosition.
Implements BasicElement.
Definition at line 197 of file symbolelement.cpp.
◆ clone()
|
inlinevirtual |
Implements BasicElement.
Definition at line 44 of file symbolelement.h.
◆ dispatchFontCommand()
|
virtual |
Dispatch this FontCommand to all our TextElement children.
Reimplemented from BasicElement.
Definition at line 350 of file symbolelement.cpp.
◆ draw()
|
virtual |
Draws the whole element including its children.
The ‘parentOrigin’ is the point this element's parent starts. We can use our parentPosition to get our own origin then.
Implements BasicElement.
Definition at line 306 of file symbolelement.cpp.
◆ formulaString()
|
virtual |
Reimplemented from BasicElement.
Definition at line 829 of file symbolelement.cpp.
◆ getChild()
|
virtual |
Returns the child at the cursor.
Reimplemented from BasicElement.
Definition at line 615 of file symbolelement.cpp.
◆ getIndex()
| ElementIndexPtr SymbolElement::getIndex | ( | int | position | ) |
Returns the index at the position.
Defaults to upperRight.
Definition at line 693 of file symbolelement.cpp.
◆ getLowerIndex()
|
inline |
Definition at line 211 of file symbolelement.h.
◆ getMainChild()
|
inlinevirtual |
Removes the child.
If this was the main child this element might request its own removal. The cursor is the one that caused the removal. It has to be moved to the place any user expects the cursor after that particular element has been removed.
Reimplemented from BasicElement.
Definition at line 144 of file symbolelement.h.
◆ getTagName()
|
inlineprotectedvirtual |
Returns the tag name of this element type.
Reimplemented from BasicElement.
Definition at line 239 of file symbolelement.h.
◆ getUpperIndex()
|
inline |
Definition at line 210 of file symbolelement.h.
◆ goToPos()
|
virtual |
Sets the cursor and returns the element the point is in.
The handled flag shows whether the cursor has been set. This is needed because only the innermost matching element is allowed to set the cursor.
Reimplemented from BasicElement.
Definition at line 136 of file symbolelement.cpp.
◆ hasLower()
|
inline |
Definition at line 197 of file symbolelement.h.
◆ hasUpper()
|
inline |
Moves the cursor away from the given child.
The cursor is guaranteed to be inside this element.
Definition at line 196 of file symbolelement.h.
◆ insert()
|
virtual |
Inserts all new children at the cursor position.
Places the cursor according to the direction.
You only can insert one index at a time. So the list must contain exactly on SequenceElement. And the index you want to insert must not exist already.
The list will be emptied but stays the property of the caller.
Reimplemented from BasicElement.
Definition at line 530 of file symbolelement.cpp.
◆ moveDown()
|
virtual |
Enters this element while moving down starting inside the element ‘from’.
Searches for a cursor position inside this element or below it.
Reimplemented from BasicElement.
Definition at line 482 of file symbolelement.cpp.
◆ moveLeft()
|
virtual |
Enters this element while moving to the left starting inside the element ‘from’.
Searches for a cursor position inside this element or to the left of it.
Reimplemented from BasicElement.
Definition at line 374 of file symbolelement.cpp.
◆ moveRight()
|
virtual |
Enters this element while moving to the right starting inside the element ‘from’.
Searches for a cursor position inside this element or to the right of it.
Reimplemented from BasicElement.
Definition at line 414 of file symbolelement.cpp.
◆ moveToLower()
| void SymbolElement::moveToLower | ( | FormulaCursor * | cursor, |
| Direction | direction | ||
| ) |
Definition at line 680 of file symbolelement.cpp.
◆ moveToUpper()
| void SymbolElement::moveToUpper | ( | FormulaCursor * | cursor, |
| Direction | direction | ||
| ) |
Definition at line 668 of file symbolelement.cpp.
◆ moveUp()
|
virtual |
Enters this element while moving up starting inside the element ‘from’.
Searches for a cursor position inside this element or above it.
Reimplemented from BasicElement.
Definition at line 454 of file symbolelement.cpp.
◆ normalize()
|
virtual |
Moves the cursor to a normal place where new elements might be inserted.
Reimplemented from BasicElement.
Definition at line 602 of file symbolelement.cpp.
◆ readAttributesFromDom()
|
protectedvirtual |
Reads our attributes from the element.
Returns false if it failed.
Reimplemented from BasicElement.
Definition at line 736 of file symbolelement.cpp.
◆ readContentFromDom()
|
protectedvirtual |
Reads our content from the node.
Sets the node to the next node that needs to be read. Returns false if it failed.
Reimplemented from BasicElement.
Definition at line 755 of file symbolelement.cpp.
◆ remove()
|
virtual |
Removes all selected children and returns them.
Places the cursor to where the children have been.
The cursor has to be inside one of our indexes which is supposed to be empty. The index will be removed and the cursor will be placed to the removed index so it can be inserted again. This methode is called by SequenceElement::remove only.
The ownership of the list is passed to the caller.
Reimplemented from BasicElement.
Definition at line 570 of file symbolelement.cpp.
◆ selectChild()
|
virtual |
Sets the cursor to select the child.
The mark is placed before, the position behind it.
Reimplemented from BasicElement.
Definition at line 633 of file symbolelement.cpp.
◆ setToLower()
| void SymbolElement::setToLower | ( | FormulaCursor * | cursor | ) |
Definition at line 651 of file symbolelement.cpp.
◆ setToUpper()
| void SymbolElement::setToUpper | ( | FormulaCursor * | cursor | ) |
Definition at line 646 of file symbolelement.cpp.
◆ toLatex()
|
virtual |
- Returns
- the latex representation of the element and of the element's children
Reimplemented from BasicElement.
Definition at line 787 of file symbolelement.cpp.
◆ writeDom()
|
protectedvirtual |
Appends our attributes to the dom element.
Reimplemented from BasicElement.
Definition at line 708 of file symbolelement.cpp.
◆ writeMathML()
|
virtual |
Same as above, just MathML.
It shouldn't be redefined but for exceptional cases, use the general writeMathML* API instead
Reimplemented from BasicElement.
Definition at line 855 of file symbolelement.cpp.
The documentation for this class was generated from the following files:

Public Member Functions inherited from