]> git.lyx.org Git - lyx.git/blob - src/mathed/math_scriptinset.h
cosmetics
[lyx.git] / src / mathed / math_scriptinset.h
1 // -*- C++ -*-
2 #ifndef MATH_SCRIPTINSET_H
3 #define MATH_SCRIPTINSET_H
4
5 #include "math_inset.h"
6
7 #ifdef __GNUG__
8 #pragma interface
9 #endif
10
11 /** Inset for super- and subscripts
12     \author André Pönitz
13  */
14
15
16 class MathScriptInset : public MathInset {
17 public:
18         ///
19         MathScriptInset();
20         ///
21         MathScriptInset(bool up, bool down, MathInset * = 0);
22         ///
23         MathScriptInset(MathScriptInset const &);
24         ///
25         ~MathScriptInset();
26         ///
27         MathInset * clone() const;
28         ///
29         void write(std::ostream &, bool fragile) const;
30         ///
31         void writeNormal(std::ostream &) const;
32         ///
33         void metrics(MathStyles st);
34         ///
35         void draw(Painter &, int x, int baseline);
36
37         ///
38         bool idxUp(int & idx, int & pos) const;
39         ///
40         bool idxDown(int & idx, int & pos) const;
41         ///
42         bool idxLeft(int & idx, int & pos) const;
43         ///
44         bool idxRight(int & idx, int & pos) const;
45         ///
46         bool idxFirst(int & idx, int & pos) const;
47         ///
48         bool idxFirstUp(int & idx, int & pos) const;
49         ///
50         bool idxFirstDown(int & idx, int & pos) const;
51         ///
52         bool idxLast(int & idx, int & pos) const;
53         ///
54         bool idxLastUp(int & idx, int & pos) const;
55         ///
56         bool idxLastDown(int & idx, int & pos) const;
57         ///
58         void idxDelete(int & idx, bool & popit, bool & deleteit);
59
60         ///
61         bool up() const;
62         ///
63         bool down() const;
64         ///
65         void up(bool);
66         ///
67         void down(bool);
68         ///
69         void limits(int);
70         ///
71         int limits() const;
72         ///
73         bool isActive() const { return false; }
74         /// Identifies ScriptInsets
75         bool isScriptInset() const { return true; }
76         ///
77         int xoffset() const { return dxx_; }
78 private:
79         ///
80         bool hasLimits() const;
81         ///
82         bool up_;
83         ///
84         bool down_;
85         ///
86         string ssym_;
87         /// 1: \limits, -1: \nolimits, 0: use default
88         int limits_;
89         /// x offset for drawing the superscript
90         int dx0_;
91         /// x offset for drawing the subscript
92         int dx1_;
93         /// x offset for drawing the inner symbol
94         int dxx_;
95         ///
96         int dy0_;
97         ///
98         int dy1_;
99         ///
100         MathInset * symbol_;
101 };
102
103 #endif