]> git.lyx.org Git - lyx.git/blob - src/undo_funcs.h
Remove the inset and view member functions from PreviewedInset.
[lyx.git] / src / undo_funcs.h
1 // -*- C++ -*-
2 /**
3  * \file undo_funcs.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Asger Alstrup
8  * \author Lars Gullik Bjønnes
9  * \author John Levon
10  * \author André Pönitz
11  * \author Jürgen Vigna
12  *
13  * Full author contact details are available in file CREDITS.
14  */
15
16 #ifndef UNDO_FUNCS_H
17 #define UNDO_FUNCS_H
18
19 #include "undo.h"
20 #include "ParagraphList_fwd.h"
21
22 class BufferView;
23 class Paragraph;
24
25 /// This will undo the last action - returns false if no undo possible
26 bool textUndo(BufferView *);
27
28 /// This will redo the last undo - returns false if no redo possible
29 bool textRedo(BufferView *);
30
31 /// Makes sure the next operation will be stored
32 void finishUndo();
33
34 /**
35  * Whilst undo is frozen, all actions do not get added
36  * to the undo stack
37  */
38 void freezeUndo();
39
40 /// Track undos again
41 void unFreezeUndo();
42
43 /**
44  * Record undo information - call with the first paragraph that will be changed
45  * and the last paragraph that will be changed. So we give an inclusive
46  * range.
47  * This is called before you make the changes to the paragraph, and it
48  * will record the original information of the paragraphs in the undo stack.
49  */
50 void recordUndo(BufferView *, Undo::undo_kind kind,
51                     ParagraphList::iterator first, ParagraphList::iterator last);
52 /// Convienience: Prepare undo when change in a single paragraph.
53 void recordUndo(BufferView *, Undo::undo_kind kind,
54                     ParagraphList::iterator first);
55
56 /// Convienience: Prepare undo for the paragraph that contains the cursor
57 void recordUndo(BufferView *, Undo::undo_kind kind);
58
59 /// Are we avoiding tracking undos currently ?
60 extern bool undo_frozen;
61
62 #endif // UNDO_FUNCS_H