]> git.lyx.org Git - lyx.git/blob - src/mathed/math_decorationinset.h
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / math_decorationinset.h
1 // -*- C++ -*-
2 /**
3  * \file math_decorationinset.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 "math_nestinset.h"
17
18
19 class latexkeys;
20
21 /// Decorations and accents over (below) a math object
22 class MathDecorationInset : public MathNestInset {
23 public:
24         ///
25         explicit MathDecorationInset(latexkeys const * key);
26         ///
27         void draw(PainterInfo &, int x, int y) const;
28         ///
29         void write(WriteStream & os) const;
30         ///
31         void metrics(MetricsInfo & mi, Dimension & dim) const;
32         ///
33         void normalize(NormalStream & os) const;
34         ///
35         void infoize(std::ostream & os) const;
36         ///
37         bool isScriptable() const;
38         ///
39         void validate(LaTeXFeatures & features) const;
40
41 private:
42         virtual std::auto_ptr<InsetBase> doClone() const;
43         ///
44         bool upper() const;
45         ///
46         bool protect() const;
47         /// is it a wide decoration?
48         bool wide() const;
49         /// does this need AMS
50         bool ams() const;
51
52         ///
53         latexkeys const * key_;
54         /// height cache of deco
55         mutable int dh_;
56         /// vertical offset cache of deco
57         mutable int dy_;
58         /// width for non-wide deco
59         mutable int dw_;
60 };
61 #endif