]> git.lyx.org Git - lyx.git/blob - src/texrow.h
f71bc20507638102be7b39d82da3eb03b77df953
[lyx.git] / src / texrow.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-1998 The LyX Team
9  *
10  * ====================================================== */
11
12 #ifndef TEXROW_H
13 #define TEXROW_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 class LyXParagraph;
20
21 // Controls correspondance between paragraphs and the generated LaTeX file
22 class TexRow {
23 public:
24         ///
25         TexRow() {
26                 count = 0;
27                 next = 0;
28                 lastpar = 0;
29                 lastpos = -1;
30         }
31         ///
32         ~TexRow() {
33                 reset();
34         }
35
36         /// Clears structure
37         void reset();
38
39         /// Define what paragraph and position the next row will represent
40         void start(LyXParagraph *par, int pos);
41
42         /// Insert node when line is completed
43         void newline();
44
45         /// Returns paragraph id and position from a row number
46         void getIdFromRow(int row, int &id, int &pos);
47
48         /// Appends another TexRow
49         TexRow & operator+=(const TexRow &);
50
51 private:
52         /// Linked list of items
53         struct TexRow_Item {
54                 ///
55                 TexRow_Item() {
56                         id = -1;
57                         pos = -1;
58                         next = 0;
59                         rownumber = 0;
60                 }
61
62                 ///
63                 int id;
64                 ///
65                 int pos;
66                 ///
67                 int rownumber;
68                 ///
69                 TexRow_Item *next;
70         };
71         ///
72         unsigned int count;
73         ///
74         TexRow_Item *next;
75         /// Last paragraph
76         LyXParagraph * lastpar;
77         /// Last position
78         int lastpos;
79         
80 };
81 #endif