]> git.lyx.org Git - features.git/blob - src/mathed/math_rowst.h
first go at mathed file cleanup
[features.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 struct MathedRowSt
12 {
13         ///
14         typedef std::vector<int> Widths;
15         
16         ///
17         explicit
18         MathedRowSt(int n)
19                 : asc_(0), desc_(0), y_(0), widths_(n + 1, 0),
20                   numbered_(true), next_(0)
21                 {}
22         /// Should be const but...
23         MathedRowSt * getNext() const  { return next_; }
24         /// ...we couldn't use this.
25         void setNext(MathedRowSt * n) { next_ = n; }
26         ///
27         string const & getLabel() const { return label_; }
28         ///
29         bool isNumbered() const { return numbered_; }
30         ///
31         int  getBaseline() const { return y_; }
32         ///
33         void setBaseline(int b) { y_ = b; }
34         ///
35         int ascent() const { return asc_; }
36         ///
37         int descent() const { return desc_; }
38         ///
39         void ascent(int a) { asc_ = a; }
40         ///
41         void descent(int d) { desc_ = d; }
42         ///
43         int  getTab(int i) const { return widths_[i]; }
44         /// 
45         void setLabel(string const & l) { label_ = l; }
46         ///
47         void setNumbered(bool nf) { numbered_ = nf; }
48         ///
49         void setTab(int i, int t) { widths_[i] = t; }
50 private:
51         /// Vericals 
52         int asc_;
53         int desc_;
54         int y_;
55         /// widths 
56         Widths widths_;
57         /// 
58         string label_;
59         ///
60         bool numbered_;
61         ///
62         MathedRowSt * next_;
63 };
64 #endif