]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fracinset.h
c26021774424c82316da3d6a82a97d89428fa44e
[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 WriteNormal(std::ostream &);
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         MathedArray const & GetData() const;
45         ///
46         bool setArgumentIdx(int i); // was bool Up/down(void);
47         ///
48         int getArgumentIdx() const;
49         ///
50         int getMaxArgumentIdx() const;
51         ///
52         void  SetStyle(short);
53         ///
54         MathParInset * denom(); 
55 private:
56         ///
57         int idx_;
58         ///
59         MathParInset den_;
60         ///
61         int w0_;
62         ///
63         int w1_;
64         ///
65         int des0_;
66         ///
67         int dh_;
68 };
69
70 #endif