]> git.deb.at Git - pkg/abook.git/blob - list.h
- don't use items variable outside of database.c
[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            set_selection(int item, int value);
19 void            list_invert_curitem_selection();
20 void            move_curitem(int direction);
21 void            goto_home();
22 void            goto_end();
23 void            highlight_line(WINDOW *win, int line);
24 int             selected_items();
25 void            invert_selection();
26 int             list_is_empty();
27 int             list_get_curitem();
28 void            list_set_curitem(int i);
29 int             duplicate_item();
30
31
32 enum {
33         MOVE_ITEM_UP,
34         MOVE_ITEM_DOWN
35 };
36
37 #define LIST_TOP        3
38 #define LIST_BOTTOM     (LINES-2)
39
40 #define LIST_LINES      (LIST_BOTTOM-LIST_TOP)
41 #define LIST_COLS       COLS
42
43 #define NAMEPOS         2
44 #define EMAILPOS        opt_get_int(INT_EMAILPOS)
45 #define EXTRAPOS        opt_get_int(INT_EXTRAPOS)
46
47 #define NAMELEN         (EMAILPOS - NAMEPOS - 1)
48 #define EMAILLEN        (EXTRAPOS - EMAILPOS - 1)
49 #define EXTRALEN        (COLS - EXTRAPOS)
50
51 #define LAST_LIST_ITEM  (first_list_item + LIST_LINES - 1)
52
53 #endif