#include "dociterator.h"
#include "ParagraphList_fwd.h"
+#include "bufferparams.h"
#include "support/types.h"
#include <string>
-class LCursor;
+class BufferParams;
class BufferView;
+class LCursor;
/**
structure ('Undo') _before_ it is changed in some edit operation.
Obviously, the stored ranged should be as small as possible. However, it
there is a lower limit: The StableDocIterator pointing stored in the undo
-struct must be valid after the changes, too, as it will used as a pointer
+class must be valid after the changes, too, as it will used as a pointer
where to insert the stored bits when performining undo.
*/
-struct Undo {
+class Undo {
+public:
/// This is used to combine consecutive undo recordings of the same kind.
enum undo_kind {
/**
ParagraphList pars;
/// the stringified contents of the saved MathArray (for mathed)
std::string array;
+ /// Only used in case of full backups
+ BufferParams bparams;
+ /// Only used in case of full backups
+ bool isFullBuffer;
};
/// Convenience: prepare undo for the selected paragraphs
void recordUndoSelection(LCursor & cur, Undo::undo_kind kind = Undo::ATOMIC);
-/// Convenience: prepare undo for the single paragraph containing the cursor
-void recordUndoFullDocument(LCursor & cur);
+/// Convenience: prepare undo for the whole buffer
+void recordUndoFullDocument(BufferView * bv);
#endif // UNDO_FUNCS_H