]> git.lyx.org Git - lyx.git/blobdiff - src/undo_funcs.h
ws changes only
[lyx.git] / src / undo_funcs.h
index 6838abe9d4115cb910a49e9c801be82ce8b8260e..f34005dca6360d0af54212319a5c35472f929959 100644 (file)
@@ -1,61 +1,62 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
+/**
+ * \file undo_funcs.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Asger Alstrup
+ * \author Lars Gullik Bjønnes
+ * \author John Levon
+ * \author André Pönitz
+ * \author Jürgen Vigna
  *
- *           Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS.
+ */
 
 #ifndef UNDO_FUNCS_H
 #define UNDO_FUNCS_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
-
 #include "undo.h"
+#include "ParagraphList_fwd.h"
 
 class BufferView;
 class Paragraph;
-class LyXCursor;
-
-/// returns false if no undo possible
-extern bool textUndo(BufferView *);
-/// returns false if no redo possible
-extern bool textRedo(BufferView *);
-/// used by TextUndo/TextRedo
-extern bool textHandleUndo(BufferView *, Undo * undo);
-/// makes sure the next operation will be stored
-extern void finishUndo();
-/// this is dangerous and for internal use only
-extern void freezeUndo();
-/// this is dangerous and for internal use only
-extern void unFreezeUndo();
-///
-extern void setUndo(BufferView *, Undo::undo_kind kind,
-                   Paragraph const * first, Paragraph const * behind);
-///
-extern void setRedo(BufferView *, Undo::undo_kind kind,
-                   Paragraph const * first, Paragraph const * behind);
-///
-extern Undo * createUndo(BufferView *, Undo::undo_kind kind,
-                        Paragraph const * first, Paragraph const * behind);
-/// for external use in lyx_cb.C
-extern void setCursorParUndo(BufferView *);
-
-// returns a pointer to the very first Paragraph depending of where we are
-// so it will return the first paragraph of the buffer or the first paragraph
-// of the textinset we're in.
-extern Paragraph * firstUndoParagraph(BufferView *, int inset_arg);
-
-///
-extern LyXCursor const & undoCursor(BufferView * bv);
-
-/// the flag used by FinishUndo();
-extern bool undo_finished;
-/// a flag
+
+/// 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
+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;
 
-#endif
+#endif // UNDO_FUNCS_H