]> git.lyx.org Git - lyx.git/blob - src/mathed/math_updowninset.h
fix pullArg when pressing <Delete> at the end of an cell
[lyx.git] / src / mathed / math_updowninset.h
1 // -*- C++ -*-
2 #ifndef MATH_UPDOWNINSET_H
3 #define MATH_UPDOWNINSET_H
4
5 #include "math_inset.h"
6
7 #ifdef __GNUG__
8 #pragma interface
9 #endif
10
11 /** Abstract base class for super- and subscripts and mathop inset
12     \author André Pönitz
13  */
14
15 class MathUpDownInset : public MathInset {
16 public:
17         ///
18         MathUpDownInset();
19         ///
20         MathUpDownInset(bool up, bool down);
21         ///
22         MathInset * clone() const;
23         ///
24         void Write(std::ostream &, bool fragile) const;
25         ///
26         void Metrics(MathStyles st, int asc = 0, int des = 0);
27         ///
28         void draw(Painter &, int x, int baseline);
29         ///
30         bool idxUp(int & idx, int & pos) const;
31         ///
32         bool idxDown(int & idx, int & pos) const;
33         ///
34         bool idxLeft(int & idx, int & pos) const;
35         ///
36         bool idxRight(int & idx, int & pos) const;
37         ///
38         bool idxFirst(int & idx, int & pos) const;
39         ///
40         bool idxFirstUp(int & idx, int & pos) const;
41         ///
42         bool idxFirstDown(int & idx, int & pos) const;
43         ///
44         bool idxLast(int & idx, int & pos) const;
45         ///
46         bool idxLastUp(int & idx, int & pos) const;
47         ///
48         bool idxLastDown(int & idx, int & pos) const;
49         ///
50         bool up() const;
51         ///
52         bool down() const;
53         ///
54         void up(bool);
55         ///
56         void down(bool);
57         ///
58         bool isActive() const { return false; }
59         /// Identifies ScriptInsets
60         bool isUpDownInset() const { return true; }
61         ///
62         void idxDelete(int & idx, bool & popit, bool & deleteit);
63 private:
64         ///
65         bool up_;
66         ///
67         bool down_;
68 protected:
69         ///
70         int dy0_;
71         ///
72         int dy1_;
73 };
74
75 #endif