]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSpace.h
381562178ce34703bb51da1b44f94a1ea641b74b
[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 #include "Length.h"
17
18
19 namespace lyx {
20
21 struct InsetSpaceParams;
22
23 /// Smart spaces
24 class InsetMathSpace : public InsetMath {
25 public:
26         ///
27         explicit InsetMathSpace();
28         ///
29         explicit InsetMathSpace(std::string const & name, std::string const & length);
30         ///
31         explicit InsetMathSpace(Length const & length);
32         ///
33         InsetMathSpace const * asSpaceInset() const { return this; }
34         ///
35         InsetMathSpace * asSpaceInset() { return this; }
36         ///
37         void incSpace();
38         ///
39         void metrics(MetricsInfo & mi, Dimension & dim) const;
40         ///
41         void draw(PainterInfo & pi, int x, int y) const;
42
43         ///
44         void normalize(NormalStream &) const;
45         ///
46         void validate(LaTeXFeatures & features) const;
47         ///
48         void maple(MapleStream &) const;
49         ///
50         void mathematica(MathematicaStream &) const;
51         ///
52         void octave(OctaveStream &) const;
53         ///
54         void mathmlize(MathStream & ms) const;
55         ///
56         void write(WriteStream & os) const;
57         /// generate something that will be understood by the Dialogs.
58         InsetSpaceParams params() const;
59         ///
60         bool hasSettings() const { return true; }
61         ///
62         docstring contextMenu(BufferView const &, int, int) const;
63         ///
64         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
65         ///
66         InsetCode lyxCode() const { return MATH_SPACE_CODE; }
67
68 protected:
69         ///
70         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
71 private:
72         virtual Inset * clone() const;
73         ///
74         bool isNegative() const;
75         ///
76         int space_;
77         /// amount of space for \\hspace
78         Length length_;
79 };
80
81
82 } // namespace lyx
83 #endif