3 * \file math_macrotable.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
28 MacroData(std::string const & def, int nargs, std::string const & disp);
30 std::string def() const { return def_; }
32 std::string disp() const { return disp_; }
34 int numargs() const { return numargs_; }
35 /// replace #1,#2,... by given MathAtom 0,1,..
36 void expand(std::vector<MathArray> const & from, MathArray & to) const;
48 // This contains a table of "global" macros that are always accessible,
49 // either because they implement a feature of standard LaTeX or some
50 // hack to display certain contents nicely.
52 class MacroTable : public std::map<std::string, MacroData>
55 /// Parse full "\def..." or "\newcommand..." or ...
56 void insert(std::string const & definition);
57 /// Insert pre-digested macro definition
58 void insert(std::string const & name, MacroData const & data);
59 /// Do we have a macro by that name?
60 bool has(std::string const & name) const;
62 MacroData const & get(std::string const & name) const;
67 static MacroTable & globalMacros();
68 /// the local list hack
69 //static MacroTable & localMacros();