]> git.deb.at Git - pkg/abook.git/blob - ui.h
3faed77be1fb47bc11d8a92424987a5add7210b6
[pkg/abook.git] / ui.h
1 #ifndef _UI_H
2 #define _UI_H
3
4 #include "abook_curses.h"
5
6 enum {
7         HELP_MAIN,
8         HELP_EDITOR
9 };
10
11 int             is_ui_initialized();
12 void            ui_init_curses();
13 void            ui_init_color_pairs_user();
14 void            ui_enable_mouse(bool enabled);
15 int             init_ui();
16 void            close_ui();
17 void            headerline(const char *str);
18 void            refresh_screen();
19 int             statusline_msg(const char *msg);
20 int             statusline_askchoice(const char *msg, const char *choices,
21                         short dflt);
22 char            *ask_filename(const char *prompt);
23 int             statusline_ask_boolean(const char *msg, int def);
24 void            clear_statusline();
25 void            display_help(int help);
26 void            statusline_addstr(const char *str);
27 char *          ui_readline(const char *prompt, char *s, size_t limit,
28                         bool use_completion);
29 void            refresh_statusline();
30 void            get_commands();
31 void            ui_remove_items();
32 void            ui_merge_items();
33 void            ui_clear_database();
34 void            ui_find(int next);
35 void            ui_print_number_of_items();
36 void            ui_read_database();
37 char            *get_surname(char *s);
38 void            ui_print_database();
39 void            ui_open_datafile();
40
41 #if NCURSES_MOUSE_VERSION != 2
42 #define BUTTON5_PRESSED (0x80 | 0x8000000)
43 #endif
44
45 #include "options.h" /* needed for options_get_bool */
46
47 #define UI_HLINE_CHAR           opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
48                                         '-' : ACS_HLINE
49 #define UI_VLINE_CHAR           opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
50                                         '|' : ACS_VLINE
51 #define UI_TEE_CHAR             opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
52                                         '-' : ACS_BTEE
53 #define UI_LBOXLINE_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
54                                         '/' : ACS_HLINE
55 #define UI_RBOXLINE_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
56                                         '\\' : ACS_HLINE
57 #define UI_ULCORNER_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
58                                         ' ' : ACS_ULCORNER
59 #define UI_URCORNER_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
60                                         ' ' : ACS_URCORNER
61 #define UI_LLCORNER_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
62                                         '+' : ACS_LLCORNER
63 #define UI_LRCORNER_CHAR        opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
64                                         '+' : ACS_LRCORNER
65
66 #endif