4 * Purpose: Declaration of macro class for mathed
5 * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
6 * Created: November 1996
7 * Description: WYSIWYG math macros
11 * Copyright: 1996, 1997 Alejandro Aguilar Sierra
13 * Version: 0.2, Math & Lyx project.
15 * This code is under the GNU General Public Licence version 2 or later.
27 #include "math_nestinset.h"
28 #include "math_macroarg.h"
31 class MathMacroTemplate;
34 /** This class contains the data for a macro
35 \author Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
36 \version November 1996
38 class MathMacro : public MathNestInset {
40 /// A macro can be built from an existing template
41 explicit MathMacro(string const &);
43 MathMacro(MathMacro const &);
45 void draw(Painter &, int x, int y) const;
47 void metrics(MathStyles st) const;
49 MathInset * clone() const;
51 void write(std::ostream &, bool fragile) const;
53 void writeNormal(std::ostream &) const;
58 bool idxUp(idx_type &, pos_type &) const;
60 bool idxDown(idx_type &, pos_type &) const;
62 bool idxLeft(idx_type &, pos_type &) const;
64 bool idxRight(idx_type &, pos_type &) const;
67 void validate(LaTeXFeatures &) const;
69 bool isMacro() const { return true; }
73 void operator=(MathMacro const &);
75 char const * name() const;
79 bool defining() const;
84 mutable MathXArray expanded_;