]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fracinset.h
fix macro, small cleanup
[lyx.git] / src / mathed / math_fracinset.h
1 // -*- C++ -*-
2 #ifndef MATH_FRACINSET_H
3 #define MATH_FRACINSET_H
4
5 #include "math_parinset.h"
6
7 #ifdef __GNUG__
8 #pragma interface
9 #endif
10
11 /** Fraction like objects (frac, stackrel, binom)
12     \author Alejandro Aguilar Sierra
13  */
14 class MathFracInset: public MathParInset {
15 public:
16         ///
17         MathFracInset(short ot = LM_OT_FRAC);
18         ///
19         ~MathFracInset();
20         ///
21         MathedInset * Clone();
22         ///
23         void draw(Painter &, int x, int baseline);
24         ///
25         void Write(std::ostream &, bool fragile);
26         ///
27         void Metrics();
28         
29         /** This does the same that SetData(MathedArray const &) but for both
30             numerator and denominator at once.
31         */
32         void SetData(MathedArray const &, MathedArray const &);
33         ///
34         void setData(MathedArray const &);
35         ///
36         void GetXY(int & x, int & y) const;
37         ///
38         void SetFocus(int, int);
39         ///
40         bool Inside(int, int);
41         ///
42         MathedArray & GetData();
43         ///
44         bool setArgumentIdx(int i); // was bool Up/down(void);
45         ///
46         int getArgumentIdx() const;
47         ///
48         int getMaxArgumentIdx() const;
49         ///
50         void  SetStyle(short);
51 private:
52         ///
53         int idx_;
54         ///
55         MathParInset * den_;
56         ///
57         int w0_;
58         ///
59         int w1_;
60         ///
61         int des0_;
62         ///
63         int dh_;
64 };
65
66
67 inline
68 int MathFracInset::getArgumentIdx() const
69 {
70   return idx_;
71 }
72
73
74 inline
75 int MathFracInset::getMaxArgumentIdx() const
76 {
77   return 1;
78 }
79 #endif