]> git.lyx.org Git - lyx.git/blob - src/lyxrow.h
Point fix, earlier forgotten
[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 end(lyx::pos_type p);
33         ///
34         lyx::pos_type end() const;
35         ///
36         void fill(int f);
37         ///
38         int fill() const;
39         ///
40         void height(unsigned int h) { height_ = h; }
41         ///
42         unsigned int height() const { return height_; }
43         ///
44         void width(unsigned int w);
45         ///
46         unsigned int width() const;
47         ///
48         void ascent_of_text(unsigned int a);
49         ///
50         unsigned int ascent_of_text() const;
51         ///
52         void top_of_text(unsigned int top);
53         ///
54         unsigned int top_of_text() const;
55         ///
56         void baseline(unsigned int b);
57         ///
58         unsigned int baseline() const;
59         /// return true if this row is the start of a paragraph
60         bool isParStart() const;
61         /// return the cached y position
62         unsigned int y() const { return y_; }
63         /// cache the y position
64         void y(unsigned int newy) { y_ = newy; }
65         ///
66         float x() const;
67         ///
68         void x(float);
69         ///
70         float fill_separator() const;
71         ///
72         void fill_separator(float);
73         ///
74         float fill_hfill() const;
75         ///
76         void fill_hfill(float);
77         ///
78         float fill_label_hfill() const;
79         ///
80         void fill_label_hfill(float);
81         /// current debugging only
82         void dump(const char * = "") const;
83 private:
84         /// first pos covered by this row
85         lyx::pos_type pos_;
86         /// one behind last pos covered by this row
87         lyx::pos_type end_;
88         /** what is missing to a full row. Can be negative.
89           Needed for hfills, flushright, block etc. */
90         mutable int fill_;
91         ///
92         unsigned int height_;
93         ///
94         unsigned int width_;
95         /// cached y position
96         unsigned int y_;
97         /// ascent from baseline including prelude space
98         unsigned short ascent_of_text_;
99         /// the top of the real text in the row
100         unsigned int top_of_text_;
101         ///
102         unsigned int baseline_;
103         /// offet from left border
104         float x_;
105         ///
106         float fill_separator_;
107         ///
108         float fill_hfill_;
109         ///
110         float fill_label_hfill_;
111 };
112
113 #endif