]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSpace.h
Revert "XHTML: remove DOCTYPE, as the document is then understood as HTML4/XHTML1...
[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 { return this; }
35         ///
36         InsetMathSpace * asSpaceInset() { return this; }
37         ///
38         void incSpace();
39         ///
40         void metrics(MetricsInfo & mi, Dimension & dim) const;
41         ///
42         void draw(PainterInfo & pi, int x, int y) const;
43
44         ///
45         void normalize(NormalStream &) const;
46         ///
47         void validate(LaTeXFeatures & features) const;
48         ///
49         void maple(MapleStream &) const;
50         ///
51         void mathematica(MathematicaStream &) const;
52         ///
53         void octave(OctaveStream &) const;
54         ///
55         void mathmlize(MathStream & ms) const;
56         ///
57         void htmlize(HtmlStream & ms) const;
58         ///
59         void write(WriteStream & os) const;
60         /// generate something that will be understood by the Dialogs.
61         InsetSpaceParams params() const;
62         ///
63         bool hasSettings() const { return true; }
64         ///
65         std::string contextMenuName() const;
66         ///
67         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
68         ///
69         InsetCode lyxCode() const { return MATH_SPACE_CODE; }
70
71 protected:
72         ///
73         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
74 private:
75         virtual Inset * clone() const;
76         ///
77         bool isNegative() const;
78         ///
79         int space_;
80         /// amount of space for \\hspace
81         Length length_;
82 };
83
84
85 } // namespace lyx
86 #endif