X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fformulamacro.h;h=05ab42ed21a6ecadeb8b4cbed0baa089f72a0c3b;hb=cd19a0b33bcc87b46c3567928d85a4c724f49db5;hp=3ab9c44acb40b2324f37fecce601924c341270c1;hpb=aae45c2088d0c6530f589b8c6d0d3ecca8240d35;p=lyx.git diff --git a/src/mathed/formulamacro.h b/src/mathed/formulamacro.h index 3ab9c44acb..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,12 +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 - -#include "formula.h" +#include "formulabase.h" #ifdef __GNUG__ #pragma interface @@ -27,17 +25,18 @@ class MathMacroTemplate; +// 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); - /// - ~InsetFormulaMacro(); + /// 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; /// @@ -45,44 +44,34 @@ public: /// int width(BufferView *, LyXFont const &) const; /// - void draw(BufferView *,LyXFont const &, int, float &, bool) const; - /// - void Read(Buffer const *, LyXLex & lex); - /// - void Write(Buffer const *, std::ostream & os) const; + void draw(BufferView *, LyXFont const &, int, float &, bool) const; + /// - int Latex(Buffer const *, std::ostream & os, bool fragile, - bool free_spc) const; + void read(Buffer const *, LyXLex & lex); /// - int Linuxdoc(Buffer const *, std::ostream & os) const; + void write(Buffer const *, std::ostream & os) const; /// - int DocBook(Buffer const *, std::ostream &) const; + int ascii(Buffer const *, std::ostream &, int linelen) const; /// - Inset * Clone(Buffer const &) const; + int latex(Buffer const *, std::ostream & os, bool fragile, bool free_spc) const; /// - Inset::Code LyxCode() const; - /// what appears in the minibuffer when opening - string const EditMessage() const; + int linuxdoc(Buffer const *, std::ostream & os) const; /// - void Edit(BufferView *, int x, int y, unsigned int button); + int docbook(Buffer const *, std::ostream &, bool mixcont) const; + /// - void InsetUnlock(BufferView *); + Inset * clone(Buffer const &, bool same_id = false) const; /// - RESULT LocalDispatch(BufferView *, kb_action, string const &); - -private: + Inset::Code lyxCode() const; /// - bool opened_; + MathInsetTypes getType() const; /// - string name_; + MathAtom const & par() const; /// - boost::shared_ptr tmacro_; + MathAtom & par(); +private: + /// prefix in inset + string prefix() const; }; - -inline -Inset::Code InsetFormulaMacro::LyxCode() const -{ - return Inset::MATHMACRO_CODE; -} #endif