4 * Purpose: Iterator for Math paragraphs
5 * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
6 * Created: January 1997
7 * Description: Using iterators is the only way to handle math paragraphs
11 * Copyright: 1996, 1997 Alejandro Aguilar Sierra
13 * Version: 0.8beta, Mathed & Lyx project.
15 * You are free to use and modify this code under the terms of
16 * the GNU General Public Licence version 2 or later.
27 #include "mathed/support.h"
28 #include "math_defs.h"
43 /** Specialized array iterator for math paragraph.
44 Used for storing and querying data operations
52 MathedIter(MathedArray *);
54 virtual ~MathedIter() {}
56 bool goNextCode(MathedTextCodes);
64 int IsFirst() const { return (pos == 0); }
68 string const GetString() const;
70 MathedInset * GetInset() const;
72 MathParInset * GetActiveInset() const;
76 bool IsActive() const;
80 bool IsScript() const;
88 void insert(byte, MathedTextCodes c);
90 void insertInset(MathedInset *, int t);
95 /// Check consistency of tabs and newlines
97 /// Try to adjust tabs in the expected place, as in eqnarrays
102 void fcode(short) const;
104 int getPos() const { return pos; }
106 int getRow() const { return row; }
108 int getCol() const { return col; }
110 void setNumCols(int n) { ncols = n; }
112 MathedArray * GetData() const;
113 /// Copy every object from position p1 to p2
123 mutable short fcode_;
151 /// Saves the current state of the iterator
152 virtual void ipush();
153 /// Recover previous state