\end_document replaces \the_end.
[lyx.git] / src / undo.h
blobb9c8e3df990afcbfba20d61acbf28aaa5d2897d2
1 // -*- C++ -*-
2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
10 * ====================================================== */
12 #ifndef UNDO_H
13 #define UNDO_H
15 #include "ParagraphList.h"
17 /**
18 * These are the elements put on the undo stack. Each object
19 * contains complete paragraphs and sufficient information
20 * to restore the state. The work is done in undo_funcs.C
22 class Undo {
23 public:
24 /**
25 * The undo kinds are used to combine consecutive undo recordings
26 * of the same kind.
28 enum undo_kind {
29 /**
30 * Insert something - these will combine to one big chunk
31 * when many inserts come after each other.
33 INSERT,
35 /**
36 * Delete something - these will combine to one big chunk
37 * when many deletes come after each other.
39 DELETE,
41 /// Atomic - each of these will have its own entry in the stack
42 ATOMIC
44 ///
45 Undo(undo_kind kind, int inset_id,
46 int first, int last,
47 int cursor, int cursor_pos,
48 ParagraphList const & par_arg);
50 /// Which kind of operation are we recording for?
51 undo_kind kind;
53 /**
54 * ID of hosting inset if the cursor is in one.
55 * if -1, then the cursor is not in an inset.
56 * if >= 0, then the cursor is in inset with given id.
57 */
58 int inset_id;
60 /// Offset to the first paragraph in the main document paragraph list
61 int first_par_offset;
63 /// Offset to the last paragraph from the end of the main par. list
64 int last_par_offset;
66 /**
67 * Offset from the start of the main document paragraph list,
68 * except if inside an inset, in which case it's the offset
69 * inside the hosting inset.
71 int cursor_par_offset;
73 /// The position of the cursor in the hosting paragraph
74 int cursor_pos;
76 /// The contents of the paragraphs saved
77 ParagraphList pars;
81 #endif