lib

#include <sequenceelement.h>

Inheritance diagram for NameSequence:
SequenceElement BasicElement

Public Member Functions

 NameSequence (BasicElement *parent=0)
virtual NameSequence * clone ()
virtual bool accept (ElementVisitor *visitor)
virtual TQChar getCharacter () const
virtual TokenType getTokenType () const
virtual SequenceElement * getMainChild ()
virtual void calcCursorSize (const ContextStyle &context, FormulaCursor *cursor, bool smallCursor)
virtual void drawCursor (TQPainter &painter, const ContextStyle &context, StyleAttributes &style, FormulaCursor *cursor, bool smallCursor, bool activeCursor)
virtual void moveWordLeft (FormulaCursor *cursor)
virtual void moveWordRight (FormulaCursor *cursor)
virtual KCommand * buildCommand (Container *, Request *)
virtual KCommand * input (Container *container, TQChar ch)
virtual void setElementType (ElementType *t)
BasicElement * replaceElement (const SymbolTable &table)
Public Member Functions inherited from SequenceElement
 SequenceElement (BasicElement *parent=0)
 SequenceElement (const SequenceElement &)
virtual bool readOnly (const FormulaCursor *) const
virtual bool isTextOnly () const
virtual BasicElement * goToPos (FormulaCursor *, bool &handled, const LuPixelPoint &point, const LuPixelPoint &parentOrigin)
void setSizeReduction (const ContextStyle &context)
bool isEmpty ()
virtual void calcSizes (const ContextStyle &cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style)
virtual void dispatchFontCommand (FontCommand *cmd)
virtual void drawEmptyRect (TQPainter &painter, const ContextStyle &context, double factor, const LuPixelPoint &upperLeft)
virtual void moveHome (FormulaCursor *cursor)
virtual void moveEnd (FormulaCursor *cursor)
virtual void goInside (FormulaCursor *cursor)
virtual void goInsideLast (FormulaCursor *cursor)
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)
virtual void childWillVanish (FormulaCursor *cursor, BasicElement *child)
uint countChildren () const
bool isChildNumber (uint pos, BasicElement *child)
void selectAllChildren (FormulaCursor *cursor)
bool onlyTextSelected (FormulaCursor *cursor)
virtual KCommand * input (Container *container, TQKeyEvent *event)
virtual void parse ()
void getChildrenDom (TQDomDocument &doc, TQDomElement elem, uint from, uint to)
void getChildrenMathMLDom (TQDomDocument &doc, TQDomNode &elem, uint from, uint to)
bool buildChildrenFromDom (TQPtrList< BasicElement > &list, TQDomNode n)
virtual TQString toLatex ()
virtual TQString formulaString ()
BasicElement * getChild (uint i)
const BasicElement * getChild (uint i) const
int childPos (BasicElement *child)
int childPos (const BasicElement *child) const
iterator begin ()
iterator end ()
virtual void setStyle (StyleElement *style)
virtual int buildChildrenFromMathMLDom (TQPtrList< BasicElement > &list, TQDomNode n)
virtual int readContentFromMathMLDom (TQDomNode &node)
int buildMathMLChild (TQDomNode node)
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 bool isInvisible () const
LuPixelPoint widgetPos ()
virtual void entered (SequenceElement *)
virtual bool isSenseless ()
virtual void registerTab (BasicElement *)
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)
virtual void writeMathML (TQDomDocument &doc, TQDomNode &parent, bool oasisFormat=false) const
bool buildFromDom (TQDomElement element)
int buildFromMathMLDom (TQDomElement element)
ElementType * getElementType () const

Static Public Member Functions

static bool isValidSelection (FormulaCursor *cursor)
Static Public Member Functions inherited from SequenceElement
static void setCreationStrategy (ElementCreationStrategy *strategy)
Static Public Member Functions inherited from BasicElement
static int getEvilDestructionCount ()

Protected Member Functions

virtual TQString getTagName () const
virtual TQString getElementName () const
virtual BasicElement * createElement (TQString type)
virtual bool isFirstOfToken (BasicElement *)
Protected Member Functions inherited from SequenceElement
virtual void writeDom (TQDomElement element)
virtual void writeMathMLContent (TQDomDocument &doc, TQDomElement &element, bool oasisFormat) const
virtual bool readAttributesFromDom (TQDomElement element)
virtual bool readContentFromDom (TQDomNode &node)
virtual void setChildrenPositions ()
virtual BasicElement * createElement (TQString type, const TQDomElement &element)
luPixel getChildPosition (const ContextStyle &context, uint child)
bool insert (uint index, BasicElement *child)
virtual luPt getSpaceBefore (const ContextStyle &, ContextStyle::TextStyle, double)
virtual luPt getSpaceAfter (const ContextStyle &, ContextStyle::TextStyle, double)
Protected Member Functions inherited from BasicElement
virtual void writeMathMLAttributes (TQDomElement &) const
bool buildChild (SequenceElement *child, TQDomNode node, TQString name)
virtual bool readAttributesFromMathMLDom (const TQDomElement &element)
double getSize (const TQString &str, SizeType *st)
SizeType getSpace (const TQString &str)

Additional Inherited Members

