]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_iterator.h
make \newcommand{\bb}[1]{\mathbf{#1}} work for read/write/display.
[lyx.git] / src / mathed / math_iterator.h
index f56911c4d5c44fe6dd855df22a4102dadee97aed..7b484b030b41be4c37166a333024513a6c3c0510 100644 (file)
@@ -1,3 +1,4 @@
+// -*- C++ -*-
 #ifndef MATH_ITERATOR_H
 #define MATH_ITERATOR_H
 
@@ -8,17 +9,19 @@
 class MathIterator {
 public:
        /// default constructor, used for end of range
-       MathIterator();
-       /// start with given formula
+       //MathIterator();
+       /// start with given inset
        explicit MathIterator(MathInset * p);
        /// start with given position
-       explicit MathIterator(MathCursor::cursor_type const & cursor);
+       //explicit MathIterator(MathCursor::cursor_type const & cursor);
        ///
        MathCursorPos const & operator*() const;
        ///
        MathCursorPos const & operator->() const;
-       ///
+       /// move on one step
        void operator++();
+       /// move on several steps
+       void jump(MathInset::difference_type);
        /// read access to top most item
        MathCursorPos const & position() const;
        /// write access to top most item
@@ -26,10 +29,16 @@ public:
        /// read access to full path
        MathCursor::cursor_type const & cursor() const;
        /// read access to top most inset
-       MathInset * par() const;
-       
-private:
-       /// write access to top most item
+       MathInset const * par() const;
+       /// read access to top most inset
+       MathInset * par();
+       /// helper for iend
+       void goEnd();
+       /// read access to top most item
+       MathArray const & cell() const;
+
+private:       
+       /// read access to top most item
        MathXArray const & xcell() const;
        /// write access to top most item
        MathInset * nextInset() const;
@@ -47,5 +56,9 @@ bool operator==(MathIterator const &, MathIterator const &);
 ///
 bool operator!=(MathIterator const &, MathIterator const &);
 
+///
+MathIterator ibegin(MathInset * p);
+///
+MathIterator iend(MathInset * p);
 
 #endif