]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetFormulaMacro.h
fix a crash when the inset containing the new word at cursor is deleted
[lyx.git] / src / mathed / InsetFormulaMacro.h
index 5c0a325957a52c9befa4918acf57ba321465e573..0e4e3ba70044bd707e59fbec92faba7203cefab5 100644 (file)
@@ -5,7 +5,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Alejandro Aguilar Sierra
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
 
 #include "InsetMathNest.h"
 
+
+namespace lyx {
+
 class MathMacroTemplate;
-class LyXLex;
+class Lexer;
 
 
 // An InsetFormulaMacro only knows its name and asks the global
@@ -26,47 +29,49 @@ class LyXLex;
 class InsetFormulaMacro : public InsetMathNest {
 public:
        ///
-       InsetFormulaMacro();
+       InsetFormulaMacro(Buffer * buf);
        /// construct a macro hull from its name and the number of arguments
-       InsetFormulaMacro(std::string const & name, int nargs, std::string const & t);
+       InsetFormulaMacro(Buffer * buf, docstring const & name, int nargs, docstring const & t);
        /// constructs a mocro from its LaTeX definition
-       explicit InsetFormulaMacro(std::string const & s);
+       explicit InsetFormulaMacro(docstring 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(Lexer & lex);
        ///
-       void write(Buffer const &, std::ostream & os) const;
+       void write(std::ostream & os) const;
        ///
-       int plaintext(Buffer const &, lyx::odocstream &,
-                 OutputParams const &) const;
+       int latex(otexstream & os, OutputParams const &) const;
        ///
-       int latex(Buffer const &, std::ostream & os,
-                 OutputParams const &) const;
+       int plaintext(odocstream &, OutputParams const &) const;
        ///
-       int docbook(Buffer const &, std::ostream &,
-                   OutputParams const &) const;
+       int docbook(odocstream &, OutputParams const &) const;
 
        ///
-       std::auto_ptr<InsetBase> clone() const;
+       InsetCode lyxCode() const { return MATHMACRO_CODE_CODE; }
        ///
-       InsetBase::Code lyxCode() const { return MATHMACRO_CODE; }
+       docstring const & getInsetName() const { return name_; }
        ///
-       std::string const & getInsetName() const { return name_; }
+       bool editable() const { return true; }
        ///
-       EDITABLE editable() const { return HIGHLY_EDITABLE; }
+       InsetCode lyxCode() const { return MATH_FORMULA_MACRO_CODE; }
 private:
        ///
        MathAtom & tmpl() const;
        ///
        void read(std::istream & is);
        /// prefix in inset
-       std::string prefix() const;
+       docstring prefix() const;
+       ///
+       docstring name_;
        ///
-       std::string name_;
+       Inset * clone() const;
 };
 
+
+} // namespace lyx
+
 #endif