]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.h
This patch introduces ProvidesModule and ExcludesModule layout tags.
[lyx.git] / src / Cursor.h
index c5277927c84c0264686a4672f8b193937177d50f..9b1b1b681d0d443e5e6100bbce8cee0464747b91 100644 (file)
@@ -17,6 +17,8 @@
 #include "Font.h"
 #include "Undo.h"
 
+#include "mathed/MathParser_flags.h"
+
 #include <vector>
 
 
@@ -37,7 +39,8 @@ class Encoding;
 
 // The public inheritance should go in favour of a suitable data member
 // (or maybe private inheritance) at some point of time.
-class Cursor : public DocIterator {
+class Cursor : public DocIterator
+{
 public:
        /// create the cursor of a BufferView
        explicit Cursor(BufferView & bv);
@@ -69,8 +72,8 @@ public:
        //
        /// selection active?
        bool selection() const { return selection_; }
-       /// selection active?
-       bool & selection() { return selection_; }
+       /// set selection;
+       void setSelection(bool sel) { selection_ = sel; }
        /// do we have a multicell selection?
        bool selIsMultiCell() const 
                { return selection_ && selBegin().idx() != selEnd().idx(); }
@@ -80,7 +83,7 @@ public:
        /// did we place the anchor?
        bool mark() const { return mark_; }
        /// did we place the anchor?
-       bool & mark() { return mark_; }
+       void setMark(bool mark) { mark_ = mark; }
        ///
        void setSelection();
        /// set selection at given position
@@ -95,7 +98,12 @@ public:
        DocIterator selectionBegin() const;
        /// access start of selection
        DocIterator selectionEnd() const;
-       /// FIXME: document this
+       /**
+        * Update the selection status and save permanent
+        * selection if needed.
+        * @param selecting the new selection status
+        * @return whether the selection status has changed
+        */
        bool selHandle(bool selecting);
        ///
        docstring selectionAsString(bool label) const;
@@ -242,6 +250,12 @@ public:
        /// makes sure the next operation will be stored
        void finishUndo() const;
 
+       /// open a new group of undo operations. Groups can be nested.
+       void beginUndoGroup() const;
+
+       /// end the current undo group
+       void endUndoGroup() const;
+
        /// The general case: prepare undo for an arbitrary range.
        void recordUndo(UndoKind kind, pit_type from, pit_type to) const;
 
@@ -359,7 +373,7 @@ public:
        ///
        void niceInsert(MathAtom const & at);
        ///
-       void niceInsert(docstring const & str);
+       void niceInsert(docstring const & str, Parse::flags f = Parse::NORMAL);
 
        /// in pixels from top of screen
        void setScreenPos(int x, int y);