]> git.lyx.org Git - lyx.git/blobdiff - src/lyxtext.h
fix reading the author field.
[lyx.git] / src / lyxtext.h
index ddfc3aedd05e226d2f96d277e77b24e71f6651bb..1eb3158c8a076e337a81e7ffb9f7600d45e5df5c 100644 (file)
@@ -20,7 +20,6 @@
 #include "lyxfont.h"
 #include "layout.h"
 #include "lyxlayout_ptr_fwd.h"
-#include "RowList_fwd.h"
 #include "ParagraphList_fwd.h"
 
 #include <iosfwd>
@@ -51,7 +50,7 @@ public:
        typedef lyx::pos_type pos_type;
        ///
        typedef lyx::par_type par_type;
-       
+
        /// constructor
        explicit LyXText(BufferView *);
        ///
@@ -60,11 +59,11 @@ public:
        /// 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);
        ///
@@ -101,6 +100,10 @@ public:
        /// 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);
 
@@ -144,7 +147,7 @@ public:
          * 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
@@ -185,7 +188,7 @@ public:
        ///
        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);
        ///
@@ -265,16 +268,16 @@ public:
 
        /// 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
@@ -299,17 +302,9 @@ public:
        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;
@@ -377,7 +372,7 @@ private:
        /// 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
@@ -408,7 +403,7 @@ private:
        /// 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;