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