]> git.lyx.org Git - features.git/blob - src/Row.h
26600b4ae73693f82a898b00d434df31e9e2a58c
[features.git] / src / Row.h
1 // -*- C++ -*-
2 /**
3  * \file Row.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 ROW_H
16 #define ROW_H
17
18 #include "support/types.h"
19
20 #include "Dimension.h"
21
22
23 namespace lyx {
24
25 /**
26  * An on-screen row of text. A paragraph is broken into a
27  * RowList for display. Each Row contains position pointers
28  * into the first and last character positions of that row.
29  */
30 class Row {
31 public:
32         ///
33         Row();
34         ///
35         Row(pos_type pos);
36         ///
37         void pos(pos_type p);
38         ///
39         pos_type pos() const;
40         ///
41         void endpos(pos_type p);
42         ///
43         pos_type endpos() const;
44         ///
45         Dimension const & dimension() const { return dim_; }
46         ///
47         int height() const { return dim_.height(); }
48         ///
49         void width(int w) { dim_.wid = w; }
50         ///
51         int width() const { return dim_.wid; }
52         ///
53         void ascent(int a) { dim_.asc = a; }
54         ///
55         int ascent() const { return dim_.asc; }
56         ///
57         void descent(int d) { dim_.des = d; }
58         ///
59         int descent() const { return dim_.des; }
60         /// current debugging only
61         void dump(const char * = "") const;
62
63         /// width of a separator (i.e. space)
64         double separator;
65         /// width of hfills in the body
66         double hfill;
67         /// width of hfills in the label
68         double label_hfill;
69         /// the x position of the row
70         double x;
71
72 private:
73         /// first pos covered by this row
74         pos_type pos_;
75         /// one behind last pos covered by this row
76         pos_type end_;
77         /// Row dimension.
78         Dimension dim_;
79 };
80
81
82 } // namespace lyx
83
84 #endif