]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fracinset.h
Fix bug 2667
[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         ///
47         void write(WriteStream & os) const;
48         ///
49         void maple(MapleStream &) const;
50         ///
51         void mathematica(MathematicaStream &) const;
52         ///
53         void octave(OctaveStream &) const;
54         ///
55         void mathmlize(MathMLStream &) const;
56         ///
57         void validate(LaTeXFeatures & features) const;
58 public:
59         virtual std::auto_ptr<InsetBase> doClone() const;
60         ///
61         Kind kind_;
62 };
63
64 #endif