lib
NameSequence Class Reference
#include <sequenceelement.h>
Inheritance diagram for NameSequence:

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.
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, 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, QChar ch) |
virtual void | setElementType (ElementType *t) |
BasicElement * | replaceElement (const SymbolTable &table) |
Static Public Member Functions | |
static bool | isValidSelection (FormulaCursor *cursor) |
Protected Member Functions | |
virtual QString | getTagName () const |
virtual QString | getElementName () const |
virtual BasicElement * | createElement (QString type) |
virtual bool | isFirstOfToken (BasicElement *) |
Member Function Documentation
bool NameSequence::accept | ( | ElementVisitor * | visitor | ) | [virtual] |
Visit this element.
An implementation of the visitor pattern.
Reimplemented from SequenceElement.
Definition at line 1612 of file sequenceelement.cc.
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 514 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 520 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 525 of file sequenceelement.h.
void NameSequence::drawCursor | ( | QPainter & | 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 1629 of file sequenceelement.cc.
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 1646 of file sequenceelement.cc.
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 1657 of file sequenceelement.cc.
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 1682 of file sequenceelement.cc.
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 1704 of file sequenceelement.cc.
void NameSequence::setElementType | ( | ElementType * | t | ) | [virtual] |
Sets a new type.
This is done during parsing.
Reimplemented from BasicElement.
Definition at line 1743 of file sequenceelement.cc.
BasicElement * NameSequence::replaceElement | ( | const SymbolTable & | table | ) |
- Returns:
- the element this sequence is to be replaced with.
Definition at line 1749 of file sequenceelement.cc.
bool NameSequence::isValidSelection | ( | FormulaCursor * | cursor | ) | [static] |
Tests whether the selected elements can be inserted in a name sequence.
Definition at line 1804 of file sequenceelement.cc.
virtual QString NameSequence::getTagName | ( | ) | const [inline, protected, virtual] |
Returns the tag name of this element type.
Reimplemented from SequenceElement.
Definition at line 588 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
Definition at line 1780 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 609 of file sequenceelement.h.
The documentation for this class was generated from the following files: