3 * \file math_hullinset.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_HULLINSET_H
13 #define MATH_HULLINSET_H
15 #include "math_gridinset.h"
20 /// This provides an interface between "LyX insets" and "LyX math insets"
21 class MathHullInset : public MathGridInset {
26 explicit MathHullInset(string const & type);
28 virtual std::auto_ptr<InsetBase> clone() const;
30 mode_type currentMode() const;
32 void metrics(MetricsInfo & mi, Dimension & dim) const;
34 void draw(PainterInfo &, int x, int y) const;
36 void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
38 void drawT(TextPainter &, int x, int y) const;
40 string label(row_type row) const;
42 void label(row_type row, string const & label);
44 void numbered(row_type row, bool num);
46 bool numbered(row_type row) const;
48 bool numberedType() const;
54 dispatch_result dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
55 /// Appends \c list with all labels found within this inset.
56 void getLabelList(Buffer const &,
57 std::vector<string> & list) const;
59 void validate(LaTeXFeatures & features) const;
60 /// identifies MatrixInsets
61 MathHullInset const * asHullInset() const { return this; }
62 /// identifies HullInset
63 MathHullInset * asHullInset() { return this; }
66 void addRow(row_type row);
68 void delRow(row_type row);
70 void swapRow(row_type row);
72 void addCol(col_type col);
74 void delCol(col_type col);
77 string const & getType() const;
79 void mutate(string const &);
82 int defaultColSpace(col_type col);
84 char defaultColAlign(col_type col);
86 bool idxFirst(idx_type &, pos_type &) const;
88 bool idxLast(idx_type &, pos_type &) const;
91 string fileInsetLabel() const;
93 void write(WriteStream & os) const;
95 void mathmlize(MathMLStream &) const;
97 void normalize(NormalStream &) const;
99 void infoize(std::ostream & os) const;
103 string eolString(row_type row, bool fragile) const;
107 void setType(string const & type);
109 void validate1(LaTeXFeatures & features);
111 void header_write(WriteStream &) const;
113 void footer_write(WriteStream &) const;
115 string nicelabel(row_type row) const;
117 void doExtern(FuncRequest const & func, idx_type & idx, pos_type & pos);
121 char const * standardFont() const;
122 /// consistency check
124 /// can this change its number of cols?
125 bool colChangeOK() const;
127 /// "none", "simple", "display", "eqnarray",...
130 std::vector<int> nonum_;
132 std::vector<string> label_;