]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parinset.h
small cleanup, doxygen, formatting changes
[lyx.git] / src / mathed / math_parinset.h
1 // -*- C++ -*-
2 #ifndef MATH_PARINSET_H
3 #define MATH_PARINSET_H
4
5 #include "math_inset.h"
6 #include "math_defs.h"
7
8 class MathedRowSt;
9 class MathedArray;
10
11
12 /** The math paragraph base class, base to all editable math objects
13     \author Alejandro Aguilar Sierra
14  */
15 class MathParInset: public MathedInset  {
16 public: 
17         ///
18         MathParInset(short st = LM_ST_TEXT, string const & nm = string(),
19                      short ot = LM_OT_MIN);
20         ///
21         explicit
22         MathParInset(MathParInset *);
23         ///
24         virtual ~MathParInset();
25         ///
26         virtual MathedInset * Clone();
27         /// Draw the object on a drawable
28         virtual void draw(Painter &, int x, int baseline);
29         /// Write LaTeX code
30         virtual void Write(std::ostream &, bool fragile);
31         ///
32         virtual void Metrics();
33         ///
34         virtual void UserSetSize(short);
35         /// Data is stored in a LyXArray
36         virtual void setData(MathedArray *);
37         ///
38         virtual MathedArray * GetData();
39         /// Paragraph position
40         virtual void GetXY(int &, int &) const;
41         ///
42         virtual void setXY(int x, int y);
43         ///
44         virtual void SetFocus(int, int) {}
45         ///
46         virtual bool Inside(int, int);   
47         // Tab stuff used by Matrix.
48         ///
49         virtual void SetAlign(char, string const &) {}
50         ///
51         virtual int GetColumns() const { return 1; }
52         ///
53         virtual int GetRows() const { return 1; }
54         ///
55         virtual bool isMatrix() const { return false; }
56         // Vertical switching
57         ///
58         virtual bool setArgumentIdx(int i) { return (i == 0); }
59         ///
60         virtual bool setNextArgIdx() { return false; }
61         ///
62         virtual int getArgumentIdx() const { return 0; }
63         ///
64         virtual int getMaxArgumentIdx() const { return 0; }
65         ///
66         virtual void SetStyle(short);
67         ///
68         virtual MathedRowSt * getRowSt() const;
69         ///
70         virtual void setRowSt(MathedRowSt *) {}
71         ///
72         virtual bool Permit(short f) const;
73         ///
74         int xo() const {
75                 return xo_;
76         }
77         ///
78         int yo() const {
79                 return yo_;
80         }
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