]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parinset.h
change a lot of methods to begin with small char
[lyx.git] / src / mathed / math_parinset.h
1 // -*- C++ -*-
2 #ifndef MATH_PARINSET_H
3 #define MATH_PARINSET_H
4
5 #include "array.h"
6 #include "math_inset.h"
7 #include "math_defs.h"
8 #include "math_rowst.h"
9
10 #ifdef __GNUG__
11 #pragma interface
12 #endif
13
14 class MathedArray;
15
16
17 /** The math paragraph base class, base to all editable math objects
18     \author Alejandro Aguilar Sierra
19  */
20 class MathParInset : public MathedInset  {
21 public: 
22         ///
23         MathParInset(short st = LM_ST_TEXT, string const & nm = string(),
24                      short ot = LM_OT_MIN);
25         ///
26         virtual MathedInset * clone();
27         ///
28         virtual void substitute(MathMacro *);
29         /// Draw the object on a drawable
30         virtual void draw(Painter &, int x, int baseline);
31         /// Write LaTeX code
32         virtual void Write(std::ostream &, bool fragile);
33         /// Write normalized content
34         virtual void WriteNormal(std::ostream &);
35         ///
36         virtual void Metrics();
37         ///
38         virtual void UserSetSize(short);
39         /// Data is stored in a LyXArray
40         virtual void setData(MathedArray const &);
41         ///
42         virtual MathedArray & GetData();
43         ///
44         virtual MathedArray const & GetData() const;
45         ///
46         //virtual MathedArray & GetData(int i);
47         /// Paragraph position
48         virtual void GetXY(int &, int &) const;
49         ///
50         virtual void setXY(int x, int y);
51         ///
52         virtual void SetFocus(int, int) {}
53         ///
54         virtual bool Inside(int, int);   
55         // Tab stuff used by Matrix.
56         ///
57         virtual void SetAlign(char, string const &);
58         ///
59         virtual int GetColumns() const;
60         ///
61         virtual int GetRows() const;
62         ///
63         virtual bool isMatrix() const;
64         // Vertical switching
65         ///
66         virtual bool setArgumentIdx(int i);
67         ///
68         virtual bool setNextArgIdx();
69         ///
70         virtual int getArgumentIdx() const;
71         ///
72         virtual int getMaxArgumentIdx() const;
73         ///
74         virtual void SetStyle(short);
75         ///
76         MathedRowContainer & getRowSt();
77         ///
78         virtual bool Permit(short f) const;
79         ///
80         int xo() const;
81         ///
82         int yo() const;
83         ///
84         void clear();
85         ///
86         string label() const;
87         ///
88         void push_back(MathedInset *, int);
89 //protected:
90         /// Paragraph data is stored here
91         MathedArray array;
92         /// 
93         short flag;
94         ///
95         void xo(int tx);
96         ///
97         void yo(int ty);
98         ///
99         MathedRowContainer row_;
100 private:
101         /// Cursor start position
102         int xo_;
103         ///
104         int yo_;
105 };
106
107
108 inline
109 void MathParInset::SetAlign(char, string const &)
110 {}
111
112
113 inline
114 int MathParInset::GetColumns() const
115 {
116         return 1;
117 }
118
119
120 inline
121 int MathParInset::GetRows() const
122 {
123         return 1;
124 }
125
126
127 inline
128 bool MathParInset::isMatrix() const
129 {
130         return false;
131 }
132
133
134 inline
135 bool MathParInset::setArgumentIdx(int i)
136 {
137         return (i == 0);
138 }
139
140
141 inline
142 bool MathParInset::setNextArgIdx()
143 {
144         return false;
145 }
146
147
148 inline
149 int MathParInset::getArgumentIdx() const
150 {
151         return 0;
152 }
153
154
155 inline
156 int MathParInset::getMaxArgumentIdx() const
157 {
158         return 0;
159 }
160
161
162 inline
163 int MathParInset::xo() const
164 {
165         return xo_;
166 }
167
168
169 inline
170 int MathParInset::yo() const
171 {
172         return yo_;
173 }
174
175
176 inline
177 void MathParInset::xo(int tx)
178 {
179         xo_ = tx;
180 }
181
182
183 inline
184 void MathParInset::yo(int ty)
185 {
186         yo_ = ty;
187 }
188 #endif