]> git.deb.at Git - pkg/abook.git/blobdiff - list.h
Upload 0.6.1-2 to unstable
[pkg/abook.git] / list.h
diff --git a/list.h b/list.h
index 2b81cda6af49c1cd3897533a2f8378332c0a7d0b..35befc5aa632f219662872e6743caf3c68935b12 100644 (file)
--- a/list.h
+++ b/list.h
@@ -3,25 +3,55 @@
 
 #include "ui.h"
 
+#define INDEX_TEXT  1
+#define INDEX_FIELD 2
+#define INDEX_ALT_FIELD 3
+
+struct index_elem {
+       int type;
+       union {
+               char *text;
+               struct {
+                       int id;
+                       int len;
+                       struct index_elem *next;
+               } field;
+       } d;
+       struct index_elem *next;
+};
+
+struct list_field {
+       char *data;
+       int type;
+};
+
+void           init_index();
 void           init_list();
+int            init_extra_field(enum str_opts option);
 void           close_list();
 void            refresh_list();
-void           print_list_line(int i, int line);
+void   get_list_field(int item, struct index_elem *e, struct list_field *res);
 void           list_headerline();
 void            scroll_up();
 void            scroll_down();
+void            scroll_list_up();
+void            scroll_list_down();
 void           page_up();
 void           page_down();
 void            select_none();
 void            select_all();
+void           set_selection(int item, int value);
+void           list_invert_curitem_selection();
 void            move_curitem(int direction);
 void           goto_home();
 void           goto_end();
-void           highlight_line(WINDOW *win, int line);
 int            selected_items();
 void           invert_selection();
-int            list_current_item();
 int            list_is_empty();
+int            list_get_curitem();
+int            list_get_firstitem();
+void           list_set_curitem(int i);
+int            duplicate_item();
 
 
 enum {
@@ -30,19 +60,11 @@ enum {
 };
 
 #define LIST_TOP        3
-#define LIST_BOTTOM     (LINES-3)
+#define LIST_BOTTOM     (LINES - 2)
 
-#define LIST_LINES     (LIST_BOTTOM-LIST_TOP)
+#define LIST_LINES     (LIST_BOTTOM - LIST_TOP)
 #define LIST_COLS      COLS
 
-#define NAMEPOS                2
-#define EMAILPOS        options_get_int("emailpos")
-#define EXTRAPOS       options_get_int("extrapos")
-
-#define NAMELEN                (EMAILPOS-NAMEPOS -1)
-#define EMAILLEN        (EXTRAPOS-EMAILPOS -1)
-#define EXTRALEN       (COLS-EXTRAPOS)
-
-#define LAST_LIST_ITEM ( first_list_item + LIST_LINES - 1 )
+#define LAST_LIST_ITEM (first_list_item + LIST_LINES - 1)
 
 #endif