]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.h
Remove all uses of Q_WS_* macros
[lyx.git] / src / Cursor.h
index 35d2fc97680dcfc9989c50a29f18f3ed13a9c2c5..f5490479851b8322f7b095d0bf4ae6ce0c3d152b 100644 (file)
@@ -118,7 +118,7 @@ public:
        ///
        void setWordSelection(bool set) { word_selection_ = set; }
        ///
-       bool wordSelection() { return word_selection_; }
+       bool wordSelection() const { return word_selection_; }
        /// did we place the anchor?
        bool mark() const { return mark_; }
        /// did we place the anchor?
@@ -131,10 +131,10 @@ public:
        void clearSelection();
        /// check whether selection contains specific type of inset
        /// returns 0 if no selection was made
-       bool insetInSelection(InsetCode const & inset);
+       bool insetInSelection(InsetCode const & inset) const;
        /// count occurences of specific inset type in the selection
        /// returns 0 if no selection was made
-       int countInsetsInSelection(InsetCode const & inset);
+       int countInsetsInSelection(InsetCode const & inset) const;
 
        /// access to normalized selection anchor
        CursorSlice normalAnchor() const;
@@ -154,7 +154,8 @@ public:
        DocIterator selectionEnd() const;
 
        ///
-       docstring selectionAsString(bool with_label) const;
+       docstring selectionAsString(bool const with_label,
+                                   bool const skipdelete = false) const;
        /// get some interesting description of top position
        void info(odocstream & os, bool devel_mode) const;
        ///
@@ -189,7 +190,7 @@ public:
        /// containing the cursor
        void recordUndo(UndoKind kind = ATOMIC_UNDO) const;
        /// Convenience: prepare undo for the inset containing the cursor
-       void recordUndoInset(Inset const * inset = 0) const;
+       void recordUndoInset(Inset const * inset = nullptr) const;
        /// Convenience: prepare undo for the whole buffer
        void recordUndoFullBuffer() const;
        /// Convenience: prepare undo for buffer parameters
@@ -206,7 +207,7 @@ public:
        DocIterator newWord() const { return new_word_; }
 
        /// are we in math mode (2), text mode (1) or unsure (0)?
-       int currentMode();
+       int currentMode() const;
 
        /// Return true if the next or previous inset has confirmDeletion depending
        /// on the boolean before. If there is a selection, return true if at least
@@ -269,17 +270,23 @@ public:
        void setCursorData(CursorData const & data);
 
        /// returns true if we made a decision
-       bool getStatus(FuncRequest const & cmd, FuncStatus & flag) const;
+       bool getStatus(FuncRequest const & cmd, FuncStatus & status) const;
        /// dispatch from innermost inset upwards
        void dispatch(FuncRequest const & cmd);
        /// display a message
        void message(docstring const & msg) const;
        /// display an error message
        void errorMessage(docstring const & msg) const;
-       /// get the resut of the last dispatch
+       /// get the result of the last dispatch
        DispatchResult const & result() const;
 
-       ///
+       /// Set the cursor language from current input method language
+       /* Considers first exact math with the codes used in the document,
+        * then approximate match among the same list, and finally exact
+        * or partial match with the whole list of languages.
+        */
+       void setLanguageFromInput();
+       /// Set the current font of the cursor from its location.
        void setCurrentFont();
 
        /**