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