X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fformula.h;h=eb629c90e11c852e60b2c1ac42c043c360685ce9;hb=ec5d8718c51e86b6300de5de29732634cace81d3;hp=b2406d0578b8c4f4bb554ec6240a602e3cf46736;hpb=666140b7f20ad45d69b6c8aad25ae37f79ef03b1;p=lyx.git diff --git a/src/mathed/formula.h b/src/mathed/formula.h index b2406d0578..eb629c90e1 100644 --- a/src/mathed/formula.h +++ b/src/mathed/formula.h @@ -21,25 +21,21 @@ #pragma interface #endif -#include +#include "LString.h" +#include "mathed/formulabase.h" +#include "math_defs.h" -#include "insets/lyxinset.h" - -class MathParInset; -class MathedCursor; -class Buffer; +class MathMatrixInset; /// -class InsetFormula: public UpdatableInset { +class InsetFormula : public InsetFormulaBase { public: /// - explicit - InsetFormula(bool display = false); + InsetFormula(); /// - explicit - InsetFormula(MathParInset *); + explicit InsetFormula(MathInsetTypes); /// - ~InsetFormula(); + explicit InsetFormula(string const &); /// int ascent(BufferView *, LyXFont const &) const; /// @@ -47,84 +43,42 @@ public: /// int width(BufferView *, LyXFont const &) const; /// - void draw(BufferView *,LyXFont const &, int, float &, bool) const; - /// - void Write(Buffer const *, std::ostream &) const; - /// - void Read(Buffer const *, LyXLex & lex); - /// - int Latex(Buffer const *, std::ostream &, bool fragile, bool free_spc) const; - /// - int Ascii(Buffer const *, std::ostream &) const; - /// - int Linuxdoc(Buffer const *, std::ostream &) const; - /// - int DocBook(Buffer const *, std::ostream &) const; - /// - void Validate(LaTeXFeatures &) const; - /// - Inset * Clone() const; - /// - Inset::Code LyxCode() const { return Inset::MATH_CODE; } - /// - LyXFont ConvertFont(LyXFont font) { - // We have already discussed what was here - font.setLatex(LyXFont::OFF); - return font; - } + void draw(BufferView *, LyXFont const &, int, float &, bool) const; - /// what appears in the minibuffer when opening - char const * EditMessage() const; - /// - void Edit(BufferView *, int x, int y, unsigned int button); /// - bool display() const { return (disp_flag) ? true: false; } + void write(std::ostream &) const; /// - void display(bool); + void read(LyXLex & lex); /// - void ToggleInsetCursor(BufferView *); + int latex(std::ostream &, + bool fragile, bool free_spc) const; /// - void ShowInsetCursor(BufferView *); + int ascii(std::ostream &, int linelen) const; /// - void HideInsetCursor(BufferView *); + int linuxdoc(std::ostream &) const; /// - void GetCursorPos(BufferView *, int &, int &) const; + int docBook(std::ostream &) const; + /// - void ToggleInsetSelection(BufferView * bv); + Inset * clone(Buffer const &) const; /// - void InsetButtonPress(BufferView *, int x, int y, int button); + void validate(LaTeXFeatures & features) const; /// - void InsetButtonRelease(BufferView *, int x, int y, int button); + Inset::Code lyxCode() const; /// - void InsetKeyPress(XKeyEvent * ev); + virtual RESULT localDispatch(BufferView *, kb_action, string const &); /// - void InsetMotionNotify(BufferView *, int x, int y, int state); + std::vector const getLabelList() const; /// - void InsetUnlock(BufferView *); - - /// To allow transparent use of math editing functions - virtual RESULT LocalDispatch(BufferView *, int, string const &); - + void handleExtern(string const & arg, BufferView * bv); /// - void InsertSymbol(BufferView *, char const *); + MathMatrixInset * par() const; /// - bool SetNumber(bool); + bool display() const; /// - std::vector getLabelList() const; - -protected: - void UpdateLocal(BufferView * bv); - MathParInset * par; - static MathedCursor * mathcursor; - + bool ams() const; private: - bool disp_flag; - string label; + /// Safe setting of contents + void par(MathInset *); }; - - -// If a mathinset exist at cursor pos, just lock it. -// Otherwise create a new one, and lock it. -bool OpenMathInset(Buffer *); - #endif