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