]> git.lyx.org Git - lyx.git/blob - src/lyxrow.h
Trivial fixes to spelling/grammar in a couple of comments.
[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 short h);
41         ///
42         unsigned short height() const;
43         ///
44         void width(unsigned int w);
45         ///
46         unsigned int width() const;
47         ///
48         void ascent_of_text(unsigned short a);
49         ///
50         unsigned short 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;
63         /// cache the y position
64         void y(unsigned int newy);
65         /// current debugging only
66         void dump(const char * = "") const;
67 private:
68         /// first pos covered by this row
69         lyx::pos_type pos_;
70         /// one behind last pos covered by this row
71         lyx::pos_type end_;
72         /** what is missing to a full row. Can be negative.
73           Needed for hfills, flushright, block etc. */
74         mutable int fill_;
75         ///
76         unsigned short height_;
77         ///
78         unsigned int width_;
79         /// cached y position
80         unsigned int y_;
81         /// ascent from baseline including prelude space
82         unsigned short ascent_of_text_;
83         /// the top of the real text in the row
84         unsigned int top_of_text_;
85         ///
86         unsigned int baseline_;
87 };
88
89 #endif