]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathBox.h
Coding style
[lyx.git] / src / mathed / InsetMathBox.h
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.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef MATH_BOXINSET_H
13 #define MATH_BOXINSET_H
14
15 #include "InsetMathNest.h"
16
17 #include <string>
18
19
20 namespace lyx {
21
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 private:
43         Inset * clone() const { return new InsetMathBox(*this); }
44         ///
45         docstring name_;
46 };
47
48
49 /// Non-AMS-style frame
50 class InsetMathFBox : public InsetMathNest {
51 public:
52         ///
53         InsetMathFBox();
54         ///
55         mode_type currentMode() const { return TEXT_MODE; }
56         ///
57         void metrics(MetricsInfo & mi, Dimension & dim) const;
58         ///
59         void draw(PainterInfo & pi, int x, int y) const;
60         ///
61         void write(WriteStream & os) const;
62         /// write normalized content
63         void normalize(NormalStream & ns) const;
64         ///
65         void infoize(odocstream & os) const;
66 private:
67         ///
68         Inset * clone() const { return new InsetMathFBox(*this); }
69 };
70
71
72 /// Extra nesting: \\makebox or \\framebox.
73 class InsetMathMakebox : public InsetMathNest {
74 public:
75         ///
76         InsetMathMakebox(bool framebox);
77         ///
78         void metrics(MetricsInfo & mi, Dimension & dim) const;
79         ///
80         void draw(PainterInfo & pi, int x, int y) const;
81         ///
82         void write(WriteStream & os) const;
83         /// write normalized content
84         void normalize(NormalStream & ns) const;
85         ///
86         mode_type currentMode() const { return TEXT_MODE; }
87         ///
88         void infoize(odocstream & os) const;
89 private:
90         Inset * clone() const { return new InsetMathMakebox(*this); }
91         ///
92         bool framebox_;
93 };
94
95
96
97 /// AMS-style frame
98 class InsetMathBoxed : public InsetMathNest {
99 public:
100         ///
101         InsetMathBoxed();
102         ///
103         void validate(LaTeXFeatures & features) const;
104         ///
105         void metrics(MetricsInfo & mi, Dimension & dim) const;
106         ///
107         void draw(PainterInfo & pi, int x, int y) const;
108         ///
109         void write(WriteStream & os) const;
110         /// write normalized content
111         void normalize(NormalStream & ns) const;
112         ///
113         void infoize(odocstream & os) const;
114 private:
115         Inset * clone() const { return new InsetMathBoxed(*this); }
116 };
117
118
119 } // namespace lyx
120
121 #endif // MATH_MBOX