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