]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parinset.h
mathed33.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
9 class MathedRowSt;
10 class MathedArray;
11
12
13 /** The math paragraph base class, base to all editable math objects
14     \author Alejandro Aguilar Sierra
15  */
16 class MathParInset: public MathedInset  {
17 public: 
18         ///
19         MathParInset(short st = LM_ST_TEXT, string const & nm = string(),
20                      short ot = LM_OT_MIN);
21         ///
22         virtual ~MathParInset();
23         ///
24         virtual MathedInset * Clone();
25         /// Draw the object on a drawable
26         virtual void draw(Painter &, int x, int baseline);
27         /// Write LaTeX code
28         virtual void Write(std::ostream &, bool fragile);
29         ///
30         virtual void Metrics();
31         ///
32         virtual void UserSetSize(short);
33         /// Data is stored in a LyXArray
34         virtual void setData(MathedArray const &);
35         ///
36         virtual MathedArray & GetData();
37         /// Paragraph position
38         virtual void GetXY(int &, int &) const;
39         ///
40         virtual void setXY(int x, int y);
41         ///
42         virtual void SetFocus(int, int) {}
43         ///
44         virtual bool Inside(int, int);   
45         // Tab stuff used by Matrix.
46         ///
47         virtual void SetAlign(char, string const &) {}
48         ///
49         virtual int GetColumns() const { return 1; }
50         ///
51         virtual int GetRows() const { return 1; }
52         ///
53         virtual bool isMatrix() const { return false; }
54         // Vertical switching
55         ///
56         virtual bool setArgumentIdx(int i) { return (i == 0); }
57         ///
58         virtual bool setNextArgIdx() { return false; }
59         ///
60         virtual int getArgumentIdx() const { return 0; }
61         ///
62         virtual int getMaxArgumentIdx() const { return 0; }
63         ///
64         virtual void SetStyle(short);
65         ///
66         virtual MathedRowSt * getRowSt() const;
67         ///
68         virtual void setRowSt(MathedRowSt *) {}
69         ///
70         virtual bool Permit(short f) const;
71         ///
72         int xo() const {
73                 return xo_;
74         }
75         ///
76         int yo() const {
77                 return yo_;
78         }
79         ///
80         void clear();
81 protected:
82         /// Paragraph data is stored here
83         MathedArray array;
84         /// 
85         short flag;
86         ///
87         void xo(int tx) {
88                 xo_ = tx;
89         }
90         ///
91         void yo(int ty) {
92                 yo_ = ty;
93         }
94 private:
95         /// Cursor start position
96         int xo_;
97         ///
98         int yo_;
99 };
100 #endif