]> git.deb.at Git - pkg/abook.git/blob - list.h
Fetch real Portuguese debconf translation
[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            page_up();
38 void            page_down();
39 void            select_none();
40 void            select_all();
41 void            set_selection(int item, int value);
42 void            list_invert_curitem_selection();
43 void            move_curitem(int direction);
44 void            goto_home();
45 void            goto_end();
46 int             selected_items();
47 void            invert_selection();
48 int             list_is_empty();
49 int             list_get_curitem();
50 void            list_set_curitem(int i);
51 int             duplicate_item();
52
53
54 enum {
55         MOVE_ITEM_UP,
56         MOVE_ITEM_DOWN
57 };
58
59 #define LIST_TOP        3
60 #define LIST_BOTTOM     (LINES - 2)
61
62 #define LIST_LINES      (LIST_BOTTOM - LIST_TOP)
63 #define LIST_COLS       COLS
64
65 #define LAST_LIST_ITEM  (first_list_item + LIST_LINES - 1)
66
67 #endif