]> git.lyx.org Git - lyx.git/blobdiff - src/undo_funcs.h
More 'standard conformant blurb' nonsense.
[lyx.git] / src / undo_funcs.h
index 4db09bd79602304cfc5a7a8a911ac38951c5c2dc..11b4d51809a0a2594c1974e7bb05a0fd77512440 100644 (file)
 #define UNDO_FUNCS_H
 
 #include "undo.h"
+#include "ParagraphList.h"
 
 class BufferView;
 class Paragraph;
 
-/// returns false if no undo possible
-extern bool textUndo(BufferView *);
-/// returns false if no redo possible
-extern bool textRedo(BufferView *);
-/// makes sure the next operation will be stored
-extern void finishUndo();
-/// Whilst undo is frozen, all actions do not get added
-/// to the undo stack
-extern void freezeUndo();
+/// This will undo the last action - returns false if no undo possible
+bool textUndo(BufferView *);
+
+/// This will redo the last undo - returns false if no redo possible
+bool textRedo(BufferView *);
+
+/// Makes sure the next operation will be stored
+void finishUndo();
+
+/**
+ * Whilst undo is frozen, all actions do not get added
+ * to the undo stack
+ */
+void freezeUndo();
+
 /// Track undos again
-extern void unFreezeUndo();
-/// FIXME
-extern void setUndo(BufferView *, Undo::undo_kind kind,
-                   Paragraph const * first, Paragraph const * behind);
-/// FIXME
-extern void setRedo(BufferView *, Undo::undo_kind kind,
-                   Paragraph const * first, Paragraph const * behind);
-/// FIXME
-extern void setCursorParUndo(BufferView *);
+void unFreezeUndo();
+
+/**
+ * Record undo information - call with the first paragraph that will be changed
+ * and the last paragraph that will be changed. So we give an inclusive
+ * range.
+ * This is called before you make the changes to the paragraph, and it
+ * will record the original information of the paragraphs in the undo stack.
+ */
+void recordUndo(BufferView *, Undo::undo_kind kind,
+                   ParagraphList::iterator first, ParagraphList::iterator last);
+/// Convienience: Prepare undo when change in a single paragraph.
+void recordUndo(BufferView *, Undo::undo_kind kind,
+                   ParagraphList::iterator first);
+
+/// Convienience: Prepare undo for the paragraph that contains the cursor
+void recordUndo(BufferView *, Undo::undo_kind kind);
 
 /// Are we avoiding tracking undos currently ?
 extern bool undo_frozen;