21#ifndef KFORMULACONTAINER_H
22#define KFORMULACONTAINER_H
24#include <tqclipboard.h>
29#include <tqptrstack.h>
34#include "KoCommandHistory.h"
35#include "kformuladefs.h"
44KFORMULA_NAMESPACE_BEGIN
72 virtual void changed() {}
78 virtual void tell( const TQString& ) {}
81 virtual void baseSizeChanged( int, bool ) {}
82 virtual const SymbolTable& getSymbolTable() const = 0;
91 friend class MimeSource;
101 enum ViewActions { EXIT_LEFT, EXIT_RIGHT,
102 EXIT_ABOVE, EXIT_BELOW,
103 INSERT_FORMULA, REMOVE_FORMULA };
157 void tell( const TQString& msg );
163 void registerFormula( int pos=-1 );
164 void unregisterFormula();
169 void baseSizeChanged( int size, bool owned );
174 void draw( TQPainter& painter, const TQRect& r,
175 const TQColorGroup& cg, bool edit= false );
180 void draw( TQPainter& painter, const TQRect& r, bool edit= false );
185 void save( TQDomElement &root );
190 void saveMathML( TQTextStream& stream, bool oasisFormat = false );
196 bool loadMathML( const TQDomDocument &doc, bool oasisFormat = false );
202 bool loadMathML( const TQDomElement &doc, bool oasisFormat = false );
207 bool load( const TQDomElement &fe );
212 TQString texString();
214 TQString formulaString();
219 void print(KPrinter& printer);
224 TQImage drawImage( int width, int height );
243 TQRect boundingRect() const;
248 TQRect coveredRect();
250 double width() const;
251 double height() const;
257 double baseline() const;
263 void moveTo( int x, int y );
272 virtual double getDocumentY() const { return -1; }
273 virtual void setDocumentPosition( double , double ) {}
292 virtual void recalc();
306 int fontSize() const;
311 void setFontSize( int pointSize, bool forPrint = false );
313 void setFontSizeDirect( int pointSize );
318 void updateMatrixActions();
337 void formulaChanged( double width, double height );
369 void input( TQKeyEvent* event );
371 void performRequest( Request* request );
383 void paste( const TQDomDocument& document, TQString desc );
409 void emitErrorMsg( const TQString& );
426 bool hasValidCursor() const;
428 struct Container_Impl;
429 Container_Impl* impl;
432 friend class TestFormulaCursor;
433 friend class TestFormulaElement;
434 friend class TestIndexElement;
435 friend class TestCommands;
438KFORMULA_NAMESPACE_END
Basis of every formula element.
void leaveFormula(Container *formula, FormulaCursor *cursor, int cmd) The cursor wants to leave this formula.
void cursorMoved(FormulaCursor *cursor) The cursor has been moved but the formula hasn't been changed.
void errorMsg(const TQString &) A message that describes an error.
virtual double getDocumentX() const KWord uses a transformed painter to draw formulas, so every formula has the internal position (0,...
void formulaChanged(int width, int height) The formula has changed and needs to be redrawn.
void baseSizeChanged(int) We've got a new base size.
virtual void startEvaluation() Start the documents evaluation at this formula.
void statusMsg(const TQString &msg) A message that might be a useful hint.
void formulaLoaded(FormulaElement *) Tells the cursors that we have just loaded a new formula.
void elementWillVanish(BasicElement *element) The element is going to leave the formula with and all its children.
A document that can contain a lot of formulas (container).
The element with up to four indexes in the four corners.
The command history stores a (user) configurable amount of Commands.
Base for all kformula commands.
|