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 "math_defs.h"
40 /** Specialized array iterator for math paragraph.
41 Used for storing and querying data operations
51 ncols = row = col = 0;
55 MathedIter(MathedArray *);
57 virtual ~MathedIter() {}
59 bool goNextCode(MathedTextCodes);
69 int IsFirst() const { return (pos == 0); }
73 string const GetString() const;
75 MathedInset * GetInset() const;
77 MathParInset * GetActiveInset() const;
81 bool IsActive() const;
85 bool IsScript() const;
93 virtual void Insert(byte, MathedTextCodes c = LM_TC_CONST);
95 virtual void Insert(MathedInset *, int t = LM_TC_INSET);
97 virtual bool Delete();
100 /// Check consistency of tabs and newlines
102 /// Try to adjust tabs in the expected place, as in eqnarrays
105 short FCode() const { return fcode; }
107 int getPos() const { return pos; }
109 int getRow() const { return row; }
111 int getCol() const { return col; }
113 void setNumCols(int n) { ncols = n; }
115 void SetData(MathedArray * a);
117 MathedArray * GetData() const;
118 /// Copy every object from position p1 to p2
119 MathedArray * Copy(int p1 = 0, int p2 = 10000);
120 /// Delete every object from position p1 to p2
148 /// Saves the current state of the iterator
149 virtual void ipush();
150 /// Recover previous state
157 #define MX_WAS_SUPER 2