]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fracinset.h
83011783f25cff0c137612e57b20ca075c9d33fa
[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         MathedInset * Clone();
20         ///
21         void draw(Painter &, int x, int baseline);
22         ///
23         void Write(std::ostream &, bool fragile);
24         ///
25         void Metrics();
26         
27         /** This does the same that SetData(MathedArray const &) but for both
28             numerator and denominator at once.
29         */
30         void SetData(MathedArray const &, MathedArray const &);
31         ///
32         void setData(MathedArray const &);
33         ///
34         void GetXY(int & x, int & y) const;
35         ///
36         void SetFocus(int, int);
37         ///
38         bool Inside(int, int);
39         ///
40         MathedArray & GetData();
41         ///
42         bool setArgumentIdx(int i); // was bool Up/down(void);
43         ///
44         int getArgumentIdx() const;
45         ///
46         int getMaxArgumentIdx() const;
47         ///
48         void  SetStyle(short);
49 private:
50         ///
51         int idx_;
52         ///
53         MathParInset den_;
54         ///
55         int w0_;
56         ///
57         int w1_;
58         ///
59         int des0_;
60         ///
61         int dh_;
62 };
63
64
65 inline
66 int MathFracInset::getArgumentIdx() const
67 {
68   return idx_;
69 }
70
71
72 inline
73 int MathFracInset::getMaxArgumentIdx() const
74 {
75   return 1;
76 }
77 #endif