]> git.deb.at Git - pkg/abook.git/blob - list.h
Support for dynamic views.
[pkg/abook.git] / list.h
1 #ifndef _LIST_H
2 #define _LIST_H
3
4 #include "ui.h"
5
6 void            init_list();
7 int             init_extra_field(enum str_opts option);
8 void            close_list();
9 void            refresh_list();
10 void            print_list_line(int i, int line, int highlight);
11 void            list_headerline();
12 void            scroll_up();
13 void            scroll_down();
14 void            page_up();
15 void            page_down();
16 void            select_none();
17 void            select_all();
18 void            move_curitem(int direction);
19 void            goto_home();
20 void            goto_end();
21 void            highlight_line(WINDOW *win, int line);
22 int             selected_items();
23 void            invert_selection();
24 int             list_current_item();
25 int             list_is_empty();
26 int             duplicate_item();
27
28
29 enum {
30         MOVE_ITEM_UP,
31         MOVE_ITEM_DOWN
32 };
33
34 #define LIST_TOP        3
35 #define LIST_BOTTOM     (LINES-2)
36
37 #define LIST_LINES      (LIST_BOTTOM-LIST_TOP)
38 #define LIST_COLS       COLS
39
40 #define NAMEPOS         2
41 #define EMAILPOS        opt_get_int(INT_EMAILPOS)
42 #define EXTRAPOS        opt_get_int(INT_EXTRAPOS)
43
44 #define NAMELEN         (EMAILPOS - NAMEPOS - 1)
45 #define EMAILLEN        (EXTRAPOS - EMAILPOS - 1)
46 #define EXTRALEN        (COLS - EXTRAPOS)
47
48 #define LAST_LIST_ITEM  ( first_list_item + LIST_LINES - 1 )
49
50 #endif