| 1 | // =========================================================== // |
|---|
| 2 | // // |
|---|
| 3 | // File : awtlocal.hxx // |
|---|
| 4 | // Purpose : // |
|---|
| 5 | // // |
|---|
| 6 | // Institute of Microbiology (Technical University Munich) // |
|---|
| 7 | // http://www.arb-home.de/ // |
|---|
| 8 | // // |
|---|
| 9 | // =========================================================== // |
|---|
| 10 | |
|---|
| 11 | #ifndef AWTLOCAL_HXX |
|---|
| 12 | #define AWTLOCAL_HXX |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | struct adawcbstruct { |
|---|
| 16 | // @@@ FIXME: rethink design - maybe split into base class + |
|---|
| 17 | // several derived classes for the different usages. |
|---|
| 18 | |
|---|
| 19 | AW_window *aws; |
|---|
| 20 | AW_root *awr; |
|---|
| 21 | GBDATA *gb_main; |
|---|
| 22 | GBDATA *gb_user; |
|---|
| 23 | GBDATA *gb_edit; |
|---|
| 24 | AW_selection_list *id; |
|---|
| 25 | char *comm; |
|---|
| 26 | char *def_name; |
|---|
| 27 | char *def_gbd; |
|---|
| 28 | char *def_alignment; |
|---|
| 29 | char *def_source; |
|---|
| 30 | char *def_dest; |
|---|
| 31 | char *def_filter; |
|---|
| 32 | char *previous_filename; |
|---|
| 33 | char *pwd; |
|---|
| 34 | char *pwdx; // additional directories |
|---|
| 35 | bool show_dir; |
|---|
| 36 | bool leave_wildcards; |
|---|
| 37 | char may_be_an_error; |
|---|
| 38 | char show_only_marked; |
|---|
| 39 | char scannermode; |
|---|
| 40 | char *def_dir; |
|---|
| 41 | const ad_item_selector *selector; |
|---|
| 42 | bool add_pseudo_fields; // true -> add pseudo-fields (used by 'awt_create_selection_list_on_scandb_cb') |
|---|
| 43 | bool include_hidden_fields; // true -> show hidden fields in selection list |
|---|
| 44 | }; |
|---|
| 45 | |
|---|
| 46 | struct awt_sel_list_for_tables { |
|---|
| 47 | AW_window *aws; |
|---|
| 48 | GBDATA *gb_main; |
|---|
| 49 | AW_selection_list *id; |
|---|
| 50 | const char *table_name; |
|---|
| 51 | }; |
|---|
| 52 | |
|---|
| 53 | struct awt_sel_list_for_sai { |
|---|
| 54 | AW_window *aws; |
|---|
| 55 | GBDATA *gb_main; |
|---|
| 56 | AW_selection_list *id; |
|---|
| 57 | char *(*filter_poc)(GBDATA *gb_ext, AW_CL); |
|---|
| 58 | AW_CL filter_cd; |
|---|
| 59 | bool add_selected_species; |
|---|
| 60 | }; |
|---|
| 61 | |
|---|
| 62 | typedef enum { |
|---|
| 63 | AWT_QUERY_GENERATE, |
|---|
| 64 | AWT_QUERY_ENLARGE, |
|---|
| 65 | AWT_QUERY_REDUCE |
|---|
| 66 | } AWT_QUERY_MODES; |
|---|
| 67 | |
|---|
| 68 | typedef enum { |
|---|
| 69 | AWT_QUERY_MARKED, |
|---|
| 70 | AWT_QUERY_MATCH, |
|---|
| 71 | AWT_QUERY_DONT_MATCH |
|---|
| 72 | } AWT_QUERY_TYPES; |
|---|
| 73 | |
|---|
| 74 | #define AWT_QUERY_SEARCHES 3 // no of search-lines in search tool |
|---|
| 75 | |
|---|
| 76 | struct adaqbsstruct { |
|---|
| 77 | AW_window *aws; |
|---|
| 78 | GBDATA *gb_main; // the main database (in merge tool: source db in left query; dest db in right query) |
|---|
| 79 | GBDATA *gb_ref; // second reference database (only used by merge tool; dest db in left query; source db in right query) |
|---|
| 80 | bool expect_hit_in_ref_list; // merge-tool: when searching dups in fields: match only if hit exists in other DBs hitlist (true for DBII-query) |
|---|
| 81 | AWAR species_name; |
|---|
| 82 | const char *tree_name; |
|---|
| 83 | AWAR awar_keys[AWT_QUERY_SEARCHES]; |
|---|
| 84 | AWAR awar_setkey; |
|---|
| 85 | AWAR awar_setprotection; |
|---|
| 86 | AWAR awar_setvalue; |
|---|
| 87 | AWAR awar_parskey; |
|---|
| 88 | AWAR awar_parsvalue; |
|---|
| 89 | AWAR awar_parspredefined; |
|---|
| 90 | AWAR awar_queries[AWT_QUERY_SEARCHES]; |
|---|
| 91 | AWAR awar_not[AWT_QUERY_SEARCHES]; // not flags for queries |
|---|
| 92 | AWAR awar_operator[AWT_QUERY_SEARCHES]; // not flags for queries |
|---|
| 93 | AWAR awar_ere; |
|---|
| 94 | AWAR awar_where; |
|---|
| 95 | AWAR awar_by; |
|---|
| 96 | AWAR awar_use_tag; |
|---|
| 97 | AWAR awar_double_pars; |
|---|
| 98 | AWAR awar_deftag; |
|---|
| 99 | AWAR awar_tag; |
|---|
| 100 | AWAR awar_count; |
|---|
| 101 | AWAR awar_sort; |
|---|
| 102 | unsigned long sort_mask; // contains several cascading sort criteria (AWT_QUERY_SORT_CRITERIA_BITS each) |
|---|
| 103 | AW_selection_list *result_id; |
|---|
| 104 | int select_bit; // one of 1 2 4 8 .. 128 (one for each query box) |
|---|
| 105 | |
|---|
| 106 | const ad_item_selector *selector; |
|---|
| 107 | |
|---|
| 108 | GB_HASH *hit_description; // key = char* (hit item name), value = char* (description of hit - allocated!) |
|---|
| 109 | }; |
|---|
| 110 | |
|---|
| 111 | #define AWAR_TABLE_FIELD_REORDER_SOURCE_TEMPLATE "tmp/table/%s/field/reorder_source" |
|---|
| 112 | #define AWAR_TABLE_FIELD_REORDER_DEST_TEMPLATE "tmp/table/%s/field/reorder_dest" |
|---|
| 113 | #define AWAR_TABLE_FIELD_NEW_NAME_TEMPLATE "tmp/table/%s/new_name" |
|---|
| 114 | #define AWAR_TABLE_FIELD_REM_TEMPLATE "tmp/table/%s/rem" |
|---|
| 115 | #define AWAR_TABLE_FIELD_NEW_TYPE_TEMPLATE "tmp/table/%s/new_type" |
|---|
| 116 | #define AWAR_TABLE_SELECTED_FIELD_TEMPLATE "tmp/table/%s/selected_field" |
|---|
| 117 | |
|---|
| 118 | struct awt_table { |
|---|
| 119 | GBDATA *gb_main; |
|---|
| 120 | char *table_name; |
|---|
| 121 | char *awar_field_reorder_source; |
|---|
| 122 | char *awar_field_reorder_dest; |
|---|
| 123 | char *awar_field_new_name; |
|---|
| 124 | char *awar_field_new_type; |
|---|
| 125 | char *awar_field_rem; |
|---|
| 126 | char *awar_selected_field; |
|---|
| 127 | awt_table(GBDATA *gb_main,AW_root *awr,const char *table_name); |
|---|
| 128 | ~awt_table(); |
|---|
| 129 | }; |
|---|
| 130 | |
|---|
| 131 | #define AWAR_TABLE_NAME "tmp/ad_table/table_name" |
|---|
| 132 | #define AWAR_TABLE_DEST "tmp/ad_table/table_dest" |
|---|
| 133 | #define AWAR_TABLE_REM "tmp/ad_table/table_rem" |
|---|
| 134 | #define AWAR_TABLE_EXPORT "tmp/ad_table/export_table" |
|---|
| 135 | #define AWAR_TABLE_IMPORT "tmp/ad_table/import_table" |
|---|
| 136 | |
|---|
| 137 | #define PSEUDO_FIELD_ANY_FIELD "[any field]" |
|---|
| 138 | #define PSEUDO_FIELD_ALL_FIELDS "[all fields]" |
|---|
| 139 | |
|---|
| 140 | long awt_query_update_list(void *dummy, struct adaqbsstruct *cbs); |
|---|
| 141 | |
|---|
| 142 | |
|---|
| 143 | #else |
|---|
| 144 | #error awtlocal.hxx included twice |
|---|
| 145 | #endif // AWTLOCAL_HXX |
|---|