lib Library API Documentation

NameSequence Class Reference

The sequence thats a name. More...

#include <sequenceelement.h>

Inheritance diagram for NameSequence:

Inheritance graph
[legend]
Collaboration diagram for NameSequence:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NameSequence (BasicElement *parent=0)
virtual NameSequence * clone ()
virtual bool accept (ElementVisitor *visitor)
virtual QChar getCharacter () const
virtual TokenType getTokenType () const
virtual SequenceElement * getMainChild ()
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)
BasicElement * replaceElement (const SymbolTable &table)
virtual void writeMathML (QDomDocument &doc, QDomNode parent, bool oasisFormat=false)

Static Public Member Functions

static bool isValidSelection (FormulaCursor *cursor)

Protected Member Functions

virtual QString getTagName () const
virtual BasicElement * createElement (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 444 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 1518 of file sequenceelement.cc.

References ElementVisitor::visit().

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 466 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 472 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 477 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 1535 of file sequenceelement.cc.

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

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

References FormulaCursor::getPos(), SequenceElement::moveLeft(), and FormulaCursor::setTo().

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

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

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

References SequenceElement::buildCommand().

Referenced by 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 1609 of file sequenceelement.cc.

References buildCommand().

void NameSequence::setElementType (  ElementType *  t  )  [virtual]
 

Sets a new type.

This is done during parsing.

Reimplemented from BasicElement.

Definition at line 1648 of file sequenceelement.cc.

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

BasicElement * NameSequence::replaceElement (  const SymbolTable &  table  ) 
 

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

Definition at line 1654 of file sequenceelement.cc.

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

bool NameSequence::isValidSelection (  FormulaCursor *  cursor  )  [static]
 

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

Definition at line 1709 of file sequenceelement.cc.

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

void NameSequence::writeMathML (  QDomDocument &  doc,
QDomNode  parent,
bool  oasisFormat = false
)  [virtual]
 

Same as above, just MathML.

Reimplemented from SequenceElement.

Definition at line 1718 of file sequenceelement.cc.

References SequenceElement::countChildren(), and SequenceElement::getChild().

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

Returns the tag name of this element type.

Reimplemented from SequenceElement.

Definition at line 541 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 1685 of file sequenceelement.cc.

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 561 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.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:40:43 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003