lib
formulaelement.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FORMULAELEMENT_H
00022 #define FORMULAELEMENT_H
00023
00024
00025 #include "sequenceelement.h"
00026
00027 KFORMULA_NAMESPACE_BEGIN
00028
00029 class BasicElement;
00030 class ContextStyle;
00031 class FormulaDocument;
00032 class SymbolTable;
00033
00034
00040 class FormulaElement : public SequenceElement {
00041 typedef SequenceElement inherited;
00042 public:
00043
00048 FormulaElement(FormulaDocument* container);
00049
00050 virtual FormulaElement* clone() { return 0; }
00051
00055 BasicElement* goToPos( FormulaCursor*, const LuPixelPoint& point );
00056
00060 virtual bool readOnly( const BasicElement* ) const { return false; }
00061
00065 virtual bool readOnly( const FormulaCursor* ) const { return false; }
00066
00070 virtual FormulaElement* formula() { return this; }
00071
00075 virtual const FormulaElement* formula() const { return this; }
00076
00081 void elementRemoval(BasicElement* child);
00082
00087 virtual void changed();
00088
00094 void cursorHasMoved( FormulaCursor* );
00095
00096 void moveOutLeft( FormulaCursor* );
00097 void moveOutRight( FormulaCursor* );
00098 void moveOutBelow( FormulaCursor* );
00099 void moveOutAbove( FormulaCursor* );
00100
00104 void tell( const QString& msg );
00105
00110 void removeFormula( FormulaCursor* );
00111
00112 void insertFormula( FormulaCursor* );
00113
00118 virtual void calcSizes( const ContextStyle& context,
00119 ContextStyle::TextStyle tstyle,
00120 ContextStyle::IndexStyle istyle);
00121
00127 virtual void draw( QPainter& painter, const LuPixelRect& r,
00128 const ContextStyle& context,
00129 ContextStyle::TextStyle tstyle,
00130 ContextStyle::IndexStyle istyle,
00131 const LuPixelPoint& parentOrigin );
00132
00136 void calcSizes( ContextStyle& context );
00137
00141 void draw( QPainter& painter, const LuPixelRect& r, ContextStyle& context );
00142
00151 virtual KCommand* buildCommand( Container*, Request* );
00152
00156 const SymbolTable& getSymbolTable() const;
00157
00162 virtual QString toLatex();
00163
00164 int getBaseSize() const { return baseSize; }
00165 void setBaseSize( int size );
00166
00167 bool hasOwnBaseSize() const { return ownBaseSize; }
00168
00169 virtual KCommand* input( Container* container, QKeyEvent* event );
00170
00171 virtual void writeMathML( QDomDocument& doc, QDomNode parent, bool oasisFormat = false );
00172
00176 virtual void writeDom(QDomElement element);
00177
00181 QDomElement emptyFormulaElement( QDomDocument& doc );
00182
00183 protected:
00184
00185
00186
00190 virtual QString getTagName() const { return "FORMULA"; }
00191
00196 virtual bool readAttributesFromDom(QDomElement element);
00197
00203 virtual bool readContentFromDom(QDomNode& node);
00204
00205
00206 private:
00207
00212 void convertNames( QDomNode node );
00213
00217 FormulaDocument* document;
00218
00222 int baseSize;
00223
00227 bool ownBaseSize;
00228 };
00229
00230 KFORMULA_NAMESPACE_END
00231
00232 #endif // FORMULAELEMENT_H
|