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