kformula/flake

FormulaEditor Class Reference

The Class responsible for manipulating a formula. More...

#include <FormulaEditor.h>

List of all members.

Public Member Functions

 FormulaEditor (FormulaData *data)
 FormulaEditor (FormulaCursor cursor, FormulaData *data)
FormulaCommandchangeTable (bool insert, bool rows)
FormulaCursorcursor ()
FormulaDataformulaData () const
QString inputBuffer () const
FormulaCommandinsertElement (BasicElement *element)
FormulaCommandinsertMathML (const QString &data)
FormulaCommandinsertText (const QString &text)
void paint (QPainter &painter) const
FormulaCommandremove (bool elementBeforePosition)
void setCursor (FormulaCursor &cursor)
void setData (FormulaData *data)

Detailed Description

The Class responsible for manipulating a formula.

Every manipulation of a formula is done by the tool through this class. It holds the current selection and provides methods to change the content of the formula according to this selection. The m_data is used to notify the shape and tool of changes in the formula.

Definition at line 49 of file FormulaEditor.h.


Constructor & Destructor Documentation

FormulaEditor::FormulaEditor ( FormulaCursor  cursor,
FormulaData data 
) [explicit]

The constructor - set the FormulaCursor at the position specified in cursor.

Definition at line 47 of file FormulaEditor.cpp.

FormulaEditor::FormulaEditor ( FormulaData data  )  [explicit]

The constructor - set the FormulaCursor to the left of the main element of data.

Definition at line 53 of file FormulaEditor.cpp.


Member Function Documentation

FormulaCommand * FormulaEditor::changeTable ( bool  insert,
bool  rows 
)

Manipulate the rows/columns of a table.

Definition at line 107 of file FormulaEditor.cpp.

FormulaCursor & FormulaEditor::cursor (  ) 
Returns:
the cursor that contains the current selection and position

Definition at line 241 of file FormulaEditor.cpp.

FormulaData * FormulaEditor::formulaData (  )  const
Returns:
The FormulaData which is navigated by this cursor

Definition at line 209 of file FormulaEditor.cpp.

QString FormulaEditor::inputBuffer (  )  const
Returns:
the buffer with the last user input

Definition at line 214 of file FormulaEditor.cpp.

FormulaCommand * FormulaEditor::insertElement ( BasicElement element  ) 

Insert an element at the current cursor position.

Parameters:
element The element to be inserted

Definition at line 148 of file FormulaEditor.cpp.

FormulaCommand * FormulaEditor::insertMathML ( const QString data  ) 

Insert the elements encoded in MathML in data.

Definition at line 92 of file FormulaEditor.cpp.

FormulaCommand * FormulaEditor::insertText ( const QString text  ) 

Insert text content at the current cursor position.

Parameters:
text The text to insert

Definition at line 66 of file FormulaEditor.cpp.

void FormulaEditor::paint ( QPainter painter  )  const

Draw the cursor to the given QPainter only for convenience.

Parameters:
painter The QPainter the cursor draws itsself to

Definition at line 61 of file FormulaEditor.cpp.

FormulaCommand * FormulaEditor::remove ( bool  elementBeforePosition  ) 

Remove an element from the formula.

Parameters:
elementBeforePosition Indicates removal of element before or after cursor

Definition at line 170 of file FormulaEditor.cpp.

void FormulaEditor::setCursor ( FormulaCursor cursor  ) 

set the cursor that holds the current position and selection

Definition at line 246 of file FormulaEditor.cpp.

void FormulaEditor::setData ( FormulaData data  ) 

set the FormulaData which is navigated by this cursor

Definition at line 203 of file FormulaEditor.cpp.


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