1 /* echo-area.h -- Functions used in reading information from the echo area.
2
3 Copyright 1993-2023 Free Software Foundation, Inc.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 Originally written by Brian Fox. */
19
20 #ifndef INFO_ECHO_AREA_H
21 #define INFO_ECHO_AREA_H
22
23 #define EA_MAX_INPUT 256
24
25 extern int echo_area_is_active, info_aborted_echo_area;
26
27 /* Non-zero means that the last command executed while reading input
28 killed some text. */
29 extern int echo_area_last_command_was_kill;
30
31 extern REFERENCE **echo_area_completion_items;
32
33 void inform_in_echo_area (const char *message);
34 void echo_area_inform_of_deleted_window (WINDOW *window);
35 void echo_area_prep_read (void);
36
37 typedef int (*reference_bool_fn) (REFERENCE *);
38
39 char *info_read_completing_internal (const char *prompt,
40 REFERENCE **completions, int force, reference_bool_fn exclude);
41
42 /* Read a line of text in the echo area. Return a malloc ()'ed string,
43 or NULL if the user aborted out of this read. PROMPT, if
44 non-null, is a prompt to print before reading the line. */
45 char *info_read_in_echo_area (const char *prompt);
46
47 /* Read a line in the echo area with completion over COMPLETIONS. */
48 char *info_read_completing_in_echo_area (const char *prompt,
49 REFERENCE **completions);
50
51 /* Read a line in the echo area allowing completion over COMPLETIONS, but
52 not requiring it. */
53 char *info_read_maybe_completing (const char *prompt, REFERENCE **completions);
54
55 /* Read a line in the echo area with completion over COMPLETIONS, using
56 EXCLUDE to exclude items from the completion list. */
57 char *
58 info_read_completing_in_echo_area_with_exclusions (const char *prompt,
59 REFERENCE **completions, reference_bool_fn exclude);
60
61 void ea_insert (WINDOW *window, int count, int key);
62 void ea_quoted_insert (WINDOW *window, int count);
63 void ea_beg_of_line (WINDOW *window, int count);
64 void ea_backward (WINDOW *window, int count);
65 void ea_delete (WINDOW *window, int count);
66 void ea_end_of_line (WINDOW *window, int count);
67 void ea_forward (WINDOW *window, int count);
68 void ea_abort (WINDOW *window, int count);
69 void ea_rubout (WINDOW *window, int count);
70 void ea_complete (WINDOW *window, int count);
71 void ea_newline (WINDOW *window, int count);
72 void ea_kill_line (WINDOW *window, int count);
73 void ea_backward_kill_line (WINDOW *window, int count);
74 void ea_transpose_chars (WINDOW *window, int count);
75 void ea_yank (WINDOW *window, int count);
76 void ea_tab_insert (WINDOW *window, int count);
77 void ea_possible_completions (WINDOW *window, int count);
78 void ea_backward_word (WINDOW *window, int count);
79 void ea_kill_word (WINDOW *window, int count);
80 void ea_forward_word (WINDOW *window, int count);
81 void ea_yank_pop (WINDOW *window, int count);
82 void ea_backward_kill_word (WINDOW *window, int count);
83 void ea_scroll_completions_window (WINDOW *window, int count);
84
85 #endif /* not INFO_ECHO_AREA_H */