]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MacroTable.h
Revert "XHTML: remove DOCTYPE, as the document is then understood as HTML4/XHTML1...
[lyx.git] / src / mathed / MacroTable.h
index 0f9f60dc41b74f8a67301f555fba3296cda6aafe..acc4004109d8e4e9e85398554977b48bd0915e4e 100644 (file)
@@ -25,8 +25,9 @@ namespace lyx {
 
 class Buffer;
 class MathData;
-class MathMacroTemplate;
+class InsetMathMacroTemplate;
 class Paragraph;
+class latexkeys;
 
 enum MacroType {
        MacroTypeNewcommand,
@@ -38,11 +39,11 @@ enum MacroType {
 class MacroData {
 public:
        /// Constructor to make STL containers happy
-       MacroData(Buffer * buf = 0);
+       explicit MacroData(Buffer * buf = 0);
        /// Create lazy MacroData which only queries the macro template when needed
        MacroData(Buffer * buf, DocIterator const & pos);
        /// Create non-lazy MacroData which directly queries the macro template
-       MacroData(Buffer * buf, MathMacroTemplate const & macro);
+       MacroData(Buffer * buf, InsetMathMacroTemplate const & macro);
 
        ///
        docstring const & definition() const { updateData(); return definition_; }
@@ -59,9 +60,21 @@ public:
        ///
        std::vector<docstring> const & defaults() const;
        ///
-       std::string const & requires() const { return requires_; }
+       std::string const required() const;
        ///
-       std::string & requires() { return requires_; }
+       bool hidden() const;
+       ///
+       docstring const htmlname() const;
+       ///
+       docstring const xmlname() const;
+       ///
+       char const * MathMLtype() const;
+       ///
+       latexkeys const * symbol() const { return sym_; }
+       ///
+       void setSymbol(latexkeys const * sym) { sym_ = sym; }
+       ///
+       DocIterator const & pos() { return pos_; }
 
        /// lock while being drawn to avoid recursions
        int lock() const { return ++lockCount_; }
@@ -86,7 +99,7 @@ public:
                return definition_ == x.definition_
                        && numargs_ == x.numargs_
                        && display_ == x.display_
-                       && requires_ == x.requires_
+                       && sym_ == x.sym_
                        && optionals_ == x.optionals_
                        && defaults_ == x.defaults_;
        }
@@ -95,7 +108,7 @@ public:
 
 private:
        ///
-       void queryData(MathMacroTemplate const & macro) const;
+       void queryData(InsetMathMacroTemplate const & macro) const;
        ///
        void updateData() const;
        ///
@@ -118,7 +131,7 @@ private:
        ///
        mutable docstring display_;
        ///
-       std::string requires_;
+       latexkeys const * sym_;
        ///
        mutable size_t optionals_;
        ///
@@ -149,7 +162,7 @@ class MacroTable : public std::map<docstring, MacroData>
 {
 public:
        /// Parse full "\\def..." or "\\newcommand..." or ...
-       iterator insert(Buffer * buf, docstring const & definition, std::string const &);
+       iterator insert(Buffer * buf, docstring const & definition);
        /// Insert pre-digested macro definition
        iterator insert(docstring const & name, MacroData const & data);
        ///
@@ -157,7 +170,7 @@ public:
        ///
        void dump();
        ///
-       void getMacroNames(std::set<docstring> & names) const;
+       void getMacroNames(std::set<docstring> & names, bool gethidden) const;
 
        /// the global list
        static MacroTable & globalMacros();