| 1 | // ==================================================================== // |
|---|
| 2 | // // |
|---|
| 3 | // File : awt_sel_boxes.hxx // |
|---|
| 4 | // Purpose : // |
|---|
| 5 | // // |
|---|
| 6 | // // |
|---|
| 7 | // Coded by Ralf Westram (coder@reallysoft.de) in May 2005 // |
|---|
| 8 | // Copyright Department of Microbiology (Technical University Munich) // |
|---|
| 9 | // // |
|---|
| 10 | // Visit our web site at: http://www.arb-home.de/ // |
|---|
| 11 | // // |
|---|
| 12 | // ==================================================================== // |
|---|
| 13 | #ifndef AWT_SEL_BOXES_HXX |
|---|
| 14 | #define AWT_SEL_BOXES_HXX |
|---|
| 15 | |
|---|
| 16 | #ifndef ARBDB_BASE_H |
|---|
| 17 | #include <arbdb_base.h> |
|---|
| 18 | #endif |
|---|
| 19 | #ifndef AW_BASE_HXX |
|---|
| 20 | #include <aw_base.hxx> |
|---|
| 21 | #endif |
|---|
| 22 | #ifndef ARBTOOLS_H |
|---|
| 23 | #include <arbtools.h> |
|---|
| 24 | #endif |
|---|
| 25 | |
|---|
| 26 | class AP_filter; |
|---|
| 27 | struct adfiltercbstruct; |
|---|
| 28 | |
|---|
| 29 | typedef char *(*awt_sai_sellist_filter)(GBDATA *, AW_CL); |
|---|
| 30 | class AWT_sai_selection; |
|---|
| 31 | |
|---|
| 32 | class SAI_selection_list_spec : virtual Noncopyable { |
|---|
| 33 | char *awar_name; |
|---|
| 34 | GBDATA *gb_main; |
|---|
| 35 | |
|---|
| 36 | awt_sai_sellist_filter filter_poc; |
|---|
| 37 | AW_CL filter_cd; |
|---|
| 38 | |
|---|
| 39 | public: |
|---|
| 40 | SAI_selection_list_spec(const char *awar_name_, GBDATA *gb_main_) |
|---|
| 41 | : awar_name(strdup(awar_name_)), |
|---|
| 42 | gb_main(gb_main_), |
|---|
| 43 | filter_poc(NULL), |
|---|
| 44 | filter_cd(0) |
|---|
| 45 | {} |
|---|
| 46 | ~SAI_selection_list_spec() { free(awar_name); } |
|---|
| 47 | |
|---|
| 48 | void define_filter(awt_sai_sellist_filter filter_poc_, AW_CL filter_cd_) { |
|---|
| 49 | // Warning: do not use different filters for same awar! (wont work as expected) |
|---|
| 50 | filter_poc = filter_poc_; |
|---|
| 51 | filter_cd = filter_cd_; |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | const char *get_awar_name() const { return awar_name; } |
|---|
| 55 | |
|---|
| 56 | AWT_sai_selection *create_list(AW_window *aws) const; |
|---|
| 57 | }; |
|---|
| 58 | |
|---|
| 59 | // ----------------------------------------- |
|---|
| 60 | // various database selection boxes |
|---|
| 61 | |
|---|
| 62 | class AW_DB_selection; |
|---|
| 63 | |
|---|
| 64 | AW_DB_selection *awt_create_selection_list_on_alignments(GBDATA *gb_main, AW_window *aws, const char *varname, const char *ali_type_match); |
|---|
| 65 | void awt_reconfigure_selection_list_on_alignments(AW_DB_selection *alisel, const char *ali_type_match); |
|---|
| 66 | |
|---|
| 67 | AW_DB_selection *awt_create_selection_list_on_trees(GBDATA *gb_main, AW_window *aws, const char *varname); |
|---|
| 68 | |
|---|
| 69 | void awt_create_selection_list_on_pt_servers(AW_window *aws, const char *varname, bool popup); |
|---|
| 70 | void awt_edit_arbtcpdat_cb(AW_window *aww, AW_CL cl_gb_main); |
|---|
| 71 | |
|---|
| 72 | void awt_create_selection_list_on_tables(GBDATA *gb_main, AW_window *aws, const char *varname); |
|---|
| 73 | void awt_create_selection_list_on_table_fields(GBDATA *gb_main, AW_window *aws, const char *tablename, const char *varname); |
|---|
| 74 | AW_window *AWT_create_tables_admin_window(AW_root *aw_root, GBDATA *gb_main); |
|---|
| 75 | |
|---|
| 76 | AWT_sai_selection *awt_create_selection_list_on_sai(GBDATA *gb_main, AW_window *aws, const char *varname, awt_sai_sellist_filter filter_poc = 0, AW_CL filter_cd = 0); |
|---|
| 77 | void awt_selection_list_on_sai_update_cb(GBDATA *dummy, AWT_sai_selection *cbsid); |
|---|
| 78 | void awt_popup_sai_selection_list(AW_root *aw_root, AW_CL cl_awar_name, AW_CL cl_gb_main); |
|---|
| 79 | void awt_popup_sai_selection_list(AW_window *aww, AW_CL cl_awar_name, AW_CL cl_gb_main); |
|---|
| 80 | void awt_popup_filtered_sai_selection_list(AW_root *aw_root, AW_CL cl_sai_sellist_spec); |
|---|
| 81 | void awt_popup_filtered_sai_selection_list(AW_window *aww, AW_CL cl_sai_sellist_spec); |
|---|
| 82 | void awt_create_SAI_selection_button(GBDATA *gb_main, AW_window *aws, const char *varname, awt_sai_sellist_filter filter_poc = 0, AW_CL filter_cd = 0); |
|---|
| 83 | |
|---|
| 84 | void awt_create_selection_list_on_configurations(GBDATA *gb_main, AW_window *aws, const char *varname); |
|---|
| 85 | char *awt_create_string_on_configurations(GBDATA *gb_main); |
|---|
| 86 | |
|---|
| 87 | AW_window *awt_create_load_box(AW_root *aw_root, const char *load_what, const char *file_extension, char **set_file_name_awar, |
|---|
| 88 | void (*callback)(AW_window*), AW_window* (*create_popup)(AW_root *, AW_default)); |
|---|
| 89 | |
|---|
| 90 | // ------------------------------- |
|---|
| 91 | |
|---|
| 92 | class AW_selection; |
|---|
| 93 | class AW_selection_list; |
|---|
| 94 | class ConstStrArray; |
|---|
| 95 | |
|---|
| 96 | AW_selection *awt_create_subset_selection_list(AW_window *aww, AW_selection_list *select_subset_from, const char *at_box, const char *at_add, const char *at_sort); |
|---|
| 97 | |
|---|
| 98 | // ------------------------------- |
|---|
| 99 | |
|---|
| 100 | AW_window *create_save_box_for_selection_lists(AW_root *aw_root, AW_CL selid); |
|---|
| 101 | AW_window *create_load_box_for_selection_lists(AW_root *aw_root, AW_CL selid); |
|---|
| 102 | void create_print_box_for_selection_lists(AW_window *aw_window, AW_CL selid); |
|---|
| 103 | |
|---|
| 104 | #else |
|---|
| 105 | #error awt_sel_boxes.hxx included twice |
|---|
| 106 | #endif // AWT_SEL_BOXES_HXX |
|---|