#include "lyxfont.h"
#include "layout.h"
#include "lyxlayout_ptr_fwd.h"
-#include "RowList_fwd.h"
#include "ParagraphList_fwd.h"
#include <iosfwd>
typedef lyx::pos_type pos_type;
///
typedef lyx::par_type par_type;
-
+
/// constructor
explicit LyXText(BufferView *);
///
/// update y coordinate cache of all paragraphs
void updateParPositions();
///
- LyXFont getFont(par_type pit, pos_type pos) const;
+ LyXFont getFont(Paragraph const & par, pos_type pos) const;
///
LyXFont getLayoutFont(par_type pit) const;
///
- LyXFont getLabelFont(par_type pit) const;
+ LyXFont getLabelFont(Paragraph const & par) const;
///
void setCharFont(par_type pit, pos_type pos, LyXFont const & font);
///
/// rebreaks the cursor par
void redoParagraph(LCursor & cur);
+ /// returns pos in given par at given x coord
+ pos_type x2pos(par_type pit, int row, int x) const;
+ int pos2x(par_type pit, pos_type pos) const;
+
///
void toggleFree(LCursor & cur, LyXFont const &, bool toggleall = false);
* y-coordinate (relative to the whole text). y is set to the
* real beginning of this row
*/
- RowList::iterator getRowNearY(int y, par_type & pit) const;
+ Row const & getRowNearY(int y, par_type & pit) const;
/** returns the column near the specified x-coordinate of the row
x is set to the real beginning of this column
///
void setCursorFromCoordinates(LCursor & cur, int x, int y);
///
- InsetBase * editXY(LCursor & cur, int x, int y);
+ InsetBase * editXY(LCursor & cur, int x, int y) const;
///
void cursorUp(LCursor & cur);
///
/// current text heigth
int height() const;
-
+
/// updates all counters
void updateCounters();
/// Returns an inset if inset was hit, or 0 if not.
- InsetBase * checkInsetHit(int x, int y);
+ InsetBase * checkInsetHit(int x, int y) const;
///
- int singleWidth(par_type pit, pos_type pos) const;
+ int singleWidth(Paragraph const & par, pos_type pos) const;
///
- int singleWidth(par_type pit,
+ int singleWidth(Paragraph const & par,
pos_type pos, char c, LyXFont const & Font) const;
/// return the color of the canvas
ParagraphList & paragraphs() const;
/// return true if this is the main text
bool isMainText() const;
-
+
/// return first row of text
- RowList::iterator firstRow() const;
- /// return last row of text
- RowList::iterator lastRow() const;
- /// return row "behind" last row of text
- RowList::iterator endRow() const;
- /// return next row crossing paragraph boundaries
- void nextRow(par_type & pit, RowList::iterator & rit) const;
- /// return previous row crossing paragraph boundaries
- void previousRow(par_type & pit, RowList::iterator & rit) const;
+ Row const & firstRow() const;
/// is this row the last in the text?
bool isLastRow(par_type pit, Row const & row) const;
/// return past-the-last paragraph influenced by a layout
/// change on pit
par_type undoSpan(par_type pit);
-
+
/// rebreaks the given par
void redoParagraphInternal(par_type pit);
/// used in setlayout
/// sets row.width to the minimum space a row needs on the screen in pixel
void setRowWidth(par_type pit, Row & row) const;
/// the minimum space a manual label needs on the screen in pixels
- int labelFill(par_type pit, Row const & row) const;
+ int labelFill(Paragraph const & par, Row const & row) const;
/// FIXME
int labelEnd(par_type pit) const;