]> git.lyx.org Git - lyx.git/blob - src/mathed/math_hullinset.h
enable insertion of spaces in all \textxxx modes.
[lyx.git] / src / mathed / math_hullinset.h
1 // -*- C++ -*-
2 #ifndef MATH_HULLINSET_H
3 #define MATH_HULLINSET_H
4
5 #include "math_gridinset.h"
6
7 #ifdef __GNUG__
8 #pragma interface
9 #endif
10
11 /** This provides an interface between "LyX insets" and "LyX math insets"
12  *  \author André Pönitz
13  */
14
15 class LaTeXFeatures;
16
17 class MathHullInset : public MathGridInset {
18 public:
19         ///
20         MathHullInset();
21         ///
22         explicit MathHullInset(string const & type);
23         ///
24         MathInset * clone() const;
25         ///
26         mode_type currentMode() const;
27         ///
28         void metrics(MathMetricsInfo & mi) const;
29         ///
30         void draw(MathPainterInfo &, int x, int y) const;
31         ///
32         void metricsT(TextMetricsInfo const & mi) const;
33         ///
34         void drawT(TextPainter &, int x, int y) const;
35         ///
36         string label(row_type row) const;
37         ///
38         void label(row_type row, string const & label);
39         ///
40         void numbered(row_type row, bool num);
41         ///
42         bool numbered(row_type row) const;
43         ///
44         bool numberedType() const;
45         ///
46         bool display() const;
47         ///
48         bool ams() const;
49         ///
50         std::vector<string> getLabelList() const;
51         ///
52         void validate(LaTeXFeatures & features) const;
53         /// identifies MatrixInsets
54         MathHullInset const * asHullInset() const { return this; }
55         /// identifies HullInset
56         MathHullInset * asHullInset() { return this; }
57
58         ///
59         void addRow(row_type);
60         ///
61         void delRow(row_type);
62         ///
63         void addFancyCol(col_type);
64         ///
65         void delFancyCol(col_type);
66
67         /// get type
68         string const & getType() const;
69         /// change type
70         void mutate(string const &);
71
72         ///
73         int defaultColSpace(col_type col);
74         ///
75         char defaultColAlign(col_type col);
76         ///
77         bool idxFirst(idx_type &, pos_type &) const;
78         ///
79         bool idxLast(idx_type &, pos_type &) const;
80
81         ///
82         void write(WriteStream & os) const;
83         ///
84         void mathmlize(MathMLStream &) const;
85         ///
86         void normalize(NormalStream &) const;
87         ///
88         void infoize(std::ostream & os) const;
89
90 private:
91         ///
92         void setType(string const & type);
93         ///
94         void validate1(LaTeXFeatures & features);
95         ///
96         void header_write(WriteStream &) const;
97         ///
98         void footer_write(WriteStream &) const;
99         ///
100         string nicelabel(row_type row) const;
101         ///
102         void glueall();
103         ///
104         char const * standardFont() const;
105         /// consistency check
106         void check() const;
107
108         /// "none", "simple", "display", "eqnarray",...
109         string type_;
110         ///
111         std::vector<int> nonum_;
112         ///
113         std::vector<string> label_;
114 };
115
116 #endif