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(MathInset * p);
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 MathInset * par() const;
32 /// write access to top most item
33 MathXArray const & xcell() const;
34 /// write access to top most item
35 MathInset * nextInset() const;
37 void push(MathInset *);
42 MathCursor::cursor_type cursor_;
46 bool operator==(MathIterator const &, MathIterator const &);
48 bool operator!=(MathIterator const &, MathIterator const &);