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(std::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 std::string label(row_type row) const;
42 void label(row_type row, std::string const & label);
44 void numbered(row_type row, bool num);
46 bool numbered(row_type row) const;
48 bool numberedType() const;
53 /// Appends \c list with all labels found within this inset.
54 void getLabelList(Buffer const &,
55 std::vector<std::string> & list) const;
57 void validate(LaTeXFeatures & features) const;
58 /// identifies MatrixInsets
59 MathHullInset const * asHullInset() const { return this; }
60 /// identifies HullInset
61 MathHullInset * asHullInset() { return this; }
64 void addRow(row_type row);
66 void delRow(row_type row);
68 void swapRow(row_type row);
70 void addCol(col_type col);
72 void delCol(col_type col);
75 std::string const & getType() const;
77 void mutate(std::string const &);
80 int defaultColSpace(col_type col);
82 char defaultColAlign(col_type col);
84 bool idxFirst(LCursor &) const;
86 bool idxLast(LCursor &) const;
89 std::string fileInsetLabel() const;
91 void write(WriteStream & os) const;
93 void mathmlize(MathMLStream &) const;
95 void normalize(NormalStream &) const;
97 void infoize(std::ostream & os) const;
103 priv_dispatch(LCursor & cur, FuncRequest const & cmd);
105 std::string eolString(row_type row, bool fragile) const;
109 void setType(std::string const & type);
111 void validate1(LaTeXFeatures & features);
113 void header_write(WriteStream &) const;
115 void footer_write(WriteStream &) const;
117 std::string nicelabel(row_type row) const;
119 void doExtern(LCursor & cur, FuncRequest const & func);
123 char const * standardFont() const;
124 /// consistency check
126 /// can this change its number of cols?
127 bool colChangeOK() const;
129 /// "none", "simple", "display", "eqnarray",...
132 std::vector<int> nonum_;
134 std::vector<std::string> label_;