]> git.lyx.org Git - lyx.git/blob - src/mathed/math_xiter.h
Applied Angus patch to compile on DEC C++ and to avoid name clashes
[lyx.git] / src / mathed / math_xiter.h
1 // -*- C++ -*-
2 #ifndef MATH_XITER_H
3 #define MATH_XITER_H
4
5 #include "math_iter.h"
6 #include "math_rowst.h"
7 #include "math_rowst.h"
8
9 class MathParInset;
10 class MathMatrixInset;
11
12 /**
13    A graphic iterator (updates position.) Used for
14    metrics and updating cursor position
15 */
16 class MathedXIter: public MathedIter {
17 public:
18         ///
19         MathedXIter();
20         //
21         MathedXIter(MathParInset *);
22         ///
23         void SetData(MathParInset *);
24         ///
25         MathParInset * getPar() const;
26         ///
27         virtual bool Next();
28         ///
29         bool Prev();
30         ///
31         bool Up();
32         ///
33         bool Down();
34         ///
35         void goNextColumn();
36         ///
37         void GoLast();
38         ///
39         void GoBegin();
40         ///
41         void Adjust();
42         ///
43         void GetPos(int &, int &) const;
44         ///
45         void GetIncPos(int &, int &) const;
46         ///
47         string const GetString() const;
48         ///
49         int GetX() const;
50         ///
51         int GetY() const;
52         ///
53         void subMetrics(int, int);
54         ///
55         void fitCoord(int, int);
56         /// 
57         void getAD(int & a, int & d) const;
58         
59         /// Create a new row and insert #ncols# tabs.
60         void addRow();
61         ///
62         void delRow();
63         
64         ///
65         bool setLabel(string const & label);
66         ///
67         static string error_label;
68         ///
69         string const & getLabel() const;
70         ///
71         bool setNumbered(bool);
72         
73         ///
74         void setTab(int, int);
75         /// Merge the array at current position
76         void Merge(MathedArray const &);
77         /// Delete every object from current position to pos2
78         void Clean(int pos2);
79         ///
80         virtual void ipush();
81         ///
82         virtual void ipop();
83         ///
84         MathedRowContainer::iterator currentRow() {
85                 return crow_;
86         }
87         
88 protected:
89         ///
90         MathedRowContainer & container();
91         /// This function is not recursive, as MathPar::Metrics is
92         void IMetrics(int, int &, int &, int &);
93         /// Font size (display, text, script, script2) 
94         int size_;
95         /// current position
96         mutable int x_;
97         ///
98         int y_;
99         ///
100         MathParInset * p_;
101         
102         // Limits auxiliary variables
103         /// Position and max width of a script
104         int sx_;
105         ///
106         int sw_;
107         /// true= center, false= left align (default)
108         bool limits_;
109         /// 
110         MathedRowContainer::iterator crow_;
111         ///
112         friend class MathMatrixInset;
113 };
114 #endif