]> git.lyx.org Git - lyx.git/blob - src/lyxrow.h
2964a5f6d3a496d0d88e47ebb62c9804da3ef186
[lyx.git] / src / lyxrow.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2001 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef LYXROW_H
13 #define LYXROW_H
14
15 #include "support/types.h"
16
17 class Paragraph;
18
19 ///
20 class Row {
21 public:
22         ///
23         Row();
24
25         ///
26         void par(Paragraph * p);
27         ///
28         Paragraph * par();
29         ///
30         Paragraph * par() const;
31         ///
32         void pos(lyx::pos_type p);
33         ///
34         lyx::pos_type pos() 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         ///
60         void next(Row * r);
61         ///
62         Row * next() const;
63         ///
64         void previous(Row * r);
65         ///
66         Row * previous() const;
67 private:
68         ///
69         Paragraph * par_;
70         ///
71         lyx::pos_type pos_;
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         /// ascent from baseline including prelude space
80         unsigned short ascent_of_text_;
81         /// the top of the real text in the row
82         unsigned int top_of_text_;
83         ///
84         unsigned int baseline_;
85         ///
86         Row * next_;
87         ///
88         Row * previous_;
89 };
90
91
92 inline
93 Paragraph * Row::par()
94 {
95         return par_;
96 }
97
98
99 inline
100 Paragraph * Row::par() const
101 {
102         return par_;
103 }
104
105
106 inline
107 unsigned short Row::height() const
108 {
109         return height_;
110 }
111
112
113 inline
114 Row * Row::next() const
115 {
116         return next_;
117 }
118
119 #endif