]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parinset.h
mathed64.diff
[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         ///
34         virtual void Metrics();
35         ///
36         virtual void UserSetSize(short);
37         /// Data is stored in a LyXArray
38         virtual void setData(MathedArray const &);
39         ///
40         virtual MathedArray & GetData();
41         ///
42         virtual MathedArray const & GetData() const;
43         /// Paragraph position
44         virtual void GetXY(int &, int &) const;
45         ///
46         virtual void setXY(int x, int y);
47         ///
48         virtual void SetFocus(int, int) {}
49         ///
50         virtual bool Inside(int, int);   
51         // Tab stuff used by Matrix.
52         ///
53         virtual void SetAlign(char, string const &);
54         ///
55         virtual int GetColumns() const;
56         ///
57         virtual int GetRows() const;
58         ///
59         virtual bool isMatrix() const;
60         // Vertical switching
61         ///
62         virtual bool setArgumentIdx(int i);
63         ///
64         virtual bool setNextArgIdx();
65         ///
66         virtual int getArgumentIdx() const;
67         ///
68         virtual int getMaxArgumentIdx() const;
69         ///
70         virtual void SetStyle(short);
71         ///
72         MathedRowContainer & getRowSt();
73         ///
74         virtual bool Permit(short f) const;
75         ///
76         int xo() const;
77         ///
78         int yo() const;
79         ///
80         void clear();
81         ///
82         string label() const;
83 //protected:
84         /// Paragraph data is stored here
85         MathedArray array;
86         /// 
87         short flag;
88         ///
89         void xo(int tx);
90         ///
91         void yo(int ty);
92         ///
93         MathedRowContainer row_;
94 private:
95         /// Cursor start position
96         int xo_;
97         ///
98         int yo_;
99 };
100
101
102 inline
103 void MathParInset::SetAlign(char, string const &)
104 {}
105
106
107 inline
108 int MathParInset::GetColumns() const
109 {
110         return 1;
111 }
112
113
114 inline
115 int MathParInset::GetRows() const
116 {
117         return 1;
118 }
119
120
121 inline
122 bool MathParInset::isMatrix() const
123 {
124         return false;
125 }
126
127
128 inline
129 bool MathParInset::setArgumentIdx(int i)
130 {
131         return (i == 0);
132 }
133
134
135 inline
136 bool MathParInset::setNextArgIdx()
137 {
138         return false;
139 }
140
141
142 inline
143 int MathParInset::getArgumentIdx() const
144 {
145         return 0;
146 }
147
148
149 inline
150 int MathParInset::getMaxArgumentIdx() const
151 {
152         return 0;
153 }
154
155
156 inline
157 int MathParInset::xo() const
158 {
159         return xo_;
160 }
161
162
163 inline
164 int MathParInset::yo() const
165 {
166         return yo_;
167 }
168
169
170 inline
171 void MathParInset::xo(int tx)
172 {
173         xo_ = tx;
174 }
175
176
177 inline
178 void MathParInset::yo(int ty)
179 {
180         yo_ = ty;
181 }
182 #endif