]> git.lyx.org Git - lyx.git/blob - src/lyxrow.h
Fix natbib bug spotted by JMarc.
[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         ///
30         void par(Paragraph * p);
31         ///
32         Paragraph * par();
33         ///
34         Paragraph * par() const;
35         ///
36         void pos(lyx::pos_type p);
37         ///
38         lyx::pos_type pos() const;
39         ///
40         void fill(int f);
41         ///
42         int fill() const;
43         ///
44         void height(unsigned short h);
45         ///
46         unsigned short height() const;
47         ///
48         void width(unsigned int w);
49         ///
50         unsigned int width() const;
51         ///
52         void ascent_of_text(unsigned short a);
53         ///
54         unsigned short ascent_of_text() const;
55         ///
56         void top_of_text(unsigned int top);
57         ///
58         unsigned int top_of_text() const;
59         ///
60         void baseline(unsigned int b);
61         ///
62         unsigned int baseline() const;
63         ///
64         void next(Row * r);
65         ///
66         Row * next() const;
67         ///
68         void previous(Row * r);
69         ///
70         Row * previous() const;
71 private:
72         ///
73         Paragraph * par_;
74         ///
75         lyx::pos_type pos_;
76         /** what is missing to a full row can be negative.
77           Needed for hfills, flushright, block etc. */
78         mutable int fill_;
79         ///
80         unsigned short height_;
81         ///
82         unsigned int width_;
83         /// ascent from baseline including prelude space
84         unsigned short ascent_of_text_;
85         /// the top of the real text in the row
86         unsigned int top_of_text_;
87         ///
88         unsigned int baseline_;
89         ///
90         Row * next_;
91         ///
92         Row * previous_;
93 };
94
95
96 inline
97 Paragraph * Row::par()
98 {
99         return par_;
100 }
101
102
103 inline
104 Paragraph * Row::par() const
105 {
106         return par_;
107 }
108
109
110 inline
111 unsigned short Row::height() const
112 {
113         return height_;
114 }
115
116
117 inline
118 Row * Row::next() const
119 {
120         return next_;
121 }
122
123 #endif