]> git.lyx.org Git - lyx.git/blob - src/mathed/math_rowst.h
small cleanup, doxygen, formatting changes
[lyx.git] / src / mathed / math_rowst.h
1 // -*- C++ -*-
2 #ifndef MATH_ROWST_H
3 #define MATH_ROWST_H
4
5 #include <vector>
6
7 /** The physical structure of a row and aditional information is stored here.
8     It allows to manage the extra info independently of the paragraph data.  
9     Only used for multiline paragraphs.
10  */
11 class MathedRowSt
12 {
13 public:
14         ///
15         typedef std::vector<int> Widths;
16         
17         ///
18         explicit
19         MathedRowSt(int n)
20                 : asc_(0), desc_(0), y_(0), widths_(n + 1, 0),
21                   numbered_(true), next_(0)
22                 {}
23         /// Should be const but...
24         MathedRowSt * getNext() const;
25         /// ...we couldn't use this.
26         void setNext(MathedRowSt * n);
27         ///
28         string const & getLabel() const;
29         ///
30         bool isNumbered() const;
31         ///
32         int  getBaseline() const;
33         ///
34         void setBaseline(int b);
35         ///
36         int ascent() const;
37         ///
38         int descent() const;
39         ///
40         void ascent(int a);
41         ///
42         void descent(int d);
43         ///
44         int  getTab(int i) const;
45         /// 
46         void setLabel(string const & l);
47         ///
48         void setNumbered(bool nf);
49         ///
50         void setTab(int i, int t);
51 private:
52         /// Vericals 
53         int asc_;
54         ///
55         int desc_;
56         ///
57         int y_;
58         /// widths 
59         Widths widths_;
60         /// 
61         string label_;
62         ///
63         bool numbered_;
64         ///
65         MathedRowSt * next_;
66 };
67
68
69 inline
70 MathedRowSt * MathedRowSt::getNext() const
71 {
72         return next_;
73 }
74
75
76 inline
77 void MathedRowSt::setNext(MathedRowSt * n)
78 {
79         next_ = n;
80 }
81
82
83 inline
84 string const & MathedRowSt::getLabel() const
85 {
86         return label_;
87 }
88
89
90 inline
91 bool MathedRowSt::isNumbered() const
92 {
93         return numbered_;
94 }
95
96
97 inline
98 int MathedRowSt::getBaseline() const
99 {
100         return y_;
101 }
102
103
104 inline
105 void MathedRowSt::setBaseline(int b)
106 {
107         y_ = b;
108 }
109
110
111 inline
112 int MathedRowSt::ascent() const
113 {
114         return asc_;
115 }
116
117
118 inline
119 int MathedRowSt::descent() const
120 {
121         return desc_;
122 }
123
124
125 inline
126 void MathedRowSt::ascent(int a)
127 {
128         asc_ = a;
129 }
130
131
132 inline
133 void MathedRowSt::descent(int d)
134 {
135         desc_ = d;
136 }
137
138
139 inline
140 int MathedRowSt::getTab(int i) const
141 {
142         return widths_[i];
143 }
144
145
146 inline
147 void MathedRowSt::setLabel(string const & l)
148 {
149         label_ = l;
150 }
151
152
153 inline
154 void MathedRowSt::setNumbered(bool nf)
155 {
156         numbered_ = nf;
157 }
158
159
160 inline
161 void MathedRowSt::setTab(int i, int t)
162 {
163         widths_[i] = t;
164 }
165 #endif