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);
66 int IsFirst() const { return (pos == 0); }
70 string const GetString() const;
72 MathedInset * GetInset() const;
74 MathParInset * GetActiveInset() const;
78 bool IsActive() const;
82 bool IsScript() const;
90 virtual void Insert(byte, MathedTextCodes c = LM_TC_CONST);
92 virtual void Insert(MathedInset *, int t = LM_TC_INSET);
94 virtual bool Delete();
97 /// Check consistency of tabs and newlines
99 /// Try to adjust tabs in the expected place, as in eqnarrays
102 short FCode() const { return fcode; }
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 void SetData(MathedArray * a);
114 MathedArray * GetData() const;
115 /// Copy every object from position p1 to p2
116 MathedArray * Copy(int p1 = 0, int p2 = 10000);
117 /// Delete every object from position p1 to p2
155 /// Saves the current state of the iterator
156 virtual void ipush();
157 /// Recover previous state
162 //#define MX_WAS_SUB 1
164 //#define MX_WAS_SUPER 2