]> git.lyx.org Git - lyx.git/blob - src/undo_funcs.h
fixes to compile and link gtk
[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 #include "support/types.h"
22
23 class BufferView;
24 class Paragraph;
25
26 /// This will undo the last action - returns false if no undo possible
27 bool textUndo(BufferView *);
28
29 /// This will redo the last undo - returns false if no redo possible
30 bool textRedo(BufferView *);
31
32 /// Makes sure the next operation will be stored
33 void finishUndo();
34
35 /**
36  * Whilst undo is frozen, all actions do not get added
37  * to the undo stack
38  */
39 void freezeUndo();
40
41 /// Track undos again
42 void unFreezeUndo();
43
44 /**
45  * Record undo information - call with the first paragraph that will be changed
46  * and the last paragraph that will be changed. So we give an inclusive
47  * range.
48  * This is called before you make the changes to the paragraph, and it
49  * will record the original information of the paragraphs in the undo stack.
50  */
51 void recordUndo(BufferView *, Undo::undo_kind kind,
52         ParagraphList & plist, lyx::paroffset_type first, lyx::paroffset_type last);
53
54 /// Convienience: Prepare undo when change in a single paragraph.
55 void recordUndo(BufferView *, Undo::undo_kind kind,
56         ParagraphList & plist, lyx::paroffset_type par);
57
58 /// Convienience: Prepare undo for the paragraph that contains the cursor
59 void recordUndo(BufferView *, Undo::undo_kind kind);
60
61 /// Are we avoiding tracking undos currently ?
62 extern bool undo_frozen;
63
64 #endif // UNDO_FUNCS_H