1 #ifndef MATH_ITERATOR_H
2 #define MATH_ITERATOR_H
4 #include "math_cursor.h"
6 // this helper struct is used for traversing math insets
10 /// default constructor, used for end of range
12 /// start with given formula
13 explicit MathIterator(MathAtom & t);
14 /// start with given position
15 explicit MathIterator(MathCursor::cursor_type const & cursor);
17 MathCursorPos const & operator*() const;
19 MathCursorPos const & operator->() const;
22 /// read access to top most item
23 MathCursorPos const & position() const;
24 /// write access to top most item
25 MathCursorPos & position();
26 /// read access to full path
27 MathCursor::cursor_type const & cursor() const;
28 /// read access to top most inset
29 MathAtom const & par() const;
30 /// read access to top most inset
36 /// write access to top most item
37 MathXArray const & xcell() const;
38 /// write access to top most item
39 MathAtom * nextInset() const;
41 void push(MathAtom &);
46 MathCursor::cursor_type cursor_;
50 bool operator==(MathIterator const &, MathIterator const &);
52 bool operator!=(MathIterator const &, MathIterator const &);
55 MathIterator ibegin(MathAtom & p);
57 MathIterator iend(MathAtom & p);