1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
1999-11-15 12:01:38 +00:00
|
|
|
* ======================================================
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
1999-11-04 01:40:20 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
|
|
|
* Copyright 1995-1998 The LyX Team
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-11-04 01:40:20 +00:00
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#ifndef TEXROW_H
|
|
|
|
#define TEXROW_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
1999-11-22 16:19:48 +00:00
|
|
|
#include <list>
|
|
|
|
using std::list;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
class LyXParagraph;
|
|
|
|
|
|
|
|
// Controls correspondance between paragraphs and the generated LaTeX file
|
|
|
|
class TexRow {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
TexRow() {
|
|
|
|
count = 0;
|
|
|
|
lastpar = 0;
|
|
|
|
lastpos = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Clears structure
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
/// Define what paragraph and position the next row will represent
|
1999-11-22 16:19:48 +00:00
|
|
|
void start(LyXParagraph * par, int pos);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// Insert node when line is completed
|
|
|
|
void newline();
|
|
|
|
|
|
|
|
/// Returns paragraph id and position from a row number
|
1999-11-22 16:19:48 +00:00
|
|
|
void getIdFromRow(int row, int & id, int & pos);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// Appends another TexRow
|
1999-11-22 16:19:48 +00:00
|
|
|
TexRow & operator+= (TexRow const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// Linked list of items
|
1999-11-22 16:19:48 +00:00
|
|
|
struct RowItem {
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
RowItem() {
|
1999-09-27 18:44:28 +00:00
|
|
|
id = -1;
|
|
|
|
pos = -1;
|
|
|
|
rownumber = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
///
|
|
|
|
int id;
|
|
|
|
///
|
|
|
|
int pos;
|
|
|
|
///
|
|
|
|
int rownumber;
|
|
|
|
};
|
|
|
|
///
|
|
|
|
unsigned int count;
|
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
typedef list<RowItem> RowList;
|
|
|
|
///
|
|
|
|
RowList rowlist;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Last paragraph
|
|
|
|
LyXParagraph * lastpar;
|
|
|
|
/// Last position
|
|
|
|
int lastpos;
|
|
|
|
|
|
|
|
};
|
|
|
|
#endif
|