X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fformula.h;h=eb629c90e11c852e60b2c1ac42c043c360685ce9;hb=ec5d8718c51e86b6300de5de29732634cace81d3;hp=8d83521b9294ee59ac917a7ebc8fa44c1f994955;hpb=65b49997597efd5a5ba920c739ba6cd8384e1eeb;p=lyx.git diff --git a/src/mathed/formula.h b/src/mathed/formula.h index 8d83521b92..eb629c90e1 100644 --- a/src/mathed/formula.h +++ b/src/mathed/formula.h @@ -6,7 +6,7 @@ * Created: January 1996 * Description: Allows the edition of math paragraphs inside Lyx. * - * Copyright: (c) 1996, Alejandro Aguilar Sierra + * Copyright: 1996, Alejandro Aguilar Sierra * * Version: 0.4, Lyx project. * @@ -21,108 +21,64 @@ #pragma interface #endif -#include "insets/lyxinset.h" +#include "LString.h" +#include "mathed/formulabase.h" +#include "math_defs.h" - -class MathParInset; -class MathedCursor; +class MathMatrixInset; /// -class InsetFormula: public UpdatableInset { +class InsetFormula : public InsetFormulaBase { public: /// - InsetFormula(bool display = false); - /// - InsetFormula(MathParInset *); - /// - ~InsetFormula(); - /// - int Ascent(LyXFont const & font) const; - /// - int Descent(LyXFont const & font) const; - /// - int Width(LyXFont const & font) const; - /// - void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x); - /// - void Write(FILE * file); - /// - void Read(LyXLex & lex); + InsetFormula(); /// - int Latex(FILE * file, signed char fragile); + explicit InsetFormula(MathInsetTypes); /// - int Latex(string & file, signed char fragile); + explicit InsetFormula(string const &); /// - int Linuxdoc(string & file); + int ascent(BufferView *, LyXFont const &) const; /// - int DocBook(string & file); + int descent(BufferView *, LyXFont const &) const; /// - void Validate(LaTeXFeatures &) const; + int width(BufferView *, LyXFont const &) 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 {return _("Math editor mode");} - /// - void Edit(int x, int y); - /// - bool display() const { return (disp_flag) ? true: false; } /// - void display(bool); + void write(std::ostream &) const; /// - void ToggleInsetCursor(); + void read(LyXLex & lex); /// - void ShowInsetCursor(); + int latex(std::ostream &, + bool fragile, bool free_spc) const; /// - void HideInsetCursor(); + int ascii(std::ostream &, int linelen) const; /// - void GetCursorPos(int &, int &) const; + int linuxdoc(std::ostream &) const; /// - void ToggleInsetSelection(); + int docBook(std::ostream &) const; + /// - void InsetButtonPress(int x, int y, int button); + Inset * clone(Buffer const &) const; /// - void InsetButtonRelease(int x, int y, int button); + void validate(LaTeXFeatures & features) const; /// - void InsetKeyPress(XKeyEvent * ev); + Inset::Code lyxCode() const; /// - void InsetMotionNotify(int x, int y, int state); + virtual RESULT localDispatch(BufferView *, kb_action, string const &); /// - void InsetUnlock(); - - /// To allow transparent use of math editing functions - virtual bool LocalDispatch(int, char const *); - + std::vector const getLabelList() const; /// - void InsertSymbol(char const *); + void handleExtern(string const & arg, BufferView * bv); /// - bool SetNumber(bool); + MathMatrixInset * par() const; /// - int GetNumberOfLabels() const; + bool display() const; /// - string getLabel(int) const; - -protected: - void UpdateLocal(); - 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