]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathDecoration.h
Amend 6c3447c8: FindAdv: sometimes a space is added on some math symbols
[lyx.git] / src / mathed / InsetMathDecoration.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathDecoration.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author André Pönitz
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef MATH_DECORATIONINSET_H
14 #define MATH_DECORATIONINSET_H
15
16 #include "InsetMathNest.h"
17
18
19 namespace lyx {
20
21 class latexkeys;
22
23 /// Decorations and accents over (below) a math object
24 class InsetMathDecoration : public InsetMathNest {
25 public:
26         ///
27         explicit InsetMathDecoration(Buffer * buf, latexkeys const * key);
28         ///
29         InsetMathDecoration * asDecorationInset() override { return this; }
30         ///
31         InsetMathDecoration const * asDecorationInset() const override { return this; }
32         ///
33         mode_type currentMode() const override;
34         ///
35         void draw(PainterInfo &, int x, int y) const override;
36         ///
37         void write(TeXMathStream & os) const override;
38         ///
39         void metrics(MetricsInfo & mi, Dimension & dim) const override;
40         ///
41         void normalize(NormalStream & os) const override;
42         ///
43         void infoize(odocstream & os) const override;
44         ///
45         MathClass mathClass() const override;
46         /// The default limits value in \c display style
47         Limits defaultLimits(bool display) const override;
48         /// whether the inset has limit-like sub/superscript
49         Limits limits() const override { return limits_; }
50         /// sets types of sub/superscripts
51         void limits(Limits lim) override { limits_ = lim; }
52         ///
53         void validate(LaTeXFeatures & features) const override;
54         ///
55         InsetCode lyxCode() const override { return MATH_DECORATION_CODE; }
56         ///
57         docstring name() const override;
58         ///
59         void mathmlize(MathMLStream &) const override;
60         ///
61         void htmlize(HtmlStream &) const override;
62 private:
63         Inset * clone() const override;
64         ///
65         bool upper() const;
66         ///
67         bool protect() const;
68         /// is it a wide decoration?
69         bool wide() const;
70
71         ///
72         latexkeys const * key_;
73         ///
74         Limits limits_ = AUTO_LIMITS;
75         // FIXME: this should depend on BufferView
76         /// height cache of deco
77         mutable int dh_ = 0;
78         /// vertical offset cache of deco
79         mutable int dy_ = 0;
80         /// width for non-wide deco
81         mutable int dw_ = 0;
82         /// mode of the containing inset
83         mutable mode_type outer_mode_;
84 };
85
86 } // namespace lyx
87
88 #endif