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