]> git.lyx.org Git - lyx.git/blob - src/mathed/math_root.h
mathed34.diff
[lyx.git] / src / mathed / math_root.h
1 // -*- C++ -*-
2 /*
3  *  File:        math_root.h
4  *  Purpose:     Declaration of the root object 
5  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
6  *  Created:     January 1999
7  *  Description: Root math object
8  *
9  *  Copyright: 1999 Alejandro Aguilar Sierra
10  *
11  *   You are free to use and modify this code under the terms of
12  *   the GNU General Public Licence version 2 or later.
13  */
14
15 #ifndef MATH_ROOT
16 #define MATH_ROOT
17
18 #ifdef __GNUG__
19 #pragma interface
20 #endif
21
22 #include "math_sqrtinset.h"
23 #include "symbol_def.h"
24
25
26 /** The general n-th root inset.
27     \author Alejandro Aguilar Sierra
28     \version January 1999
29  */
30 class MathRootInset : public MathSqrtInset {
31 public:
32         ///
33         explicit
34         MathRootInset(short st = LM_ST_TEXT);
35         ///
36         ~MathRootInset();
37         ///
38         MathedInset * Clone();
39         ///
40         void draw(Painter &, int x, int baseline);
41         ///
42         void Write(std::ostream &, bool fragile);
43         ///
44         void Metrics();
45         ///
46         bool Inside(int, int);
47         ///
48         void SetFocus(int, int);
49         ///
50         void setData(MathedArray const &);
51         ///
52         void GetXY(int & x, int & y) const;
53         ///
54         MathedArray & GetData();
55         ///
56         bool setArgumentIdx(int i);
57         ///
58         int getArgumentIdx() const;
59         ///
60         int getMaxArgumentIdx() const;
61         ///
62         void SetStyle(short);
63 private:
64         ///
65         int idx_;
66         ///
67         MathParInset * uroot_;
68         ///
69         int wroot_;
70         ///
71         int dh_;
72 };
73
74
75 inline
76 int MathRootInset::getArgumentIdx() const
77 {
78         return idx_;
79 }
80
81
82 inline
83 int MathRootInset::getMaxArgumentIdx() const
84 {
85         return 1;
86 }
87
88 #endif