1 #ifndef MATH_NESTINSET_H
2 #define MATH_NESTINSET_H
8 #include "math_diminset.h"
10 /** Abstract base class for all math objects that conatin nested items.
16 class MathNestInset : public MathDimInset {
19 explicit MathNestInset(int na = 0, string const & nm = string());
22 void metrics(MathStyles st) const;
23 /// draw the object, sets xo_ and yo_ cached values
24 void draw(Painter &, int x, int y) const;
25 /// appends itself with macro arguments substituted
26 void substitute(MathArray & array, MathMacro const & macro) const;
29 bool idxLeft(int & idx, int & pos) const;
31 bool idxRight(int & idx, int & pos) const;
33 /// Move one physical cell up
34 bool idxNext(int & idx, int & pos) const;
35 /// Move one physical cell down
36 bool idxPrev(int & idx, int & pos) const;
38 /// Target pos when we enter the inset from the left by pressing "Right"
39 bool idxFirst(int & idx, int & pos) const;
40 /// Target pos when we enter the inset from the right by pressing "Left"
41 bool idxLast(int & idx, int & pos) const;
43 /// Where should we go if we press home?
44 bool idxHome(int & idx, int & pos) const;
45 /// Where should we go if we press end?
46 bool idxEnd(int & idx, int & pos) const;
52 MathArray & cell(int);
54 MathArray const & cell(int) const;
56 MathXArray & xcell(int);
58 MathXArray const & xcell(int) const;
61 bool isActive() const { return nargs() > 0; }
63 void push_back(MathInset *);
65 void push_back(unsigned char ch, MathTextCodes fcode);
70 void validate(LaTeXFeatures & features) const;
74 typedef std::vector<MathXArray> cells_type;
75 /// The nested contents of the inset are contained here.