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.
16 typedef std::vector<int> Widths;
20 MathedRowStruct(int n)
21 : asc_(0), desc_(0), y_(0), widths_(n + 1, 0),
25 string const & getLabel() const;
27 bool isNumbered() const;
29 int getBaseline() const;
31 void setBaseline(int b);
41 int getTab(int i) const;
43 void setLabel(string const & l);
45 void setNumbered(bool nf);
47 void setTab(int i, int t);
49 friend class MathedRowSt;
65 class MathedRowSt : public MathedRowStruct {
68 explicit MathedRowSt(int n)
69 : MathedRowStruct(n), next_(0)
71 /// Should be const but...
72 MathedRowSt * getNext() const;
73 /// ...we couldn't use this.
74 void setNext(MathedRowSt * n);
81 // The idea is to change this MathedRowContainer to mimic the behaviour
82 // of std::list<MathedRowStruct> in several small steps. In the end it
83 // could be replaced by such a list and MathedRowSt can go as well.
85 struct MathedRowContainer {
89 iterator(MathedRowContainer * m) : st_(m->data_) {}
90 /// "better" conversion to bool
91 operator void *() const { return st_; }
93 MathedRowStruct & operator*() { return *st_; }
95 MathedRowStruct * operator->() { return st_; }
97 void operator++() { st_ = st_->next_; }
99 bool is_last() const { return st_->next_ == 0; }
101 bool operator==(const iterator & it) const { return st_ == it.st_; }
109 MathedRowContainer() : data_(0) {}
111 MathedRowContainer(MathedRowSt * data) : data_(data) {}
114 iterator begin() { return iterator(this); }
116 bool empty() const { return data_ == 0; }
125 MathedRowSt * MathedRowSt::getNext() const
132 void MathedRowSt::setNext(MathedRowSt * n)
139 string const & MathedRowStruct::getLabel() const
146 bool MathedRowStruct::isNumbered() const
153 int MathedRowStruct::getBaseline() const
160 void MathedRowStruct::setBaseline(int b)
167 int MathedRowStruct::ascent() const
174 int MathedRowStruct::descent() const
181 void MathedRowStruct::ascent(int a)
188 void MathedRowStruct::descent(int d)
195 int MathedRowStruct::getTab(int i) const
202 void MathedRowStruct::setLabel(string const & l)
209 void MathedRowStruct::setNumbered(bool nf)
216 void MathedRowStruct::setTab(int i, int t)