]> git.lyx.org Git - lyx.git/blob - src/lyxrow.h
Wednesday's 'de-mathed-ification' + Row::fill removal
[lyx.git] / src / lyxrow.h
1 // -*- C++ -*-
2 /**
3  * \file lyxrow.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Matthias Ettrich
8  * \author Lars Gullik Bjønnes
9  *
10  * Full author contact details are available in file CREDITS.
11  *
12  * Metrics for an on-screen text row.
13  */
14
15 #ifndef LYXROW_H
16 #define LYXROW_H
17
18 #include "support/types.h"
19
20 ///
21 class Row {
22 public:
23         ///
24         Row();
25         ///
26         Row(lyx::pos_type pos);
27         ///
28         void pos(lyx::pos_type p);
29         ///
30         lyx::pos_type pos() const;
31         ///
32         void endpos(lyx::pos_type p);
33         ///
34         lyx::pos_type endpos() const;
35         ///
36         void height(unsigned int h) { height_ = h; }
37         ///
38         unsigned int height() const { return height_; }
39         ///
40         void width(unsigned int w);
41         ///
42         unsigned int width() const;
43         ///
44         void ascent_of_text(unsigned int a);
45         ///
46         unsigned int ascent_of_text() const;
47         ///
48         void top_of_text(unsigned int top);
49         ///
50         unsigned int top_of_text() const;
51         ///
52         void baseline(unsigned int b);
53         ///
54         unsigned int baseline() const;
55         /// return true if this row is the start of a paragraph
56         bool isParStart() const;
57         /// return the cached y position
58         unsigned int y_offset() const { return y_offset_; }
59         /// cache the y position
60         void y_offset(unsigned int newy) { y_offset_ = newy; }
61         ///
62         float x() const;
63         ///
64         void x(float);
65         ///
66         float fill_separator() const;
67         ///
68         void fill_separator(float);
69         ///
70         float fill_hfill() const;
71         ///
72         void fill_hfill(float);
73         ///
74         float fill_label_hfill() const;
75         ///
76         void fill_label_hfill(float);
77         /// current debugging only
78         void dump(const char * = "") const;
79 private:
80         /// first pos covered by this row
81         lyx::pos_type pos_;
82         /// one behind last pos covered by this row
83         lyx::pos_type end_;
84         ///
85         unsigned int height_;
86         ///
87         unsigned int width_;
88         /// cached y position
89         unsigned int y_offset_;
90         /// ascent from baseline including prelude space
91         unsigned short ascent_of_text_;
92         /// the top of the real text in the row
93         unsigned int top_of_text_;
94         ///
95         unsigned int baseline_;
96         /// offet from left border
97         float x_;
98         ///
99         float fill_separator_;
100         ///
101         float fill_hfill_;
102         ///
103         float fill_label_hfill_;
104 };
105
106 #endif