Give inset codes to all the math insets, so we get more information when
[lyx.git] / src / mathed / InsetMathBox.h
blob5839439ed7e3a07bab54b39e16a372fda0a5ab99
1 // -*- C++ -*-
2 /**
3 * \file InsetMathBox.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author André Pönitz
9 * Full author contact details are available in file CREDITS.
12 #ifndef MATH_BOXINSET_H
13 #define MATH_BOXINSET_H
15 #include "InsetMathNest.h"
17 #include <string>
20 namespace lyx {
22 /// Support for \\mbox
23 class InsetMathBox : public InsetMathNest {
24 public:
25 ///
26 explicit InsetMathBox(docstring const & name);
27 ///
28 mode_type currentMode() const { return TEXT_MODE; }
29 ///
30 void metrics(MetricsInfo & mi, Dimension & dim) const;
31 ///
32 void draw(PainterInfo & pi, int x, int y) const;
33 ///
34 void write(WriteStream & os) const;
35 ///
36 void normalize(NormalStream & ns) const;
37 ///
38 void infoize(odocstream & os) const;
39 ///
40 void validate(LaTeXFeatures & features) const;
41 ///
42 InsetCode lyxCode() const { return MATH_BOX_CODE; }
44 private:
45 Inset * clone() const { return new InsetMathBox(*this); }
46 ///
47 docstring name_;
51 /// Non-AMS-style frame
52 class InsetMathFBox : public InsetMathNest {
53 public:
54 ///
55 InsetMathFBox();
56 ///
57 mode_type currentMode() const { return TEXT_MODE; }
58 ///
59 void metrics(MetricsInfo & mi, Dimension & dim) const;
60 ///
61 void draw(PainterInfo & pi, int x, int y) const;
62 ///
63 void write(WriteStream & os) const;
64 /// write normalized content
65 void normalize(NormalStream & ns) const;
66 ///
67 void infoize(odocstream & os) const;
68 private:
69 ///
70 Inset * clone() const { return new InsetMathFBox(*this); }
74 /// Extra nesting: \\makebox or \\framebox.
75 class InsetMathMakebox : public InsetMathNest {
76 public:
77 ///
78 InsetMathMakebox(bool framebox);
79 ///
80 void metrics(MetricsInfo & mi, Dimension & dim) const;
81 ///
82 void draw(PainterInfo & pi, int x, int y) const;
83 ///
84 void write(WriteStream & os) const;
85 /// write normalized content
86 void normalize(NormalStream & ns) const;
87 ///
88 mode_type currentMode() const { return TEXT_MODE; }
89 ///
90 void infoize(odocstream & os) const;
91 private:
92 Inset * clone() const { return new InsetMathMakebox(*this); }
93 ///
94 bool framebox_;
99 /// AMS-style frame
100 class InsetMathBoxed : public InsetMathNest {
101 public:
103 InsetMathBoxed();
105 void validate(LaTeXFeatures & features) const;
107 void metrics(MetricsInfo & mi, Dimension & dim) const;
109 void draw(PainterInfo & pi, int x, int y) const;
111 void write(WriteStream & os) const;
112 /// write normalized content
113 void normalize(NormalStream & ns) const;
115 void infoize(odocstream & os) const;
116 private:
117 Inset * clone() const { return new InsetMathBoxed(*this); }
121 } // namespace lyx
123 #endif // MATH_MBOX