14 #ifndef T3_WIDGET_UNDO_H
15 #define T3_WIDGET_UNDO_H
18 #include <t3widget/textline.h>
19 #include <t3widget/util.h>
23 #define TEXT_START_SIZE 32
35 UNDO_BACKSPACE_NEWLINE,
39 UNDO_ADD_NEWLINE_INDENT,
46 UNDO_REPLACE_BLOCK_REDO,
48 UNDO_ADD_NEWLINE_INDENT_REDO,
49 UNDO_BLOCK_START_REDO,
55 undo_t *head, *tail, *current, *mark;
57 bool mark_beyond_current;
60 undo_list_t(
void) : head(NULL), tail(NULL), current(NULL), mark(NULL), mark_is_valid(
true), mark_beyond_current(
false) {}
66 bool is_at_mark(
void)
const;
75 static undo_type_t redo_map[];
86 undo_type_t get_type(
void)
const;
87 undo_type_t get_redo_type(
void)
const;
89 virtual void add_newline(
void) {}
90 virtual std::string *get_text(
void);
91 virtual std::string *get_replacement(
void);
93 virtual void minimize(
void) {}
103 virtual void add_newline(
void);
104 virtual std::string *get_text(
void);
105 virtual void minimize(
void);
120 std::string replacement;
126 virtual std::string *get_replacement(
void);
127 virtual void minimize(
void);