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), started(false) {}
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
40 /// Insert multiple nodes when zero or more lines are completed
41 void newlines(int num_lines);
44 * getIdFromRow - find pid and position for a given row
45 * @param row row number to find
46 * @param id set to id if found
47 * @param pos set to paragraph position if found
48 * @return true if found, false otherwise
50 * If the row could not be found, pos is set to zero and
53 bool getIdFromRow(int row, int & id, int & pos) const;
56 * getRowFromIdPos - find row containing a given id and pos
57 * @param id of the paragraph
58 * @param pos a given position in that paragraph
59 * @return the row number within the rowlist
61 int getRowFromIdPos(int id, int pos) const;
63 /// Returns the number of rows contained
64 int rows() const { return rowlist.size(); }
66 /// an individual id/pos <=> row mapping
69 RowItem(int id, int pos)
74 int id() const { return id_; }
75 /// set paragraph position
76 void pos(int p) { pos_ = p; }
77 /// paragraph position
78 int pos() const { return pos_; }
85 typedef std::vector<RowItem> RowList;
87 /// container of id/pos <=> row mapping
93 /// Is id/pos already registered for current row?