]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathMacroTable.h
we rely on Windows and maybe Linux on a Qt bug
[lyx.git] / src / mathed / MathMacroTable.h
index bdabb809664e145c90dd44f4de6e6aa78dc6c03c..28d2c289e61f4907951e103c3d1180bfa06740b3 100644 (file)
 #include <string>
 #include <vector>
 
-class MathArray;
+#include "support/docstring.h"
+
+namespace lyx {
 
+class MathArray;
 
 ///
 class MacroData {
@@ -25,23 +28,29 @@ public:
        ///
        MacroData();
        ///
-       MacroData(std::string const & def, int nargs, std::string const & disp);
+       MacroData(docstring const & def, int nargs, docstring const & disp, std::string const &);
        ///
-       std::string def() const { return def_; }
+       docstring def() const { return def_; }
        ///
-       std::string disp() const { return disp_; }
+       docstring disp() const { return disp_; }
        ///
        int numargs() const { return numargs_; }
        /// replace #1,#2,... by given MathAtom 0,1,..
        void expand(std::vector<MathArray> const & from, MathArray & to) const;
+       ///
+       std::string requires() const { return requires_; }
+       ///
+       std::string & requires() { return requires_; }
 
 private:
        ///
-       std::string def_;
+       docstring def_;
        ///
        int numargs_;
        ///
-       std::string disp_;
+       docstring disp_;
+       ///
+       std::string requires_;
 };
 
 
@@ -49,17 +58,17 @@ private:
 // either because they implement a feature of standard LaTeX or some
 // hack to display certain contents nicely.
 
-class MacroTable : public std::map<std::string, MacroData>
+class MacroTable : public std::map<docstring, MacroData>
 {
 public:
-       /// Parse full "\def..." or "\newcommand..." or ...
-       void insert(std::string const & definition);
+       /// Parse full "\\def..." or "\\newcommand..." or ...
+       void insert(docstring const & definition, std::string const &);
        /// Insert pre-digested macro definition
-       void insert(std::string const & name, MacroData const & data);
+       void insert(docstring const & name, MacroData const & data);
        /// Do we have a macro by that name?
-       bool has(std::string const & name) const;
+       bool has(docstring const & name) const;
        ///
-       MacroData const & get(std::string const & name) const;
+       MacroData const & get(docstring const & name) const;
        ///
        void dump();
 
@@ -69,4 +78,7 @@ public:
        //static MacroTable & localMacros();
 };
 
+
+} // namespace lyx
+
 #endif