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
49 MathedIter(MathedArray *);
51 virtual ~MathedIter() {}
53 bool goNextCode(MathedTextCodes);
63 int IsFirst() const { return (pos == 0); }
67 string const GetString() const;
69 MathedInset * GetInset() const;
71 MathParInset * GetActiveInset() const;
75 bool IsActive() const;
79 bool IsScript() const;
87 virtual void Insert(byte, MathedTextCodes c = LM_TC_CONST);
89 virtual void Insert(MathedInset *, int t = LM_TC_INSET);
91 virtual bool Delete();
94 /// Check consistency of tabs and newlines
96 /// Try to adjust tabs in the expected place, as in eqnarrays
99 short FCode() const { return fcode; }
101 int getPos() const { return pos; }
103 int getRow() const { return row; }
105 int getCol() const { return col; }
107 void setNumCols(int n) { ncols = n; }
109 void SetData(MathedArray * a);
111 MathedArray * GetData() const;
112 /// Copy every object from position p1 to p2
113 MathedArray * Copy(int p1 = 0, int p2 = 10000);
114 /// Delete every object from position p1 to p2
152 /// Saves the current state of the iterator
153 virtual void ipush();
154 /// Recover previous state
159 //#define MX_WAS_SUB 1
161 //#define MX_WAS_SUPER 2