48
48
FormulaElement(FormulaDocument* container);
50
virtual FormulaElement* clone() { return 0; }
51
53
* Returns the element the point is in.
53
BasicElement* goToPos(FormulaCursor*, const KoPoint& point);
55
BasicElement* goToPos( FormulaCursor*, const LuPixelPoint& point );
58
* Ordinary formulas are not write protected.
60
virtual bool readOnly( const BasicElement* /*child*/ ) const { return false; }
63
* @returns whether its prohibited to change the sequence with this cursor.
65
virtual bool readOnly( const FormulaCursor* ) const { return false; }
56
68
* Provide fast access to the rootElement for each child.
72
84
* Gets called whenever something changes and we need to
87
virtual void changed();
90
* Gets called when a request has the side effect of moving the
91
* cursor. In the end any operation that moves the cursor should
94
void cursorHasMoved( FormulaCursor* );
96
void moveOutLeft( FormulaCursor* );
97
void moveOutRight( FormulaCursor* );
98
void moveOutBelow( FormulaCursor* );
99
void moveOutAbove( FormulaCursor* );
102
* Tell the user something has happened.
104
void tell( const QString& msg );
107
* Gets called when the formula wants to vanish. The one who
108
* holds it should create an appropriate command and execute it.
110
void removeFormula( FormulaCursor* );
112
void insertFormula( FormulaCursor* );
115
* Calculates our width and height and
116
* our children's parentPosition.
118
virtual void calcSizes( const ContextStyle& context,
119
ContextStyle::TextStyle tstyle,
120
ContextStyle::IndexStyle istyle);
123
* Draws the whole element including its children.
124
* The `parentOrigin' is the point this element's parent starts.
125
* We can use our parentPosition to get our own origin then.
127
virtual void draw( QPainter& painter, const LuPixelRect& r,
128
const ContextStyle& context,
129
ContextStyle::TextStyle tstyle,
130
ContextStyle::IndexStyle istyle,
131
const LuPixelPoint& parentOrigin );
78
134
* Calculates the formulas sizes and positions.
83
139
* Draws the whole thing.
85
void draw( QPainter& painter, const QRect& r, ContextStyle& context );
141
void draw( QPainter& painter, const LuPixelRect& r, ContextStyle& context );
144
* This is called by the container to get a command depending on
145
* the current cursor position (this is how the element gets chosen)
148
* @returns the command that performs the requested action with
149
* the containers active cursor.
151
virtual KCommand* buildCommand( Container*, Request* );
88
154
* @returns our documents symbol table
96
162
virtual QString toLatex();
98
double getBaseSize() const { return baseSize; }
99
void setBaseSize( double size ) { baseSize = size; }
164
int getBaseSize() const { return baseSize; }
165
void setBaseSize( int size );
167
bool hasOwnBaseSize() const { return ownBaseSize; }
169
virtual KCommand* input( Container* container, QKeyEvent* event );
171
virtual void writeMathML( QDomDocument doc, QDomNode parent );
174
* Appends our attributes to the dom element.
176
virtual void writeDom(QDomElement element);
179
* For copy&paste we need to create an empty XML element.
181
QDomElement emptyFormulaElement( QDomDocument doc );
108
190
virtual QString getTagName() const { return "FORMULA"; }
111
* Appends our attributes to the dom element.
113
virtual void writeDom(QDomElement& element);
116
193
* Reads our attributes from the element.
117
194
* Returns false if it failed.
119
virtual bool readAttributesFromDom(QDomElement& element);
196
virtual bool readAttributesFromDom(QDomElement element);
122
199
* Reads our content from the node. Sets the node to the next node
209
* The introduction of 'NameSequence' changed the DOM.
210
* However, we need to read the old version.
212
void convertNames( QDomNode node );
132
215
* The document that owns (is) this formula.
134
217
FormulaDocument* document;