1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
1999-09-27 18:44:28 +00:00
|
|
|
* LyX, The Document Processor
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
1999-11-15 12:01:38 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
2001-05-30 13:53:44 +00:00
|
|
|
* Copyright 1995-2001 The LyX Team.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-11-15 12:01:38 +00:00
|
|
|
* ====================================================== */
|
|
|
|
|
|
|
|
#ifndef UNDO_H
|
|
|
|
#define UNDO_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-05-02 13:11:39 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
class Paragraph;
|
2000-03-28 02:18:55 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
class Undo {
|
|
|
|
public:
|
|
|
|
/// The undo kinds
|
|
|
|
enum undo_kind {
|
|
|
|
///
|
|
|
|
INSERT,
|
|
|
|
///
|
|
|
|
DELETE,
|
|
|
|
///
|
|
|
|
EDIT,
|
|
|
|
///
|
|
|
|
FINISH
|
|
|
|
};
|
|
|
|
///
|
|
|
|
undo_kind kind;
|
|
|
|
///
|
|
|
|
int number_of_before_par;
|
|
|
|
///
|
|
|
|
int number_of_behind_par;
|
|
|
|
///
|
|
|
|
int number_of_cursor_par;
|
|
|
|
///
|
2001-07-06 15:57:54 +00:00
|
|
|
int number_of_inset_id; // valid if >= 0, if < 0 then not in inset
|
|
|
|
///
|
1999-09-27 18:44:28 +00:00
|
|
|
int cursor_pos; // valid if >= 0
|
|
|
|
///
|
2003-05-02 13:11:39 +00:00
|
|
|
std::vector<Paragraph *> pars;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-06 15:57:54 +00:00
|
|
|
Undo(undo_kind kind_arg, int id_inset_arg,
|
1999-09-27 18:44:28 +00:00
|
|
|
int number_before_arg, int number_behind_arg,
|
|
|
|
int cursor_par_arg, int cursor_pos_arg,
|
2003-05-02 13:11:39 +00:00
|
|
|
std::vector<Paragraph *> const & par_arg);
|
2000-01-06 02:44:26 +00:00
|
|
|
///
|
|
|
|
~Undo();
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|