#include <vector>
#include <iosfwd>
-#include "math_inset.h"
+#include "math_nestinset.h"
#include "math_macroarg.h"
+#include "LString.h"
class MathMacroTemplate;
\author Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
\version November 1996
*/
-class MathMacro : public MathInset {
+class MathMacro : public MathNestInset {
public:
/// A macro can be built from an existing template
- explicit MathMacro(MathMacroTemplate const &);
+ explicit MathMacro(string const &);
///
MathMacro(MathMacro const &);
///
- void draw(Painter &, int, int);
+ void draw(Painter &, int x, int y) const;
///
- void metrics(MathStyles st);
+ void metrics(MathMetricsInfo const & st) const;
///
MathInset * clone() const;
///
- void write(std::ostream &, bool fragile) const;
- ///
- void writeNormal(std::ostream &) const;
- ///
- void dump(std::ostream & os) const;
+ void dump() const;
///
- bool idxUp(int &, int &) const;
+ bool idxUp(idx_type &) const;
///
- bool idxDown(int &, int &) const;
+ bool idxDown(idx_type &) const;
///
- bool idxLeft(int &, int &) const;
+ bool idxLeft(idx_type &, pos_type &) const;
///
- bool idxRight(int &, int &) const;
+ bool idxRight(idx_type &, pos_type &) const;
///
void validate(LaTeXFeatures &) const;
+ ///
+ bool isMacro() const { return true; }
+ ///
+ bool match(MathInset *) const { return false; }
-private:
///
- MathMacroTemplate const * const tmplate_;
+ void normalize(NormalStream &) const;
///
- MathXArray expanded_;
+ void maplize(MapleStream &) const;
+ ///
+ void mathmlize(MathMLStream &) const;
+ ///
+ void octavize(OctaveStream &) const;
+ ///
+ void write(WriteStream & os) const;
+
+private:
///
void operator=(MathMacro const &);
+ ///
+ char const * name() const;
+ ///
+ bool editing() const;
+ ///
+ bool defining() const;
+ ///
+ void updateExpansion() const;
+
+ ///
+ MathAtom & tmplate_;
+ ///
+ mutable MathXArray expanded_;
+ ///
+ mutable MathMetricsInfo mi_;
};
-inline std::ostream & operator<<(std::ostream & os, MathMacro const & m)
-{
- m.dump(os);
- return os;
-}
#endif