]> git.lyx.org Git - lyx.git/blob - src/Row.h
* some more traces of the signals in CursorSlice
[lyx.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
21 namespace lyx {
22
23 /**
24  * An on-screen row of text. A paragraph is broken into a
25  * RowList for display. Each Row contains position pointers
26  * into the first and last character positions of that row.
27  */
28 class Row {
29 public:
30         ///
31         Row();
32         ///
33         Row(pos_type pos);
34         ///
35         void pos(pos_type p);
36         ///
37         pos_type pos() const;
38         ///
39         void endpos(pos_type p);
40         ///
41         pos_type endpos() const;
42         ///
43         int height() const { return ascent_ + descent_; }
44         ///
45         void width(int w);
46         ///
47         int width() const;
48         ///
49         void ascent(int b);
50         ///
51         int ascent() const;
52         ///
53         void descent(int b) { descent_ = b; }
54         ///
55         int descent() const { return descent_; }
56         /// current debugging only
57         void dump(const char * = "") const;
58
59 private:
60         /// first pos covered by this row
61         pos_type pos_;
62         /// one behind last pos covered by this row
63         pos_type end_;
64         ///
65         int ascent_;
66         ///
67         int descent_;
68         ///
69         int width_;
70 };
71
72
73 class RowMetrics {
74 public:
75         RowMetrics();
76         /// width of a separator (i.e. space)
77         double separator;
78         /// width of hfills in the body
79         double hfill;
80         /// width of hfills in the label
81         double label_hfill;
82         /// the x position of the row
83         double x;
84 };
85
86
87
88 } // namespace lyx
89
90 #endif