]> git.lyx.org Git - lyx.git/blobdiff - src/Text.h
- Fileformat change: rename "arabic" to "arabic_arabtex"
[lyx.git] / src / Text.h
index 103b31383d668d5bb6c47e72ba6e58889e9a3fe3..5ab0864d7f9f7831116124210e058cded51ec039 100644 (file)
@@ -59,10 +59,23 @@ public:
        ///
        Font getLabelFont(Buffer const & buffer,
                Paragraph const & par) const;
-       ///
+       /** Set font of character at position \p pos in paragraph \p pit.
+        *  Must not be called if \p pos denotes an inset with text contents,
+        *  and the inset is not allowed inside a font change (see below).
+        */
        void setCharFont(Buffer const & buffer, pit_type pit, pos_type pos,
                Font const & font);
 
+       /** Needed to propagate font changes to all text cells of insets
+        *  that are not allowed inside a font change (bug 1973).
+        *  Must not be called if \p pos denotes an ordinary character or an
+        *  inset that is alowed inside a font change.
+        *  FIXME: This should be removed, see documentation of noFontChange
+        *  in insetbase.h
+        */
+       void setInsetFont(Buffer const & buffer, pit_type pit, pos_type pos,
+               Font const & font, bool toggleall = false);
+
        /// what you expect when pressing \<enter\> at cursor position
        void breakParagraph(Cursor & cur, bool keep_layout = false);
 
@@ -89,6 +102,10 @@ public:
        /// Set font over selection paragraphs and rebreak.
        /// FIXME: replace Cursor with DocIterator.
        void setFont(Cursor & cur, Font const &, bool toggleall = false);
+       /// Set font from \p begin to \p end and rebreak.
+       void setFont(Buffer const & buffer, DocIterator const & begin,
+               DocIterator const & end, Font const &,
+               bool toggleall = false);
 
        ///
        void toggleFree(Cursor & cur, Font const &, bool toggleall = false);
@@ -148,7 +165,7 @@ public:
        /// just selects the word the cursor is in
        void selectWord(Cursor & cur, word_location loc);
 
-       /// what type of change operation to make 
+       /// what type of change operation to make
        enum ChangeOp {
                ACCEPT,
                REJECT
@@ -190,19 +207,7 @@ public:
        /// FIXME: cleanup to use BufferView::getCoveringInset() and
        /// setCursorFromCoordinates() instead of checkInsetHit().
        Inset * editXY(Cursor & cur, int x, int y);
-       
-       /// Move cursor one line up.
-       /**
-        * Returns true if an update is needed after the move.
-        */
-       /// FIXME: move to TextMetrics.
-       bool cursorUp(Cursor & cur);
-       /// Move cursor one line down.
-       /**
-        * Returns true if an update is needed after the move.
-        */
-       /// FIXME: move to TextMetrics.
-       bool cursorDown(Cursor & cur);
+
        /// Move cursor one position left
        /**
         * Returns true if an update is needed after the move.
@@ -328,6 +333,15 @@ public:
        docstring getPossibleLabel(Cursor & cur) const;
        /// is this paragraph right-to-left?
        bool isRTL(Buffer const &, Paragraph const & par) const;
+       /// is this position in the paragraph right-to-left?
+       bool isRTL(Buffer const & buffer, CursorSlice const & sl, bool boundary) const;
+       /// is between pos-1 and pos an RTL<->LTR boundary?
+       bool isRTLBoundary(Buffer const & buffer, Paragraph const & par,
+         pos_type pos) const;
+       /// would be a RTL<->LTR boundary between pos and the given font?
+       bool isRTLBoundary(Buffer const & buffer, Paragraph const & par,
+         pos_type pos, Font const & font) const;
+
        ///
        bool checkAndActivateInset(Cursor & cur, bool front);
 
@@ -364,8 +378,6 @@ public:
        ///
        int background_color_;
 
-       ///
-       mutable Bidi bidi;
        ///
        ParagraphList pars_;
 
@@ -387,6 +399,8 @@ private:
        // At cursor position 0, try to merge the paragraph with the one before it.
        // Ignore change tracking, i.e., physically remove the end-of-par character
        bool backspacePos0(Cursor & cur);
+       /// handle the case where bibitems were deleted
+       bool handleBibitems(Cursor & cur);
 
        ///
        void deleteWordForward(Cursor & cur);
@@ -398,6 +412,10 @@ private:
        void charInserted();
        /// set 'number' font property
        void number(Cursor & cur);
+       /// draw selection for a single row
+       void drawRowSelection(PainterInfo & pi, int x, Row const & row,
+               DocIterator const & beg, DocIterator const & end, 
+               bool drawOnBegMargin, bool drawOnEndMargin) const;
 
        /// paste plain text at current cursor.
        /// \param str string to paste