]> git.lyx.org Git - lyx.git/blob - src/mathed/math_hullinset.h
another case of superfluous braces on read-back
[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(MathInsetTypes t);
23         ///
24         MathHullInset(MathInsetTypes t, MathGridInset const & grid);
25         ///
26         MathHullInset(MathInsetTypes t, col_type cols);
27         ///
28         MathInset * clone() const;
29         ///
30         void metrics(MathMetricsInfo const & st) const;
31         ///
32         void draw(Painter &, int x, int y) const;
33         ///
34         string label(row_type row) const;
35         ///
36         void label(row_type row, string const & label);
37         ///
38         void numbered(row_type row, bool num);
39         ///
40         bool numbered(row_type row) const;
41         ///
42         bool numberedType() const;
43         ///
44         bool display() const;
45         ///
46         bool ams() const;
47         ///
48         std::vector<string> const getLabelList() const;
49         ///
50         void validate(LaTeXFeatures & features) const;
51         /// identifies MatrixInsets
52         MathHullInset const * asHullInset() const { return this; }
53         /// identifies HullInset
54         MathHullInset * asHullInset() { return this; }
55
56         ///
57         void addRow(row_type);
58         ///
59         void delRow(row_type);
60         ///
61         void addCol(col_type);
62         ///
63         void delCol(col_type);
64         ///
65         void appendRow();
66
67         /// change type
68         void mutate(string const &);
69         ///
70         void mutate(MathInsetTypes);
71
72         ///
73         int defaultColSpace(col_type col);
74         ///
75         char defaultColAlign(col_type col);
76
77         ///
78         MathInsetTypes getType() const;
79         ///
80         void write(WriteStream & os) const;
81         ///
82         void mathmlize(MathMLStream &) const;
83         ///
84         void normalize(NormalStream &) const;
85
86 private:
87         ///
88         void setType(MathInsetTypes t);
89         ///
90         void validate1(LaTeXFeatures & features);
91         ///
92         void header_write(WriteStream &) const;
93         ///
94         void footer_write(WriteStream &) const;
95         ///
96         void glueall();
97         ///
98         string nicelabel(row_type row) const;
99         /// consistency check
100         void check() const;
101
102         ///
103         MathInsetTypes objtype_;
104         ///
105         std::vector<int> nonum_;
106         ///
107         std::vector<string> label_;
108         ///
109         mutable MathMetricsInfo mi_;
110 };
111
112 #endif