X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxtext.h;h=9a03033cf96d49ff0d23729887ad2876e2942a6f;hb=2b378ca3fdbd701b0d5e350e1c6b22155c07a2dc;hp=c54132f5543e06bef142afcd56690f2562d25ea0;hpb=b2126408cfeaa251bc966e3df49a7000a202add3;p=lyx.git diff --git a/src/lyxtext.h b/src/lyxtext.h index c54132f554..9a03033cf9 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -30,11 +30,11 @@ class Buffer; class BufferParams; class BufferView; class CursorSlice; +class DocIterator; class ErrorList; -class InsetBase; -class InsetBase_code; class FuncRequest; class FuncStatus; +class InsetBase; class LColor_color; class LCursor; class LyXTextClass; @@ -94,11 +94,6 @@ public: /// FIXME: replace LCursor with DocIterator. void setFont(LCursor & cur, LyXFont const &, bool toggleall = false); - /// returns pos in given par at given x coord. - /// FIXME: move to TextMetrics. - pos_type x2pos(BufferView const &, pit_type pit, int row, int x) const; - int pos2x(pit_type pit, pos_type pos) const; - /// void toggleFree(LCursor & cur, LyXFont const &, bool toggleall = false); @@ -149,13 +144,6 @@ public: /// FIXME: move to TextMetrics. pit_type getPitNearY(BufferView & bv, int y); - /** returns the column near the specified x-coordinate of the row - x is set to the real beginning of this column - */ - /// FIXME: move to TextMetrics. - pos_type getColumnNearX(BufferView const & bv, int right_margin, - pit_type pit, Row const & row, int & x, bool & boundary) const; - /** Find the word under \c from in the relative location * defined by \c word_location. * @param from return here the start of the word @@ -185,8 +173,10 @@ public: void recUndo(LCursor & cur, pit_type first, pit_type last) const; /// void recUndo(LCursor & cur, pit_type first) const; - /// returns true if par was empty and was removed - bool setCursorFromCoordinates(LCursor & cur, int x, int y); + + /// sets cursor only within this LyXText. + /// x,y are screen coordinates + void setCursorFromCoordinates(LCursor & cur, int x, int y); /// sets cursor recursively descending into nested editable insets /** @@ -349,22 +339,10 @@ public: bool boundary) const; /// delete double space or empty paragraphs around old cursor - /// FIXME: replace LCursor with DocIterator. - bool deleteEmptyParagraphMechanism(LCursor & cur, LCursor & old); - - /// sets row.end to the pos value *after* which a row should break. - /// for example, the pos after which isNewLine(pos) == true - /// FIXME: move to TextMetrics. - void rowBreakPoint(Buffer const &, int right_margin, int max_width, pit_type pit, - Row & row) const; - /// sets row.width to the minimum space a row needs on the screen in pixel - /// FIXME: move to TextMetrics. - void setRowWidth(Buffer const &, int right_margin, int max_width, pit_type pit, - Row & row) const; - - /// Calculate and set the height of the row - /// FIXME: move to TextMetrics. - void setHeightOfRow(BufferView const &, pit_type, Row & row); + /// FIXME: replace LCursor with DocIterator. This is not possible right + /// now because recordUndo() is called which needs a LCursor. + bool deleteEmptyParagraphMechanism(LCursor & cur, + LCursor & old, bool & need_anchor_change); public: /// the current font settings @@ -404,14 +382,16 @@ private: void deleteWordBackward(LCursor & cur); /// void deleteLineForward(LCursor & cur); - - /// FIXME - int labelEnd(Buffer const &, int max_width, pit_type pit) const; - /// void charInserted(); /// set 'number' font property void number(LCursor & cur); + + /// paste plain text at current cursor. + /// \param str string to paste + /// \param asParagraphs whether to paste as paragraphs or as lines + void pasteString(LCursor & cur, docstring const & str, + bool asParagraphs); }; } // namespace lyx