]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathRoot.h
cb5c34ff2029d6890dc76dfd06721e15d54990d6
[lyx.git] / src / mathed / InsetMathRoot.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathRoot.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_ROOT_H
14 #define MATH_ROOT_H
15
16 #include "InsetMathNest.h"
17
18
19 namespace lyx {
20
21
22 /// The general n-th root inset.
23 class InsetMathRoot : public InsetMathNest {
24 public:
25         ///
26         InsetMathRoot(Buffer * buf);
27         ///
28         bool idxUpDown(Cursor & cur, bool up) const;
29         ///
30         void metrics(MetricsInfo & mi, Dimension & dim) const;
31         ///
32         void draw(PainterInfo & pi, int x, int y) const;
33         ///
34         idx_type firstIdx() const { return 1; }
35         ///
36         idx_type lastIdx() const { return 1; }
37
38         ///
39         void write(WriteStream & os) const;
40         ///
41         void normalize(NormalStream &) const;
42         ///
43         void mathmlize(MathStream &) const;
44         ///
45         void htmlize(HtmlStream &) const;
46         ///
47         void maple(MapleStream &) const;
48         ///
49         void mathematica(MathematicaStream &) const;
50         ///
51         void octave(OctaveStream &) const;
52         ///
53         InsetCode lyxCode() const { return MATH_ROOT_CODE; }
54         ///
55         void validate(LaTeXFeatures &) const;
56
57 private:
58         virtual Inset * clone() const;
59 };
60
61 void mathed_root_metrics(MetricsInfo & mi, MathData const & nucleus,
62                          MathData const * root, Dimension & dim);
63
64 void mathed_draw_root(PainterInfo & pi, int x, int y, MathData const & nucleus,
65                       MathData const * root, Dimension const & dim);
66
67
68 } // namespace lyx
69 #endif