4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Matthias Ettrich
8 * \author Lars Gullik Bjønnes
11 * Full author contact details are available in file CREDITS.
23 /// Represents the correspondence between paragraphs and the generated
29 TexRow() : lastid(-1), lastpos(-1) {}
34 /// Define what paragraph and position the next row will represent
35 void start(int id, int pos);
37 /// Insert node when line is completed
41 * getIdFromRow - find pid and position for a given row
42 * @param row row number to find
43 * @param id set to id if found
44 * @param pos set to paragraph position if found
45 * @return true if found, false otherwise
47 * If the row could not be found, pos is set to zero and
50 bool getIdFromRow(int row, int & id, int & pos) const;
53 * getRowFromIdPos - find row containing a given id and pos
54 * @param id of the paragraph
55 * @param pos a given position in that paragraph
56 * @return the row number within the rowlist
58 int getRowFromIdPos(int id, int pos) const;
60 /// Returns the number of rows contained
61 int rows() const { return rowlist.size(); }
63 /// an individual id/pos <=> row mapping
66 RowItem(int id, int pos)
71 int id() const { return id_; }
72 /// set paragraph position
73 void pos(int p) { pos_ = p; }
74 /// paragraph position
75 int pos() const { return pos_; }
82 typedef std::vector<RowItem> RowList;
84 /// container of id/pos <=> row mapping