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
43 UNDO_BACKSPACE_NEWLINE,
47 UNDO_ADD_NEWLINE_INDENT,
56 UNDO_REPLACE_BLOCK_REDO,
58 UNDO_ADD_NEWLINE_INDENT_REDO,
59 UNDO_BLOCK_START_REDO,
67 undo_t *head, *tail, *current, *mark;
69 bool mark_beyond_current;
72 undo_list_t(
void) : head(NULL), tail(NULL), current(NULL), mark(NULL), mark_is_valid(
true), mark_beyond_current(
false) {}
78 bool is_at_mark(
void)
const;
87 static undo_type_t redo_map[];
98 undo_type_t get_type(
void)
const;
99 undo_type_t get_redo_type(
void)
const;
101 virtual void add_newline(
void) {}
102 virtual std::string *get_text(
void);
103 virtual std::string *get_replacement(
void);
105 virtual void minimize(
void) {}
115 virtual void add_newline(
void);
116 virtual std::string *get_text(
void);
117 virtual void minimize(
void);
132 std::string replacement;
138 virtual std::string *get_replacement(
void);
139 virtual void minimize(
void);