2 #ifndef MATH_HULLINSET_H
3 #define MATH_HULLINSET_H
5 #include "math_gridinset.h"
11 /** This provides an interface between "LyX insets" and "LyX math insets"
12 * \author André Pönitz
17 class MathHullInset : public MathGridInset {
22 explicit MathHullInset(MathInsetTypes t);
24 MathHullInset(MathInsetTypes t, MathGridInset const & grid);
26 MathHullInset(MathInsetTypes t, col_type cols);
28 MathInset * clone() const;
30 void metrics(MathMetricsInfo & st) const;
32 void draw(MathPainterInfo &, int x, int y) const;
34 void metricsT(TextMetricsInfo const & st) const;
36 void drawT(TextPainter &, int x, int y) const;
38 string label(row_type row) const;
40 void label(row_type row, string const & label);
42 void numbered(row_type row, bool num);
44 bool numbered(row_type row) const;
46 bool numberedType() const;
52 std::vector<string> const getLabelList() const;
54 void validate(LaTeXFeatures & features) const;
55 /// identifies MatrixInsets
56 MathHullInset const * asHullInset() const { return this; }
57 /// identifies HullInset
58 MathHullInset * asHullInset() { return this; }
61 void addRow(row_type);
63 void delRow(row_type);
65 void addFancyCol(col_type);
67 void delFancyCol(col_type);
70 void mutate(string const &);
72 void mutate(MathInsetTypes);
75 int defaultColSpace(col_type col);
77 char defaultColAlign(col_type col);
79 bool idxFirst(idx_type &, pos_type &) const;
81 bool idxLast(idx_type &, pos_type &) const;
84 MathInsetTypes getType() const;
86 void write(WriteStream & os) const;
88 void mathmlize(MathMLStream &) const;
90 void normalize(NormalStream &) const;
92 void infoize(std::ostream & os) const;
96 void setType(MathInsetTypes t);
98 void validate1(LaTeXFeatures & features);
100 void header_write(WriteStream &) const;
102 void footer_write(WriteStream &) const;
106 string nicelabel(row_type row) const;
107 /// consistency check
111 MathInsetTypes objtype_;
113 std::vector<int> nonum_;
115 std::vector<string> label_;