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