lib
FormulaCursor Class Reference
#include <formulacursor.h>
Detailed Description
The selection.This might be a position selection or an area. Each view will need one FormulaCursor.
The Container always uses the cursor to operate on the element tree.
Note that it is up to the elements to actually move the cursor. (The cursor has no chance to know how.)
Definition at line 50 of file formulacursor.h.
Public Member Functions | |
FormulaCursor (FormulaElement *element) | |
FormulaCursor & | operator= (const FormulaCursor &) |
int | getPos () const |
int | getMark () const |
bool | hasChanged () const |
void | clearChangedFlag () |
bool | isSelectionMode () const |
bool | isSelection () const |
void | setSelection (bool selection) |
void | calcCursorSize (const ContextStyle &context, bool smallCursor) |
void | draw (QPainter &, const ContextStyle &context, bool smallCursor, bool activeCursor) |
void | moveLeft (int flag=NormalMovement) |
void | moveRight (int flag=NormalMovement) |
void | moveUp (int flag=NormalMovement) |
void | moveDown (int flag=NormalMovement) |
void | moveHome (int flag=NormalMovement) |
void | moveEnd (int flag=NormalMovement) |
bool | isHome () const |
bool | isEnd () const |
bool | getLinearMovement () const |
void | setLinearMovement (bool linear) |
void | goInsideElement (BasicElement *element) |
void | mousePress (const LuPixelPoint &, int flags) |
void | mouseMove (const LuPixelPoint &, int flags) |
void | mouseRelease (const LuPixelPoint &, int flags) |
void | insert (BasicElement *, Direction=beforeCursor) |
void | insert (QPtrList< BasicElement > &, Direction=beforeCursor) |
void | remove (QPtrList< BasicElement > &, Direction=beforeCursor) |
void | replaceSelectionWith (BasicElement *, Direction=beforeCursor) |
BasicElement * | replaceByMainChildContent (Direction=beforeCursor) |
BasicElement * | removeEnclosingElement (Direction=beforeCursor) |
bool | elementIsSenseless () |
int | getSelectionStart () const |
int | getSelectionEnd () const |
void | setTo (BasicElement *element, int cursor, int mark=-1) |
void | setPos (int pos) |
void | setMark (int mark) |
BasicElement * | getElement () |
const BasicElement * | getElement () const |
void | normalize (Direction direction=beforeCursor) |
SequenceElement * | normal () |
const SequenceElement * | normal () const |
IndexElement * | getActiveIndexElement () |
RootElement * | getActiveRootElement () |
SymbolElement * | getActiveSymbolElement () |
NameSequence * | getActiveNameSequence () |
TextElement * | getActiveTextElement () |
MatrixElement * | getActiveMatrixElement () |
void | selectActiveElement () |
void | copy (QDomDocument &doc) |
bool | buildElementsFromDom (QDomElement root, QPtrList< BasicElement > &list) |
CursorData * | getCursorData () |
void | setCursorData (CursorData *data) |
void | elementWillVanish (BasicElement *element) |
void | formulaLoaded (FormulaElement *rootElement) |
const LuPixelPoint & | getCursorPoint () const |
const LuPixelRect & | getCursorSize () const |
void | addCursorSize (const LuPixelRect &rect) |
bool | isReadOnly () const |
void | setReadOnly (bool ro) |
Friends | |
class | SequenceElement |
Classes | |
class | CursorData |
A black box that is supposed to contain everything which is needed to describe a cursor. More... |
Constructor & Destructor Documentation
|
Creates a cursor and puts is at the beginning of the formula.
Definition at line 37 of file formulacursor.cc. |
Member Function Documentation
|
Inserts the elements that could be read from the dom into the list. Returns true on success. Definition at line 661 of file formulacursor.cc. |
|
Calculates the size of the cursor. Needs to be called before the cursor can be drawn. Definition at line 72 of file formulacursor.cc. |
|
Resets the cursor's change flag. The widget calls this if it has drawn the cursor. Definition at line 80 of file formulacursor.h. |
|
Stores the currently selected elements inside a dom.
Definition at line 639 of file formulacursor.cc. |
|
Draws the cursor at its current position. The cursor will always be drawn in xor mode. Definition at line 82 of file formulacursor.cc. |
|
Returns wether the element the cursor points to should be replaced. Elements are senseless as soon as they only contain a main child. Definition at line 430 of file formulacursor.cc. |
|
The element is going to leave the formula with and all its children.
Definition at line 587 of file formulacursor.cc. |
|
A new formula has been loaded. Our current element has to change. Definition at line 611 of file formulacursor.cc. |
|
Returns the IndexElement the cursor is on or 0 if there is non.
Definition at line 493 of file formulacursor.cc. |
|
Definition at line 568 of file formulacursor.cc. |
|
Definition at line 546 of file formulacursor.cc. |
|
Returns the RootElement the cursor is on or 0 if there is non.
Definition at line 511 of file formulacursor.cc. |
|
Returns the SymbolElement the cursor is on or 0 if there is non.
Definition at line 529 of file formulacursor.cc. |
|
Definition at line 562 of file formulacursor.cc. |
|
Creates a new CursorData object that describes the cursor. It's up to the caller to delete this object. Definition at line 679 of file formulacursor.cc. |
|
Definition at line 349 of file formulacursor.h. |
|
Definition at line 354 of file formulacursor.h. |
|
The element we are in. In most cases this is a SequenceElement. There is no way to place a cursor outside a SequenceElement by normal movement. But in special cases (e.g. if you remove an index from an IndexElement) the cursor can be placed to odd places. This is the reason why you have to normalize the cursor after each removal. Definition at line 231 of file formulacursor.h. |
|
Moves the cursor inside the element. Selection is turned off. Definition at line 274 of file formulacursor.cc. |
|
Tells whether the cursor has changed since last cleaning.
Definition at line 74 of file formulacursor.h. |
|
Inserts the listed children at the current position. Ignores the selection. The list will be emptied. Definition at line 304 of file formulacursor.cc. |
|
Inserts the child at the current position. Ignores the selection. Definition at line 297 of file formulacursor.cc. |
|
Definition at line 189 of file formulacursor.cc. |
|
Definition at line 184 of file formulacursor.cc. |
|
Definition at line 621 of file formulacursor.cc. |
|
Returns wether there actually is a selection.
Definition at line 90 of file formulacursor.h. |
|
Returns wether we are in selection mode.
Definition at line 85 of file formulacursor.h. |
|
Returns the sequence the cursor is in if we are normal. If not returns 0. Definition at line 719 of file formulacursor.cc. |
|
Moves the cursor to a normal position. That is somewhere inside a SequenceElement. You need to call this after each removal because the cursor might point to some non existing place. Definition at line 286 of file formulacursor.cc. |
|
Removes the current selected children and returns them. The cursor needs to be normal (that is be inside a SequenceElement) for this to have any effect. Definition at line 318 of file formulacursor.cc. |
|
Trys to find the element we are the main child of and replace it with our content. This is simply another form of replaceByMainChildContent. You use this one if the cursor is normalized and inside the main child. Definition at line 412 of file formulacursor.cc. |
|
Replaces the element the cursor points to with its main child's content.
Definition at line 383 of file formulacursor.cc. |
|
Replaces the current selection with the supplied element. The replaced elements become the new element's main child's content. Definition at line 346 of file formulacursor.cc. |
|
Selects the element the cursor points to (stands after) if there is such an element and if there is no selection.
Definition at line 465 of file formulacursor.cc. |
|
Sets the cursor to where the CursorData points to. No checking is done so you better make sure the point exists. Definition at line 704 of file formulacursor.cc. |
|
Sets the cursor in linear mode. This means you can visit every element just by moving left and right. Definition at line 134 of file formulacursor.h. |
|
Puts the widget in read only mode.
Definition at line 365 of file formulacursor.h. |
|
Sets the selection mode.
Definition at line 95 of file formulacursor.h. |
|
Sets the cursor to a new position. This gets called from the element that wants to own the cursor. It is a mistake to call this if you aren't an element. If you provide a mark >= 0 the selection gets turned on. If there is a selection and you don't provide a mark the current mark won't change. Definition at line 45 of file formulacursor.cc. |
The documentation for this class was generated from the following files: