]> git.lyx.org Git - lyx.git/blobdiff - src/lyxtext.h
Fix working of the spellchecker dialog with ispell when there are no
[lyx.git] / src / lyxtext.h
index 384efd0f2ad8fcc8c01bb77c64ba4a2819ded209..3be37e1cfff0300516523e2044fcbe50e2f0dddf 100644 (file)
@@ -22,6 +22,7 @@
 #include "layout.h"
 #include "lyxrow.h"
 #include "vspace.h"
+#include "Spacing.h"
 #include "LColor.h"
 
 class Buffer;
@@ -96,6 +97,10 @@ public:
        LyXFont const getFont(Buffer const *, Paragraph * par,
                        Paragraph::size_type pos) const;
        ///
+       LyXFont const getLayoutFont(Buffer const *, Paragraph * par) const;
+       ///
+       LyXFont const getLabelFont(Buffer const *, Paragraph * par) const;
+       ///
        void setCharFont(Buffer const *, Paragraph * par,
                         Paragraph::size_type pos, LyXFont const & font);
        void setCharFont(BufferView *, Paragraph * par,
@@ -174,10 +179,10 @@ public:
    
        /** Completes the insertion with a full rebreak.
            Returns true if something was broken. */
-        bool fullRebreak(BufferView *);
+       bool fullRebreak(BufferView *);
 
        ///
-       Row * need_break_row;
+       mutable Row * need_break_row;
        ///
        mutable int refresh_y;
        ///
@@ -234,9 +239,9 @@ public:
          Since the LyXText now has been moved from Buffer to BufferView
          it should not be absolutely needed to move the cursor...
          */
-       mutable LyXCursor cursor;
+       mutable LyXCursor cursor; // actual cursor position
 
-       /** The structrue that keeps track of the selections set. */
+       /** The structure that keeps track of the selections set. */
        struct Selection {
                Selection() 
                        : set_(false), mark_(false)
@@ -253,9 +258,10 @@ public:
                void mark(bool m) {
                        mark_ = m;
                }
-               LyXCursor cursor;
-               LyXCursor start;
-               LyXCursor end;
+               LyXCursor cursor; // temporary cursor to hold a cursor position
+                                 // until setSelection is called!
+               LyXCursor start;  // start of a REAL selection
+               LyXCursor end;    // end of a REAL selection
        private:
                bool set_; // former selection
                bool mark_; // former mark_set
@@ -263,19 +269,19 @@ public:
        };
        mutable Selection selection;
 
-       /// needed for the toggling
-       LyXCursor last_sel_cursor;
-       ///
-       LyXCursor toggle_cursor;
-       ///
-       LyXCursor toggle_end_cursor;
+       /// needed for the toggling (cursor position on last selection made)
+       mutable LyXCursor last_sel_cursor; 
+       /// needed for toggling the selection in screen.C
+       mutable LyXCursor toggle_cursor;
+       /// needed for toggling the selection in screen.C
+       mutable LyXCursor toggle_end_cursor;
    
        /// need the selection cursor:
        void setSelection(BufferView *);
        ///
        void clearSelection() const;
        ///
-       string const selectionAsString(Buffer const *) const;
+       string const selectionAsString(Buffer const *, bool label) const;
        
        /// select the word we need depending on word_location
        void getWord(LyXCursor & from, LyXCursor & to, 
@@ -290,7 +296,7 @@ public:
         to the beginning of this word. 
         With SelectSelectedWord can this be highlighted really
         */ 
-       string const selectNextWord(BufferView *, float & value) const;
+       string const selectNextWordToSpellcheck(BufferView *, float & value) const;
        ///
        void selectSelectedWord(BufferView *);
        ///
@@ -393,7 +399,7 @@ public:
        /// 
        void toggleInset(BufferView *);
        ///
-       void cutSelection(BufferView *, bool = true);
+       void cutSelection(BufferView *, bool doclear = true, bool realcut = true);
        ///
        void copySelection(BufferView *);
        ///
@@ -414,6 +420,7 @@ public:
                          bool pagebreak_top, bool pagebreak_bottom,
                          VSpace const & space_top,
                          VSpace const & space_bottom,
+                         Spacing const & spacing,
                          LyXAlignment align, 
                          string labelwidthstring,
                          bool noindent);
@@ -537,6 +544,12 @@ private:
                            float & fill_label_hfill,
                            bool bidi = true) const;
 
+       // fix the cursor `cur' after a characters has been deleted at `where'
+       // position. Called by deleteEmptyParagraphMechanism
+       void fixCursorAfterDelete(BufferView * bview,
+                                 LyXCursor & cur,
+                                 LyXCursor const & where) const;
+       
        ///
        void deleteEmptyParagraphMechanism(BufferView *,
                                           LyXCursor const & old_cursor) const;