3 * \file MathMacroTable.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef MATH_MACROTABLE_H
13 #define MATH_MACROTABLE_H
31 MacroData(std::string const & def, int nargs, std::string const & disp);
33 std::string def() const { return def_; }
35 std::string disp() const { return disp_; }
37 int numargs() const { return numargs_; }
38 /// replace #1,#2,... by given MathAtom 0,1,..
39 void expand(std::vector<MathArray> const & from, MathArray & to) const;
51 // This contains a table of "global" macros that are always accessible,
52 // either because they implement a feature of standard LaTeX or some
53 // hack to display certain contents nicely.
55 class MacroTable : public std::map<std::string, MacroData>
58 /// Parse full "\def..." or "\newcommand..." or ...
59 void insert(std::string const & definition);
60 /// Insert pre-digested macro definition
61 void insert(std::string const & name, MacroData const & data);
62 /// Do we have a macro by that name?
63 bool has(std::string const & name) const;
65 MacroData const & get(std::string const & name) const;
70 static MacroTable & globalMacros();
71 /// the local list hack
72 //static MacroTable & localMacros();