X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fformulamacro.h;h=05ab42ed21a6ecadeb8b4cbed0baa089f72a0c3b;hb=cd19a0b33bcc87b46c3567928d85a4c724f49db5;hp=ece763538a0550c80cc0a312da6eb87ef978e57b;hpb=6b954412883ed962cee39e5cdfc5d9962e893142;p=lyx.git diff --git a/src/mathed/formulamacro.h b/src/mathed/formulamacro.h index ece763538a..05ab42ed21 100644 --- a/src/mathed/formulamacro.h +++ b/src/mathed/formulamacro.h @@ -2,9 +2,9 @@ /* * File: formula.h * Purpose: Declaration of formula inset - * Author: Alejandro Aguilar Sierra + * Author: Alejandro Aguilar Sierra * Created: January 1996 - * Description: Allows the edition of math paragraphs inside Lyx. + * Description: Allows the edition of math paragraphs inside Lyx. * * Copyright: 1996, Alejandro Aguilar Sierra * @@ -14,10 +14,10 @@ * the GNU General Public Licence version 2 or later. */ -#ifndef INSET_FORMULA_MACRO_H +#ifndef INSET_FORMULA_MACRO_H #define INSET_FORMULA_MACRO_H -#include "formula.h" +#include "formulabase.h" #ifdef __GNUG__ #pragma interface @@ -25,18 +25,18 @@ class MathMacroTemplate; -// InsetFormulaMacro's ParInset is the ParInset of the macro definition -// which in turn is stored in the global MathMacroTable. -// No copying/updating needed anymore... +// InsetFormulaMacro's only knows its name and asks the global +// MathMacroTable if it needs to know more. /// -class InsetFormulaMacro: public InsetFormula { +class InsetFormulaMacro: public InsetFormulaBase { public: /// InsetFormulaMacro(); - /// - explicit - InsetFormulaMacro(string name, int na); + /// construct a macro hull from its name and the number of arguments + explicit InsetFormulaMacro(string const & name, int nargs); + /// constructs a mocro from its LaTeX definition + explicit InsetFormulaMacro(string const & s); /// int ascent(BufferView *, LyXFont const &) const; /// @@ -44,35 +44,34 @@ 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 read(Buffer const *, LyXLex & lex); /// - void Read(Buffer const *, LyXLex & lex); + void write(Buffer const *, std::ostream & os) const; /// - void Write(Buffer const *, std::ostream & os) const; + int ascii(Buffer const *, std::ostream &, int linelen) const; /// - int Latex(Buffer const *, std::ostream & os, bool fragile, - bool free_spc) const; + int latex(Buffer const *, std::ostream & os, bool fragile, bool free_spc) const; /// - int Linuxdoc(Buffer const *, std::ostream & os) const; + int linuxdoc(Buffer const *, std::ostream & os) const; /// - int DocBook(Buffer const *, std::ostream &) const; + int docbook(Buffer const *, std::ostream &, bool mixcont) const; + /// - Inset * Clone(Buffer const &) const; + Inset * clone(Buffer const &, bool same_id = false) const; /// - Inset::Code LyxCode() const; - /// what appears in the minibuffer when opening - string const EditMessage() const; + Inset::Code lyxCode() const; /// - RESULT LocalDispatch(BufferView *, kb_action, string const &); + MathInsetTypes getType() const; + /// + MathAtom const & par() const; + /// + MathAtom & par(); private: /// prefix in inset string prefix() const; - /// - MathMacroTemplate * tmacro() const; }; -inline Inset::Code InsetFormulaMacro::LyxCode() const -{ - return Inset::MATHMACRO_CODE; -} #endif