]> git.lyx.org Git - lyx.git/blob - src/mathed/math_hullinset.h
Pass Buffer arg to Inset::getLabelList, Inset::fillWithBibKeys.
[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         /// Appends \c list with all labels found within this inset.
56         void getLabelList(Buffer const &,
57                           std::vector<string> & list) const;
58         ///
59         void validate(LaTeXFeatures & features) const;
60         /// identifies MatrixInsets
61         MathHullInset const * asHullInset() const { return this; }
62         /// identifies HullInset
63         MathHullInset * asHullInset() { return this; }
64
65         /// add a row
66         void addRow(row_type row);
67         /// delete a row
68         void delRow(row_type row);
69         /// add a column
70         void addCol(col_type col);
71         /// delete a column
72         void delCol(col_type col);
73
74         /// get type
75         string const & getType() const;
76         /// change type
77         void mutate(string const &);
78
79         ///
80         int defaultColSpace(col_type col);
81         ///
82         char defaultColAlign(col_type col);
83         ///
84         bool idxFirst(idx_type &, pos_type &) const;
85         ///
86         bool idxLast(idx_type &, pos_type &) const;
87
88         ///
89         string fileInsetLabel() const;
90         ///
91         void write(WriteStream & os) const;
92         ///
93         void mathmlize(MathMLStream &) const;
94         ///
95         void normalize(NormalStream &) const;
96         ///
97         void infoize(std::ostream & os) const;
98
99 protected:
100         ///
101         string eolString(row_type row, bool fragile) const;
102
103 private:
104         ///
105         void setType(string const & type);
106         ///
107         void validate1(LaTeXFeatures & features);
108         ///
109         void header_write(WriteStream &) const;
110         ///
111         void footer_write(WriteStream &) const;
112         ///
113         string nicelabel(row_type row) const;
114         ///
115         void doExtern(FuncRequest const & func, idx_type & idx, pos_type & pos);
116         ///
117         void glueall();
118         ///
119         char const * standardFont() const;
120         /// consistency check
121         void check() const;
122         /// can this change its number of cols?
123         bool colChangeOK() const;
124
125         /// "none", "simple", "display", "eqnarray",...
126         string type_;
127         ///
128         std::vector<int> nonum_;
129         ///
130         std::vector<string> label_;
131 };
132
133 #endif