]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSpace.h
Fix bug #6315: counters in insets that don't produce output have ghost values.
[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 htmlize(HtmlStream & ms) const;
57         ///
58         void write(WriteStream & os) const;
59         /// generate something that will be understood by the Dialogs.
60         InsetSpaceParams params() const;
61         ///
62         bool hasSettings() const { return true; }
63         ///
64         docstring contextMenu(BufferView const &, int, int) const;
65         ///
66         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
67         ///
68         InsetCode lyxCode() const { return MATH_SPACE_CODE; }
69
70 protected:
71         ///
72         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
73 private:
74         virtual Inset * clone() const;
75         ///
76         bool isNegative() const;
77         ///
78         int space_;
79         /// amount of space for \\hspace
80         Length length_;
81 };
82
83
84 } // namespace lyx
85 #endif