]> git.lyx.org Git - lyx.git/blob - src/mathed/math_root.h
Applied Angus patch to compile on DEC C++ and to avoid name clashes
[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 #include "math_sqrtinset.h"
19 #include "symbol_def.h"
20
21 #ifdef __GNUG__
22 #pragma interface
23 #endif
24
25 /** The general n-th root inset.
26     \author Alejandro Aguilar Sierra
27     \version January 1999
28  */
29 class MathRootInset : public MathSqrtInset {
30 public:
31         ///
32         explicit
33         MathRootInset(short st = LM_ST_TEXT);
34         ///
35         MathedInset * Clone();
36         ///
37         void draw(Painter &, int x, int baseline);
38         ///
39         void Write(std::ostream &, bool fragile);
40         ///
41         void Metrics();
42         ///
43         bool Inside(int, int);
44         ///
45         void SetFocus(int, int);
46         ///
47         void setData(MathedArray const &);
48         ///
49         void GetXY(int & x, int & y) const;
50         ///
51         MathedArray & GetData();
52         ///
53         MathedArray const & GetData() const;
54         ///
55         bool setArgumentIdx(int i);
56         ///
57         int getArgumentIdx() const;
58         ///
59         int getMaxArgumentIdx() const;
60         ///
61         void SetStyle(short);
62 private:
63         ///
64         int idx_;
65         ///
66         MathParInset uroot_;
67         ///
68         int wroot_;
69         ///
70         int dh_;
71 };
72
73
74 inline
75 int MathRootInset::getArgumentIdx() const
76 {
77         return idx_;
78 }
79
80
81 inline
82 int MathRootInset::getMaxArgumentIdx() const
83 {
84         return 1;
85 }
86
87 #endif