]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fracinset.h
Fix bug 2481
[lyx.git] / src / mathed / math_fracinset.h
1 // -*- C++ -*-
2 /**
3  * \file math_fracinset.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_FRACINSET_H
14 #define MATH_FRACINSET_H
15
16 #include "math_fracbase.h"
17
18
19 /// Fraction like objects (frac, binom)
20 class MathFracInset : public MathFracbaseInset {
21 public:
22         ///
23         enum Kind {
24                 FRAC,
25                 ATOP,
26                 NICEFRAC
27         };
28
29         ///
30         explicit MathFracInset(Kind kind = FRAC);
31         ///
32         void metrics(MetricsInfo & mi, Dimension & dim) const;
33         ///
34         void draw(PainterInfo &, int x, int y) const;
35         ///
36         void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
37         ///
38         void drawT(TextPainter &, int x, int y) const;
39         /// identifies FracInsets
40         MathFracInset * asFracInset();
41         /// identifies FracInsets
42         MathFracInset const * asFracInset() const;
43         ///
44         std::string name() const;
45         ///
46         bool extraBraces() const;
47
48         ///
49         void write(WriteStream & os) const;
50         ///
51         void maple(MapleStream &) const;
52         ///
53         void mathematica(MathematicaStream &) const;
54         ///
55         void octave(OctaveStream &) const;
56         ///
57         void mathmlize(MathMLStream &) const;
58         ///
59         void validate(LaTeXFeatures & features) const;
60 public:
61         virtual std::auto_ptr<InsetBase> doClone() const;
62         ///
63         Kind kind_;
64 };
65
66 #endif