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 StyleAttributes& style );
00122
00128 virtual void draw( QPainter& painter, const LuPixelRect& r,
00129 const ContextStyle& context,
00130 ContextStyle::TextStyle tstyle,
00131 ContextStyle::IndexStyle istyle,
00132 StyleAttributes& style,
00133 const LuPixelPoint& parentOrigin );
00134
00138 void calcSizes( ContextStyle& context );
00139
00143 void draw( QPainter& painter, const LuPixelRect& r, ContextStyle& context );
00144
00153 virtual KCommand* buildCommand( Container*, Request* );
00154
00158 const SymbolTable& getSymbolTable() const;
00159
00164 virtual QString toLatex();
00165
00166 int getBaseSize() const { return baseSize; }
00167 void setBaseSize( int size );
00168
00169 bool hasOwnBaseSize() const { return ownBaseSize; }
00170
00171 virtual KCommand* input( Container* container, QKeyEvent* event );
00172
00173 virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ;
00174
00178 virtual void writeDom(QDomElement element);
00179
00183 QDomElement emptyFormulaElement( QDomDocument& doc );
00184
00185 protected:
00186
00187
00188
00192 virtual QString getTagName() const { return "FORMULA"; }
00193
00198 virtual bool readAttributesFromDom(QDomElement element);
00199
00205 virtual bool readContentFromDom(QDomNode& node);
00206
00207
00208 private:
00209
00214 void convertNames( QDomNode node );
00215
00219 FormulaDocument* document;
00220
00224 int baseSize;
00225
00229 bool ownBaseSize;
00230 };
00231
00232 KFORMULA_NAMESPACE_END
00233
00234 #endif // FORMULAELEMENT_H
|