]> git.lyx.org Git - lyx.git/blob - src/mathed/xarray.h
some support for the [x][x]alignat environments
[lyx.git] / src / mathed / xarray.h
1 // -*- C++ -*-
2
3 #ifndef MATHEDXARRAY_H
4 #define MATHEDXARRAY_H
5
6 #include <iosfwd>
7 #include "array.h"
8 #include "math_defs.h"
9
10 #ifdef __GNUG__
11 #pragma interface
12 #endif
13
14 class Painter;
15
16 class MathXArray
17 {
18 public:
19         ///
20         MathXArray();
21         ///
22         void metrics(MathStyles st) const;
23         ///
24         void draw(Painter & pain, int x, int y) const;
25
26         ///
27         int xo() const { return xo_; }
28         ///
29         int yo() const { return yo_; }
30         ///
31         int pos2x(int pos) const;
32         ///
33         int x2pos(int pos) const;
34         ///
35         int width(int pos) const;
36
37         ///
38         int ascent() const { return ascent_; }
39         ///
40         int descent() const { return descent_; }
41         ///
42         int height() const { return ascent_ + descent_; }
43         ///
44         int width() const { return width_; }
45         ///
46         MathStyles style() const { return style_; }
47         
48
49         ///
50         MathArray data_;
51         ///
52         mutable int width_;
53         ///
54         mutable int ascent_;
55         ///
56         mutable int descent_;
57         ///
58         mutable int xo_;
59         ///
60         mutable int yo_;
61         ///
62         mutable MathStyles style_;
63 };
64
65 std::ostream & operator<<(std::ostream & os, MathXArray const & ar);
66
67 #endif