]> git.lyx.org Git - lyx.git/blobdiff - src/undo.h
move some selection related stuff over to textcursor.C
[lyx.git] / src / undo.h
index d1c468848de3821da7cf5ac73690ae7f4a7d2cb2..57fad5f1d1e80bbeba3650ff46449326c917e557 100644 (file)
@@ -1,25 +1,18 @@
 // -*- C++ -*-
 /* This file is part of
  * ======================================================
- * 
+ *
  *           LyX, The Document Processor
- *      
+ *
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
 #ifndef UNDO_H
 #define UNDO_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <list>
-
-#include "lyxparagraph.h"
-
+#include "ParagraphList.h"
 
 ///
 class Undo {
@@ -38,51 +31,27 @@ public:
        ///
        undo_kind kind;
        ///
-       int number_of_before_par;
+       int inset_id; // valid if >= 0, if < 0 then not in inset
        ///
-       int number_of_behind_par;
+       int plist_id;
        ///
-       int number_of_cursor_par;
+       int first_par_offset;
        ///
-       int cursor_pos; // valid if >= 0
+       int last_par_offset;
        ///
-       LyXParagraph * par;
+       int cursor_par_offset;
        ///
-       Undo(undo_kind kind_arg,
-            int number_before_arg, int number_behind_arg,
-            int cursor_par_arg, int cursor_pos_arg,
-            LyXParagraph * par_arg);
+       int cursor_pos; // valid if >= 0
        ///
-       ~Undo();
-};
+       ParagraphList pars;
 
-
-/// A limited Stack for the undo informations.
-class UndoStack{
-private:
-       ///
-       typedef std::list<Undo*> Stakk;
        ///
-       Stakk stakk;
-       /// the maximum number of undo steps stored.
-       Stakk::size_type limit;
-public:
-       ///
-       UndoStack();
-       ///
-       Undo * pop();
-       ///
-       Undo * top();
-       ///
-       bool empty() const;
-       ///
-       ~UndoStack();
-       ///
-       void clear();
-       ///
-       void SetStackLimit(Stakk::size_type l);
-       ///
-       void push(Undo * undo_arg);
+       Undo(undo_kind kind, int inset_id, int plist_id,
+            int first, int last,
+            int cursor, int cursor_pos,
+            ParagraphList const & par_arg);
+
 };
 
+
 #endif