]> git.lyx.org Git - lyx.git/blob - src/mathed/dimension.h
enable insertion of spaces in all \textxxx modes.
[lyx.git] / src / mathed / dimension.h
1 #ifndef DIMENSION_H
2 #define DIMENSION_H
3
4 #include <iosfwd>
5
6 class LyXFont;
7
8 class Dimension {
9 public:
10         /// constructor
11         Dimension() : w(0), a(0), d(0) {}
12         /// initialize data
13         Dimension(int ww, int aa, int dd) : w(ww), a(aa), d(dd) {}
14
15         /// glue horizontally
16         void operator+=(Dimension const & dim);
17         /// set to empty box
18         void clear() { w = a = d = 0; }
19         /// set to empty box suitble for given font
20         void clear(LyXFont const & font);
21         /// get height
22         int height() const { return a + d; }
23         /// get ascent
24         int ascent() const { return a; }
25         /// get descent
26         int descent() const { return d; }
27         /// get width
28         int width() const { return w; }
29
30 public: 
31         /// width
32         int w;
33         /// ascent
34         int a;
35         /// descent
36         int d;
37 };
38
39 std::ostream & operator<<(std::ostream & os, Dimension const & dim);
40
41 #endif