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