]> git.lyx.org Git - lyx.git/blob - src/mathed/math_hullinset.h
small up/down tweaking
[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  * Full author contact details are available in file CREDITS
15  */
16
17 class LaTeXFeatures;
18
19 class MathHullInset : public MathGridInset {
20 public:
21         ///
22         MathHullInset();
23         ///
24         explicit MathHullInset(string const & type);
25         ///
26         MathInset * clone() const;
27         ///
28         mode_type currentMode() const;
29         ///
30         void metrics(MathMetricsInfo & mi) const;
31         ///
32         void draw(MathPainterInfo &, int x, int y) const;
33         ///
34         void metricsT(TextMetricsInfo const & mi) const;
35         ///
36         void drawT(TextPainter &, int x, int y) const;
37         ///
38         string label(row_type row) const;
39         ///
40         void label(row_type row, string const & label);
41         ///
42         void numbered(row_type row, bool num);
43         ///
44         bool numbered(row_type row) const;
45         ///
46         bool numberedType() const;
47         ///
48         bool display() const;
49         ///
50         bool ams() const;
51         /// local dispatcher
52         result_type dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
53         ///
54         void getLabelList(std::vector<string> &) const;
55         ///
56         void validate(LaTeXFeatures & features) const;
57         /// identifies MatrixInsets
58         MathHullInset const * asHullInset() const { return this; }
59         /// identifies HullInset
60         MathHullInset * asHullInset() { return this; }
61
62         /// add a row
63         void addRow(row_type row);
64         /// delete a row
65         void delRow(row_type row);
66         /// add a column
67         void addCol(col_type col);
68         /// delete a column
69         void delCol(col_type col);
70
71         /// get type
72         string const & getType() const;
73         /// change type
74         void mutate(string const &);
75
76         ///
77         int defaultColSpace(col_type col);
78         ///
79         char defaultColAlign(col_type col);
80         ///
81         bool idxFirst(idx_type &, pos_type &) const;
82         ///
83         bool idxLast(idx_type &, pos_type &) const;
84
85         ///
86         void write(WriteStream & os) const;
87         ///
88         void mathmlize(MathMLStream &) const;
89         ///
90         void normalize(NormalStream &) const;
91         ///
92         void infoize(std::ostream & os) const;
93
94 protected:
95         ///
96         string eolString(row_type row, bool fragile) const;
97
98 private:
99         ///
100         void setType(string const & type);
101         ///
102         void validate1(LaTeXFeatures & features);
103         ///
104         void header_write(WriteStream &) const;
105         ///
106         void footer_write(WriteStream &) const;
107         ///
108         string nicelabel(row_type row) const;
109         ///
110         void doExtern(FuncRequest const & func, idx_type & idx, pos_type & pos);
111         ///
112         void glueall();
113         ///
114         char const * standardFont() const;
115         /// consistency check
116         void check() const;
117         /// can this change its number of cols?
118         bool colChangeOK() const;
119
120         /// "none", "simple", "display", "eqnarray",...
121         string type_;
122         ///
123         std::vector<int> nonum_;
124         ///
125         std::vector<string> label_;
126 };
127
128 #endif