]> git.lyx.org Git - lyx.git/blob - src/lyxrow.h
fix to #241 and #300 from John
[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 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "support/types.h"
20
21 class Paragraph;
22
23 ///
24 class Row {
25 public:
26         ///
27         Row();
28         ///
29         void par(Paragraph * p);
30         ///
31         Paragraph * par();
32         ///
33         Paragraph * par() const;
34         ///
35         void pos(lyx::pos_type p);
36         ///
37         lyx::pos_type pos() const;
38         ///
39         void fill(int f);
40         ///
41         int fill() const;
42         ///
43         void height(unsigned short h);
44         ///
45         unsigned short height() const;
46         ///
47         void width(unsigned int w);
48         ///
49         unsigned int width() const;
50         ///
51         void ascent_of_text(unsigned short a);
52         ///
53         unsigned short ascent_of_text() const;
54         ///
55         void baseline(unsigned int b);
56         ///
57         unsigned int baseline() const;
58         ///
59         void next(Row * r);
60         ///
61         Row * next() const;
62         ///
63         void previous(Row * r);
64         ///
65         Row * previous() const;
66 private:
67         ///
68         Paragraph * par_;
69         ///
70         lyx::pos_type pos_;
71         /** what is missing to a full row can be negative.
72           Needed for hfills, flushright, block etc. */
73         mutable int fill_;
74         ///
75         unsigned short height_;
76         ///
77         unsigned int width_;
78         ///
79         unsigned short ascent_of_text_;
80         ///
81         unsigned int baseline_;
82         ///
83         Row * next_;
84         ///
85         Row * previous_;
86 };
87
88
89 inline
90 Paragraph * Row::par()
91 {
92         return par_;
93 }
94
95
96 inline
97 Paragraph * Row::par() const
98 {
99         return par_;
100 }
101
102
103 inline
104 unsigned short Row::height() const
105 {
106         return height_;
107 }
108
109
110 inline
111 Row * Row::next() const
112 {
113         return next_;
114 }
115
116 #endif