14 #ifndef T3_WIDGET_EDITWINDOW_H
15 #define T3_WIDGET_EDITWINDOW_H
21 #include <t3widget/widgets/widget.h>
22 #include <t3widget/widgets/scrollbar.h>
23 #include <t3widget/widgets/listpane.h>
24 #include <t3widget/textbuffer.h>
25 #include <t3widget/key.h>
26 #include <t3widget/interfaces.h>
27 #include <t3widget/autocompleter.h>
35 class replace_buttons_dialog_t;
40 class T3_WIDGET_LOCAL autocomplete_panel_t;
43 static sigc::connection goto_connection;
45 static sigc::connection global_find_dialog_connection;
48 static sigc::connection replace_buttons_connection;
49 static sigc::connection init_connected;
51 struct T3_WIDGET_LOCAL implementation_t {
52 cleanup_t3_window_ptr edit_window,
54 cleanup_ptr<scrollbar_t>::t scrollbar;
64 wrap_type_t wrap_type;
74 bool indent_aware_home;
77 cleanup_ptr<autocompleter_t>::t autocompleter;
78 cleanup_ptr<autocomplete_panel_t>::t autocomplete_panel;
83 implementation_t(
void) : tab_spaces(
false), find_dialog(NULL), finder(NULL),
84 wrap_type(wrap_type_t::NONE), wrap_info(NULL), ins_mode(0), last_set_pos(0),
85 auto_indent(
true), indent_aware_home(
true), show_tabs(
false), autocompleter(NULL),
86 autocomplete_panel(NULL), repaint_min(0), repaint_max(INT_MAX)
89 pimpl_ptr<implementation_t>::t impl;
92 static void init(
bool _init);
94 static const char *ins_string[];
99 void repaint_screen(
void);
103 void next_word(
void);
107 void previous_word(
void);
121 void reset_selection(
void);
123 void set_selection_mode(
key_t key);
125 void delete_selection(
void);
128 void find_activated(find_action_t action,
finder_t *finder);
130 void set_wrap_internal(wrap_type_t wrap);
132 void scroll(
int lines);
134 void scrollbar_dragged(
int start);
135 void autocomplete_activated(
void);
146 virtual void draw_info_window(
void);
154 void activate_autocomplete(
bool autocomplete_single);
159 void ensure_cursor_on_screen(
void);
164 void update_repaint_lines(
int start,
int end);
174 virtual bool process_key(
key_t key);
176 virtual void update_contents(
void);
177 virtual void set_focus(focus_t focus);
178 virtual void force_redraw(
void);
179 virtual void bad_draw_recheck(
void);
202 void cut_copy(
bool cut);
208 void select_all(
void);
210 void insert_special(
void);
212 void indent_selection(
void);
214 void unindent_selection(
void);
216 void goto_line(
int line);
219 void goto_line(
void);
221 void find_replace(
bool replace);
225 void find_next(
bool backward);
239 void set_tabsize(
int _tabsize);
241 void set_wrap(wrap_type_t wrap);
243 void set_tab_spaces(
bool _tab_spaces);
245 void set_auto_indent(
bool _auto_indent);
247 void set_indent_aware_home(
bool _indent_aware_home);
249 void set_show_tabs(
bool _show_tabs);
252 int get_tabsize(
void);
254 wrap_type_t get_wrap(
void);
256 bool get_tab_spaces(
void);
258 bool get_auto_indent(
void);
260 bool get_indent_aware_home(
void);
262 bool get_show_tabs(
void);
272 void autocomplete(
void);
280 wrap_type_t wrap_type;
283 int ins_mode, last_set_pos;
285 bool indent_aware_home;
293 void set_tabsize(
int _tabsize);
294 void set_wrap(wrap_type_t _wrap_type);
295 void set_tab_spaces(
bool _tab_spaces);
296 void set_auto_indent(
bool _auto_indent);
297 void set_indent_aware_home(
bool _indent_aware_home);
298 void set_show_tabs(
bool _show_tabs);
306 virtual bool process_key(
key_t key);
311 size_t get_selected_idx(
void)
const;
312 void connect_activate(
const sigc::slot<void> &slot);