]> git.deb.at Git - pkg/abook.git/blob - list.h
Upload 0.6.1-2 to unstable
[pkg/abook.git] / list.h
1 #ifndef _LIST_H
2 #define _LIST_H
3
4 #include "ui.h"
5
6 #define INDEX_TEXT  1
7 #define INDEX_FIELD 2
8 #define INDEX_ALT_FIELD 3
9
10 struct index_elem {
11         int type;
12         union {
13                 char *text;
14                 struct {
15                         int id;
16                         int len;
17                         struct index_elem *next;
18                 } field;
19         } d;
20         struct index_elem *next;
21 };
22
23 struct list_field {
24         char *data;
25         int type;
26 };
27
28 void            init_index();
29 void            init_list();
30 int             init_extra_field(enum str_opts option);
31 void            close_list();
32 void            refresh_list();
33 void    get_list_field(int item, struct index_elem *e, struct list_field *res);
34 void            list_headerline();
35 void            scroll_up();
36 void            scroll_down();
37 void            scroll_list_up();
38 void            scroll_list_down();
39 void            page_up();
40 void            page_down();
41 void            select_none();
42 void            select_all();
43 void            set_selection(int item, int value);
44 void            list_invert_curitem_selection();
45 void            move_curitem(int direction);
46 void            goto_home();
47 void            goto_end();
48 int             selected_items();
49 void            invert_selection();
50 int             list_is_empty();
51 int             list_get_curitem();
52 int             list_get_firstitem();
53 void            list_set_curitem(int i);
54 int             duplicate_item();
55
56
57 enum {
58         MOVE_ITEM_UP,
59         MOVE_ITEM_DOWN
60 };
61
62 #define LIST_TOP        3
63 #define LIST_BOTTOM     (LINES - 2)
64
65 #define LIST_LINES      (LIST_BOTTOM - LIST_TOP)
66 #define LIST_COLS       COLS
67
68 #define LAST_LIST_ITEM  (first_list_item + LIST_LINES - 1)
69
70 #endif