2 #ifndef MATH_ITERATOR_H
3 #define MATH_ITERATOR_H
5 #include "math_cursor.h"
7 // this helper struct is used for traversing math insets
11 /// default constructor, used for end of range
13 /// start with given inset
14 explicit MathIterator(MathInset * p);
15 /// start with given position
16 //explicit MathIterator(MathCursor::cursor_type const & cursor);
18 MathCursorPos const & operator*() const;
20 MathCursorPos const & operator->() const;
23 /// read access to top most item
24 MathCursorPos const & position() const;
25 /// write access to top most item
26 MathCursorPos & position();
27 /// read access to full path
28 MathCursor::cursor_type const & cursor() const;
29 /// read access to top most inset
30 MathInset const * par() const;
31 /// read access to top most inset
37 /// write access to top most item
38 MathXArray const & xcell() const;
39 /// write access to top most item
40 MathInset * nextInset() const;
42 void push(MathInset *);
47 MathCursor::cursor_type cursor_;
51 bool operator==(MathIterator const &, MathIterator const &);
53 bool operator!=(MathIterator const &, MathIterator const &);
56 MathIterator ibegin(MathInset * p);
58 MathIterator iend(MathInset * p);