]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathFrac.h
Whitespace changes only
[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 namespace lyx {
20
21
22 /// Fraction like objects (frac, binom)
23 class InsetMathFrac : public InsetMathFracBase {
24 public:
25         ///
26         enum Kind {
27                 FRAC,
28                 OVER,
29                 ATOP,
30                 NICEFRAC,
31                 UNITFRAC,
32                 UNIT,
33                 UNITFRAC3
34         };
35
36         ///
37         explicit InsetMathFrac(Kind kind = FRAC, idx_type ncells = 2);
38         ///
39         bool idxRight(Cursor &) const;
40         ///
41         bool idxLeft(Cursor &) const;
42         ///
43         bool metrics(MetricsInfo & mi, Dimension & dim) const;
44         ///
45         void draw(PainterInfo &, int x, int y) const;
46         ///
47         void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
48         ///
49         void drawT(TextPainter &, int x, int y) const;
50         /// identifies FracInsets
51         InsetMathFrac * asFracInset();
52         /// identifies FracInsets
53         InsetMathFrac const * asFracInset() const;
54         ///
55         docstring name() const;
56         ///
57         bool extraBraces() const;
58
59         ///
60         void write(WriteStream & os) const;
61         ///
62         void maple(MapleStream &) const;
63         ///
64         void mathematica(MathematicaStream &) const;
65         ///
66         void octave(OctaveStream &) const;
67         ///
68         void mathmlize(MathStream &) const;
69         ///
70         void validate(LaTeXFeatures & features) const;
71 public:
72         virtual Inset * clone() const;
73         ///
74         Kind kind_;
75 };
76
77
78
79 } // namespace lyx
80 #endif