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 virtual void Insert(byte, MathedTextCodes c = LM_TC_CONST);
90 virtual void Insert(MathedInset *, int t = LM_TC_INSET);
92 virtual bool Delete();
95 /// Check consistency of tabs and newlines
97 /// Try to adjust tabs in the expected place, as in eqnarrays
100 short FCode() const { return fcode; }
102 int getPos() const { return pos; }
104 int getRow() const { return row; }
106 int getCol() const { return col; }
108 void setNumCols(int n) { ncols = n; }
110 void SetData(MathedArray * a);
112 MathedArray * GetData() const;
113 /// Copy every object from position p1 to p2
114 MathedArray * Copy(int p1 = 0, int p2 = 10000);
115 /// Delete every object from position p1 to p2
153 /// Saves the current state of the iterator
154 virtual void ipush();
155 /// Recover previous state
160 //#define MX_WAS_SUB 1
162 //#define MX_WAS_SUPER 2