]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathMacroTemplate.h
Allows editing when the Prefs dialog is opened; fix bug 3140:
[lyx.git] / src / mathed / MathMacroTemplate.h
index 580b6b16d4bda3377960c5258e35c85da024d999..4682df22e86fde854ab2cc5f44b6418a0080c916 100644 (file)
 
 #include "support/types.h"
 
+
+namespace lyx {
+
 /// This class contains the macro definition.
 class MathMacroTemplate : public InsetMathNest {
 public:
        ///
        MathMacroTemplate();
        ///
-       MathMacroTemplate(std::string const & name, int nargs,
-               std::string const & type,
+       MathMacroTemplate(docstring const & name, int nargs,
+               docstring const & type,
                MathArray const & = MathArray(),
                MathArray const & = MathArray());
        ///
-       explicit MathMacroTemplate(std::istream & is);
+       explicit MathMacroTemplate(const docstring & str);
        ///
        void edit(LCursor & cur, bool left);
        ///
@@ -46,13 +49,13 @@ public:
        ///
        void numargs(int);
        ///
-       std::string name() const;
+       docstring name() const;
        ///
        MacroData asMacroData() const;
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       bool metrics(MetricsInfo & mi, Dimension & dim) const;
        /// identifies macro templates
        MathMacroTemplate * asMacroTemplate() { return this; }
        /// identifies macro templates
@@ -63,14 +66,17 @@ public:
 private:
        virtual std::auto_ptr<InsetBase> doClone() const;
        /// prefix in inset
-       lyx::docstring prefix() const;
+       docstring prefix() const;
 
        ///
        int numargs_;
        ///
-       std::string name_;
+       docstring name_;
        /// newcommand or renewcommand or def
-       std::string type_;
+       docstring type_;
 };
 
+
+} // namespace lyx
+
 #endif