]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formulamacro.h
Fix to bug 2362: Deleting superscript also deletes subscript.
[lyx.git] / src / mathed / formulamacro.h
index 34bfc15e9d920b762c07696897add7d448ed0f45..f55fdbffba71250194a14f4c8aba25846801d409 100644 (file)
 #ifndef INSET_FORMULA_MACRO_H
 #define INSET_FORMULA_MACRO_H
 
-#include "formulabase.h"
-
+#include "math_nestinset.h"
 
 class MathMacroTemplate;
+class LyXLex;
+
 
 // An InsetFormulaMacro only knows its name and asks the global
 // MathMacroTable if it needs to know more.
 
 /// Main LyX Inset for defining math macros
-class InsetFormulaMacro : public InsetFormulaBase {
+class InsetFormulaMacro : public MathNestInset {
 public:
        ///
        InsetFormulaMacro();
        /// construct a macro hull from its name and the number of arguments
-       explicit InsetFormulaMacro(string const & name, int nargs, string const & t);
+       InsetFormulaMacro(std::string const & name, int nargs, std::string const & t);
        /// constructs a mocro from its LaTeX definition
-       explicit InsetFormulaMacro(string const & s);
+       explicit InsetFormulaMacro(std::string const & s);
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
@@ -40,28 +41,35 @@ public:
        ///
        void write(Buffer const &, std::ostream & os) const;
        ///
-       int ascii(Buffer const &, std::ostream &, int linelen) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int latex(Buffer const &, std::ostream & os,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int linuxdoc(Buffer const &, std::ostream & os) const;
+       int linuxdoc(Buffer const &, std::ostream & os,
+                    OutputParams const &) const;
        ///
-       int docbook(Buffer const &, std::ostream &, bool mixcont) const;
+       int docbook(Buffer const &, std::ostream &,
+                   OutputParams const &) const;
 
        ///
-       virtual std::auto_ptr<InsetBase> clone() const;
+       std::auto_ptr<InsetBase> clone() const;
        ///
-       InsetOld::Code lyxCode() const;
+       InsetBase::Code lyxCode() const { return MATHMACRO_CODE; }
        ///
-       MathAtom const & par() const;
+       std::string const & getInsetName() const { return name_; }
        ///
-       MathAtom & par();
+       EDITABLE editable() const { return HIGHLY_EDITABLE; }
 private:
+       ///
+       MathAtom & tmpl() const;
        ///
        void read(std::istream & is);
        /// prefix in inset
-       string prefix() const;
+       std::string prefix() const;
+       ///
+       std::string name_;
 };
 
 #endif