]> git.lyx.org Git - lyx.git/blob - src/undo_funcs.h
More 'standard conformant blurb' nonsense.
[lyx.git] / src / undo_funcs.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 1995-2001 The LyX Team.
8  *
9  * ====================================================== */
10
11 #ifndef UNDO_FUNCS_H
12 #define UNDO_FUNCS_H
13
14 #include "undo.h"
15 #include "ParagraphList.h"
16
17 class BufferView;
18 class Paragraph;
19
20 /// This will undo the last action - returns false if no undo possible
21 bool textUndo(BufferView *);
22
23 /// This will redo the last undo - returns false if no redo possible
24 bool textRedo(BufferView *);
25
26 /// Makes sure the next operation will be stored
27 void finishUndo();
28
29 /**
30  * Whilst undo is frozen, all actions do not get added
31  * to the undo stack
32  */
33 void freezeUndo();
34
35 /// Track undos again
36 void unFreezeUndo();
37
38 /**
39  * Record undo information - call with the first paragraph that will be changed
40  * and the last paragraph that will be changed. So we give an inclusive
41  * range.
42  * This is called before you make the changes to the paragraph, and it
43  * will record the original information of the paragraphs in the undo stack.
44  */
45 void recordUndo(BufferView *, Undo::undo_kind kind,
46                     ParagraphList::iterator first, ParagraphList::iterator last);
47 /// Convienience: Prepare undo when change in a single paragraph.
48 void recordUndo(BufferView *, Undo::undo_kind kind,
49                     ParagraphList::iterator first);
50
51 /// Convienience: Prepare undo for the paragraph that contains the cursor
52 void recordUndo(BufferView *, Undo::undo_kind kind);
53
54 /// Are we avoiding tracking undos currently ?
55 extern bool undo_frozen;
56
57 #endif // UNDO_FUNCS_H