Public Types inherited from SequenceElement
typedef ChildIterator iterator
Static Protected Member Functions inherited from SequenceElement
static ElementCreationStrategy * getCreationStrategy ()
Static Protected Attributes inherited from SequenceElement
static ElementCreationStrategy * creationStrategy = 0

Detailed Description

The sequence thats a name.

Actually the purpose is to be able to insert any element by keyboard.

Definition at line 492 of file sequenceelement.h.

Constructor & Destructor Documentation

◆ NameSequence()

NameSequence::NameSequence ( BasicElement * parent = 0)

Definition at line 1603 of file sequenceelement.cpp.

Member Function Documentation

◆ accept()

bool NameSequence::accept ( ElementVisitor * )
virtual

Visit this element.

An implementation of the visitor pattern.

Reimplemented from SequenceElement.

Definition at line 1609 of file sequenceelement.cpp.

◆ buildCommand()

KCommand * NameSequence::buildCommand ( Container * container,
Request * request )
virtual

This is called by the container to get a command depending on the current cursor position (this is how the element gets chosen) and the request.

Returns
the command that performs the requested action with the containers active cursor.

Reimplemented from SequenceElement.

Definition at line 1679 of file sequenceelement.cpp.

◆ calcCursorSize()

void NameSequence::calcCursorSize ( const ContextStyle & context,
FormulaCursor * cursor,
bool smallCursor )
virtual

Reimplemented from SequenceElement.

Definition at line 1615 of file sequenceelement.cpp.

◆ clone()

virtual NameSequence * NameSequence::clone ( )
inlinevirtual

Reimplemented from SequenceElement.

Definition at line 498 of file sequenceelement.h.

◆ createElement()

BasicElement * NameSequence::createElement ( TQString type)
protectedvirtual

Creates a new element with the given type.

Parameters
typethe desired type of the element

Definition at line 1777 of file sequenceelement.cpp.

◆ drawCursor()

void NameSequence::drawCursor ( TQPainter & painter,
const ContextStyle & context,
StyleAttributes & style,
FormulaCursor * cursor,
bool smallCursor,
bool activeCursor )
virtual

If the cursor is inside a sequence it needs to be drawn.

Reimplemented from SequenceElement.

Definition at line 1626 of file sequenceelement.cpp.

◆ getCharacter()

virtual TQChar NameSequence::getCharacter ( ) const
inlinevirtual
Returns
true if the sequence contains only text.
the character that represents this element. Used for parsing a sequence. This is guaranteed to be TQChar::null for all non-text elements.

Reimplemented from BasicElement.

Definition at line 514 of file sequenceelement.h.

◆ getElementName()

virtual TQString NameSequence::getElementName ( ) const
inlineprotectedvirtual

Reimplemented from SequenceElement.

Definition at line 590 of file sequenceelement.h.

◆ getMainChild()

virtual SequenceElement * NameSequence::getMainChild ( )
inlinevirtual

We are our own main child.

This causes interessting effects.

Reimplemented from BasicElement.

Definition at line 525 of file sequenceelement.h.

◆ getTagName()

virtual TQString NameSequence::getTagName ( ) const
inlineprotectedvirtual

Returns the tag name of this element type.

Reimplemented from SequenceElement.

Definition at line 588 of file sequenceelement.h.

◆ getTokenType()

virtual TokenType NameSequence::getTokenType ( ) const
inlinevirtual
Returns
the type of this element. Used for parsing a sequence.

Reimplemented from BasicElement.

Definition at line 520 of file sequenceelement.h.

◆ input()

KCommand * NameSequence::input ( Container * container,
TQChar ch )
virtual

Parses the input.

It's the container which does create new elements because it owns the undo stack. But only the sequence knows what chars are allowed.

Reimplemented from SequenceElement.

Definition at line 1701 of file sequenceelement.cpp.

◆ isFirstOfToken()

virtual bool NameSequence::isFirstOfToken ( BasicElement * )
inlineprotectedvirtual

Parses the sequence and generates a new syntax tree.

Has to be called after each modification.

Returns
whether the child is the first element of its token. This can never happen here. Our children reuse our own element type.

Reimplemented from SequenceElement.

Definition at line 609 of file sequenceelement.h.

◆ isValidSelection()

bool NameSequence::isValidSelection ( FormulaCursor * cursor)
static

Tests whether the selected elements can be inserted in a name sequence.

Definition at line 1801 of file sequenceelement.cpp.

◆ moveWordLeft()

void NameSequence::moveWordLeft ( FormulaCursor * cursor)
virtual

Moves to the beginning of this word or if we are there already to the beginning of the previous.

Reimplemented from SequenceElement.

Definition at line 1643 of file sequenceelement.cpp.

◆ moveWordRight()

void NameSequence::moveWordRight ( FormulaCursor * cursor)
virtual

Moves to the end of this word or if we are there already to the end of the next.

Reimplemented from SequenceElement.

Definition at line 1654 of file sequenceelement.cpp.

◆ replaceElement()

BasicElement * NameSequence::replaceElement ( const SymbolTable & table)
Returns
the element this sequence is to be replaced with.

Definition at line 1746 of file sequenceelement.cpp.

◆ setElementType()

void NameSequence::setElementType ( ElementType * t)
virtual

Sets a new type.

This is done during parsing.

Reimplemented from BasicElement.

Definition at line 1740 of file sequenceelement.cpp.


The documentation for this class was generated from the following files: