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