]> git.lyx.org Git - lyx.git/blob - src/mathed/math_xiter.h
some inline fix + mathed16.diff
[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
7 struct MathedRowSt;
8
9 /**
10    A graphic iterator (updates position.) Used for
11    metrics and updating cursor position
12 */
13 class MathedXIter: public MathedIter {
14 public:
15         ///
16         MathedXIter();
17         //
18         MathedXIter(MathParInset *);
19         ///
20         void SetData(MathParInset *);
21         ///
22         MathParInset * getPar() const;
23         ///
24         bool Next();
25         ///
26         bool Prev();
27         ///
28         bool Up();
29         ///
30         bool Down();
31         ///
32         bool goNextColumn();
33         ///
34         void GoLast();
35         ///
36         void GoBegin();
37         ///
38         void Adjust();
39         ///
40         void GetPos(int &, int &) const;
41         ///
42         void GetIncPos(int &, int &) const;
43         ///
44         string const GetString() const;
45         ///
46         int GetX() const;
47         ///
48         int GetY() const;
49         ///
50         void subMetrics(int, int);
51         ///
52         void fitCoord(int, int);
53         /// 
54         void getAD(int & a, int & d) const;
55         
56         /// Create a new row and insert #ncols# tabs.
57         void addRow();
58         ///
59         void delRow();
60         
61         ///
62         bool setLabel(string const & label);
63         ///
64         static string error_label;
65         ///
66         string const & getLabel() const;
67         ///
68         bool setNumbered(bool);
69         
70         ///
71         void setTab(int, int);
72         /// Merge the array at current position
73         void Merge(MathedArray *);
74         /// Delete every object from current position to pos2
75         void Clean(int pos2);
76         ///
77         MathedRowSt * adjustVerticalSt();
78 private:
79         /// This function is not recursive, as MathPar::Metrics is
80         void IMetrics(int, int &, int &, int &);
81         /// Font size (display, text, script, script2) 
82         int size;
83         /// current position
84         mutable int x;
85         ///
86         int y;
87         ///
88         MathParInset * p;
89         
90         // Limits auxiliary variables
91         /// Position and max width of a script
92         int sx;
93         ///
94         int sw;
95         /// true= center, false= left align (default)
96         bool limits;
97         /// Type of previous script
98         short s_type;  
99         ///
100         void ipush();
101         ///
102         void ipop();
103 protected:
104         /// 
105         MathedRowSt * crow;
106         
107 private:
108         ///
109         friend class MathedCursor;
110 };
111 #endif