]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSpace.h
g-brief loads babel internally. So don't load it ourselves.
[lyx.git] / src / mathed / InsetMathSpace.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathSpace.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_SPACEINSET_H
13 #define MATH_SPACEINSET_H
14
15 #include "InsetMath.h"
16
17 #include "support/Length.h"
18
19
20 namespace lyx {
21
22 struct InsetSpaceParams;
23
24 /// Smart spaces
25 class InsetMathSpace : public InsetMath {
26 public:
27         ///
28         explicit InsetMathSpace();
29         ///
30         explicit InsetMathSpace(std::string const & name, std::string const & length);
31         ///
32         explicit InsetMathSpace(Length const & length, bool const prot = false);
33         ///
34         InsetMathSpace const * asSpaceInset() const override { return this; }
35         ///
36         InsetMathSpace * asSpaceInset() override { return this; }
37         ///
38         void incSpace();
39         ///
40         void metrics(MetricsInfo & mi, Dimension & dim) const override;
41         ///
42         void draw(PainterInfo & pi, int x, int y) const override;
43
44         ///
45         void normalize(NormalStream &) const override;
46         ///
47         void validate(LaTeXFeatures & features) const override;
48         ///
49         void maple(MapleStream &) const override;
50         ///
51         void mathematica(MathematicaStream &) const override;
52         ///
53         void octave(OctaveStream &) const override;
54         ///
55         void mathmlize(MathMLStream & ms) const override;
56         ///
57         void htmlize(HtmlStream & ms) const override;
58         ///
59         void write(TeXMathStream & os) const override;
60         /// generate something that will be understood by the Dialogs.
61         InsetSpaceParams params() const;
62         ///
63         bool hasSettings() const override { return true; }
64         ///
65         bool clickable(BufferView const &, int, int) const override { return true; }
66         ///
67         std::string contextMenuName() const override;
68         ///
69         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
70         ///
71         InsetCode lyxCode() const override { return MATH_SPACE_CODE; }
72
73 protected:
74         ///
75         void doDispatch(Cursor & cur, FuncRequest & cmd) override;
76 private:
77         Inset * clone() const override;
78         ///
79         bool isNegative() const;
80         ///
81         int space_;
82         /// amount of space for \\hspace
83         Length length_;
84 };
85
86
87 } // namespace lyx
88 #endif