X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fformula.h;h=eb629c90e11c852e60b2c1ac42c043c360685ce9;hb=ec5d8718c51e86b6300de5de29732634cace81d3;hp=e8ce2f22828bc3d200fb575e02314461144a4e73;hpb=6b954412883ed962cee39e5cdfc5d9962e893142;p=lyx.git diff --git a/src/mathed/formula.h b/src/mathed/formula.h index e8ce2f2282..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" -#include - -class MathParInset; -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,100 +43,42 @@ public: /// int width(BufferView *, LyXFont const &) const; /// - void draw(BufferView *,LyXFont const &, int, float &, bool) const; + void draw(BufferView *, LyXFont const &, int, float &, bool) const; + /// - void Write(Buffer const *, std::ostream &) const; + void write(std::ostream &) const; /// - void Read(Buffer const *, LyXLex & lex); + void read(LyXLex & lex); /// - int Latex(Buffer const *, std::ostream &, + int latex(std::ostream &, bool fragile, bool free_spc) const; /// - int Ascii(Buffer const *, std::ostream &, int linelen) const; - /// - int Linuxdoc(Buffer const *, std::ostream &) const; - /// - int DocBook(Buffer const *, std::ostream &) const; - /// - void Validate(LaTeXFeatures &) const; - /// - Inset * Clone(Buffer const &) const; - /// - Inset::Code LyxCode() const; - /// - LyXFont const ConvertFont(LyXFont const & f) const; - /// what appears in the minibuffer when opening - string const EditMessage() const; - /// - void Edit(BufferView *, int x, int y, unsigned int button); - /// - bool display() const; - /// - void display(bool); - /// - void ToggleInsetCursor(BufferView *); - /// - void ShowInsetCursor(BufferView *, bool show = true); + int ascii(std::ostream &, int linelen) const; /// - void HideInsetCursor(BufferView *); + int linuxdoc(std::ostream &) const; /// - void GetCursorPos(BufferView *, int &, int &) const; - /// - void ToggleInsetSelection(BufferView * bv); + int docBook(std::ostream &) const; + /// - void InsetButtonPress(BufferView *, int x, int y, int button); + Inset * clone(Buffer const &) const; /// - void InsetButtonRelease(BufferView *, int x, int y, int button); + void validate(LaTeXFeatures & features) const; /// - void InsetKeyPress(XKeyEvent * ev); + Inset::Code lyxCode() const; /// - void InsetMotionNotify(BufferView *, int x, int y, int state); + virtual RESULT localDispatch(BufferView *, kb_action, string const &); /// - void InsetUnlock(BufferView *); - - /// To allow transparent use of math editing functions - virtual RESULT LocalDispatch(BufferView *, kb_action, string const &); - + std::vector const getLabelList() const; /// - void InsertSymbol(BufferView *, string const &); + void handleExtern(string const & arg, BufferView * bv); /// - bool SetNumber(bool); + MathMatrixInset * par() const; /// - std::vector const getLabelList() const; - -protected: - /// - void UpdateLocal(BufferView * bv); + bool display() const; /// - //boost::shared_ptr par; - MathParInset * par; - + bool ams() const; private: - /// - bool disp_flag_; + /// Safe setting of contents + void par(MathInset *); }; - - -inline -Inset::Code InsetFormula::LyxCode() const -{ - return Inset::MATH_CODE; -} - - -inline -LyXFont const InsetFormula::ConvertFont(LyXFont const & f) const -{ - // We have already discussed what was here - LyXFont font(f); - font.setLatex(LyXFont::OFF); - return font; -} - - -inline -bool InsetFormula::display() const -{ - return disp_flag_; -} #endif