]> 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 41fd9bbf6edecacf44f1588fd9a06b00425bdae3..f55fdbffba71250194a14f4c8aba25846801d409 100644 (file)
@@ -1,69 +1,75 @@
 // -*- C++ -*-
-
-/*
- *  Main LyX Inset for defining math macros
- *
- *  \author Alejandro Aguilar Sierra
- *  \author André Pönitz
+/**
+ * \file formulamacro.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *  Full author contact details are available in file CREDITS
+ * \author Alejandro Aguilar Sierra
+ * \author André Pönitz
  *
- *  You are free to use and modify this code under the terms of
- *  the GNU General Public Licence version 2 or later.
+ * Full author contact details are available in file CREDITS.
  */
 
 #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.
 
-///
-class InsetFormulaMacro : public InsetFormulaBase {
+/// Main LyX Inset for defining math macros
+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);
+       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;
        ///
        void draw(PainterInfo & pi, int x, int y) 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 plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
-       int latex(Buffer const *, std::ostream & os,
-                 LatexRunParams const &) const;
+       int latex(Buffer const &, std::ostream & os,
+                 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;
 
        ///
-       Inset * clone() const;
+       std::auto_ptr<InsetBase> clone() const;
        ///
-       Inset::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