lib Library API Documentation

NameSequence Class Reference

The sequence thats a name. More...

#include <sequenceelement.h>

Inheritance diagram for NameSequence:

SequenceElement BasicElement List of all members.

Public Member Functions

 NameSequence (BasicElement *parent=0)
virtual NameSequenceclone ()
virtual bool accept (ElementVisitor *visitor)
virtual QChar getCharacter () const
virtual TokenType getTokenType () const
virtual SequenceElementgetMainChild ()
virtual void calcCursorSize (const ContextStyle &context, FormulaCursor *cursor, bool smallCursor)
virtual void drawCursor (QPainter &painter, const ContextStyle &context, FormulaCursor *cursor, bool smallCursor)
virtual void moveWordLeft (FormulaCursor *cursor)
virtual void moveWordRight (FormulaCursor *cursor)
virtual KCommand * buildCommand (Container *, Request *)
virtual KCommand * input (Container *container, QChar ch)
virtual void setElementType (ElementType *t)
BasicElementreplaceElement (const SymbolTable &table)
virtual void writeMathML (QDomDocument doc, QDomNode parent)

Static Public Member Functions

bool isValidSelection (FormulaCursor *cursor)

Protected Member Functions

virtual QString getTagName () const
virtual BasicElementcreateElement (QString type)
virtual bool isFirstOfToken (BasicElement *)

Detailed Description

The sequence thats a name.

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

Definition at line 442 of file sequenceelement.h.


Member Function Documentation

bool NameSequence::accept ElementVisitor visitor  )  [virtual]
 

Visit this element.

An implementation of the visitor pattern.

Reimplemented from SequenceElement.

Definition at line 1494 of file sequenceelement.cc.

References accept(), and ElementVisitor::visit().

Referenced by accept().

virtual QChar NameSequence::getCharacter  )  const [inline, virtual]
 

Returns:
the character that represents this element. Used for parsing a sequence. This is guaranteed to be QChar::null for all non-text elements.

Reimplemented from BasicElement.

Definition at line 464 of file sequenceelement.h.

virtual TokenType NameSequence::getTokenType  )  const [inline, virtual]
 

Returns:
the type of this element. Used for parsing a sequence.

Reimplemented from BasicElement.

Definition at line 470 of file sequenceelement.h.

virtual SequenceElement* NameSequence::getMainChild  )  [inline, virtual]
 

We are our own main child.

This causes interessting effects.

Reimplemented from BasicElement.

Definition at line 475 of file sequenceelement.h.

void NameSequence::drawCursor QPainter painter,
const ContextStyle context,
FormulaCursor cursor,
bool  smallCursor
[virtual]
 

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

Reimplemented from SequenceElement.

Definition at line 1511 of file sequenceelement.cc.

References drawCursor(), ContextStyle::getEmptyColor(), ContextStyle::getLineWidth(), KoZoomHandler::layoutUnitToPixelX(), KoZoomHandler::layoutUnitToPixelY(), KoZoomHandler::ptToLayoutUnitPixX(), KoZoomHandler::ptToLayoutUnitPixY(), and BasicElement::widgetPos().

Referenced by drawCursor().

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 1527 of file sequenceelement.cc.

References FormulaCursor::getPos(), moveWordLeft(), and FormulaCursor::setTo().

Referenced by moveWordLeft().

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 1538 of file sequenceelement.cc.

References SequenceElement::countChildren(), FormulaCursor::getPos(), moveWordRight(), and FormulaCursor::setTo().

Referenced by moveWordRight().

KCommand * NameSequence::buildCommand Container ,
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 1563 of file sequenceelement.cc.

References buildCommand().

Referenced by buildCommand(), and input().

KCommand * NameSequence::input Container container,
QChar  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 1585 of file sequenceelement.cc.

References buildCommand(), and input().

Referenced by input().

void NameSequence::setElementType ElementType t  )  [virtual]
 

Sets a new type.

This is done during parsing.

Reimplemented from BasicElement.

Definition at line 1624 of file sequenceelement.cc.

References SequenceElement::parse(), and setElementType().

Referenced by setElementType().

BasicElement * NameSequence::replaceElement const SymbolTable table  ) 
 

Returns:
the element this sequence is to be replaced with.

Definition at line 1630 of file sequenceelement.cc.

References replaceElement(), FractionElement::showLine(), and SymbolTable::unicode().

Referenced by replaceElement().

bool NameSequence::isValidSelection FormulaCursor cursor  )  [static]
 

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

Definition at line 1685 of file sequenceelement.cc.

References isValidSelection(), FormulaCursor::normal(), and SequenceElement::onlyTextSelected().

Referenced by isValidSelection().

void NameSequence::writeMathML QDomDocument  doc,
QDomNode  parent
[virtual]
 

Same as above, just MathML.

Reimplemented from SequenceElement.

Definition at line 1694 of file sequenceelement.cc.

References SequenceElement::countChildren(), BasicElement::getCharacter(), and writeMathML().

Referenced by writeMathML().

virtual QString NameSequence::getTagName  )  const [inline, protected, virtual]
 

Returns the tag name of this element type.

Reimplemented from SequenceElement.

Definition at line 539 of file sequenceelement.h.

BasicElement * NameSequence::createElement QString  type  )  [protected, virtual]
 

Creates a new element with the given type.

Parameters:
type the desired type of the element

Reimplemented from SequenceElement.

Definition at line 1661 of file sequenceelement.cc.

References createElement().

Referenced by createElement().

virtual bool NameSequence::isFirstOfToken BasicElement  )  [inline, protected, virtual]
 

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 559 of file sequenceelement.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Sep 24 18:22:30 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003