// -*- 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
class BufferView;
class Paragraph;
-/// returns false if no undo possible
+/// This will undo the last action - returns false if no undo possible
bool textUndo(BufferView *);
-/// returns false if no redo possible
+
+/// This will redo the last undo - returns false if no redo possible
bool textRedo(BufferView *);
-/// makes sure the next operation will be stored
+
+/// Makes sure the next operation will be stored
void finishUndo();
-/// Whilst undo is frozen, all actions do not get added
-/// to the undo stack
+
+/**
+ * Whilst undo is frozen, all actions do not get added
+ * to the undo stack
+ */
void freezeUndo();
+
/// Track undos again
void unFreezeUndo();
-/// FIXME
-void setUndo(BufferView *, Undo::undo_kind kind,
+
+/**
+ * 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);
-void setUndo(BufferView *, Undo::undo_kind kind,
+/// Convienience: Prepare undo when change in a single paragraph.
+void recordUndo(BufferView *, Undo::undo_kind kind,
ParagraphList::iterator first);
-// set undo for containing paragraph
-void setUndo(BufferView *, Undo::undo_kind kind);
-/// FIXME
-void setCursorParUndo(BufferView *);
+
+/// 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;