| 1 | // ========================================================= // |
|---|
| 2 | // // |
|---|
| 3 | // File : selection_admin.h // |
|---|
| 4 | // Purpose : species selection admin // |
|---|
| 5 | // // |
|---|
| 6 | // Coded by Ralf Westram (coder@reallysoft.de) in Feb 26 // |
|---|
| 7 | // http://www.arb-home.de/ // |
|---|
| 8 | // // |
|---|
| 9 | // ========================================================= // |
|---|
| 10 | |
|---|
| 11 | #ifndef SELECTION_ADMIN_H |
|---|
| 12 | #define SELECTION_ADMIN_H |
|---|
| 13 | |
|---|
| 14 | #ifndef AW_BASE_HXX |
|---|
| 15 | #include <aw_base.hxx> |
|---|
| 16 | #endif |
|---|
| 17 | #ifndef ARB_ASSERT_H |
|---|
| 18 | #include <arb_assert.h> |
|---|
| 19 | #endif |
|---|
| 20 | #ifndef CB_BASE_H |
|---|
| 21 | #include <cb_base.h> |
|---|
| 22 | #endif |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | struct SelectionAdmin { |
|---|
| 26 | virtual ~SelectionAdmin() {} |
|---|
| 27 | |
|---|
| 28 | virtual const char *get_macro_suffix() const = 0; |
|---|
| 29 | virtual GBDATA *get_gb_main() const = 0; |
|---|
| 30 | |
|---|
| 31 | virtual const char *get_selection_awarname() const = 0; |
|---|
| 32 | virtual const char *get_selectionComment_awarname() const = 0; |
|---|
| 33 | |
|---|
| 34 | virtual const char *get_name_of_tree() const = 0; |
|---|
| 35 | virtual class TreeNode *get_tree_root() const = 0; |
|---|
| 36 | |
|---|
| 37 | virtual const char *get_toparea_SAIs() const = 0; |
|---|
| 38 | |
|---|
| 39 | virtual void speciesSelection_renamed_cb(const char *old_name, const char *new_name) const = 0; |
|---|
| 40 | virtual void speciesSelection_deleted_cb(const char *name) const = 0; |
|---|
| 41 | }; |
|---|
| 42 | |
|---|
| 43 | enum SelectionCreation { |
|---|
| 44 | BY_CALLING_THE_EDITOR, |
|---|
| 45 | FROM_IMPORTER, |
|---|
| 46 | FROM_MANAGER, |
|---|
| 47 | }; |
|---|
| 48 | |
|---|
| 49 | enum SelectionExtractType { |
|---|
| 50 | SELECTION_EXTRACT, // unmark all + mark selection |
|---|
| 51 | SELECTION_MARK, // mark selection (= logical OR) |
|---|
| 52 | SELECTION_UNMARK, // unmark selection |
|---|
| 53 | SELECTION_INVERT, // invert selection (= logical XOR) |
|---|
| 54 | SELECTION_COMBINE // logical AND (i.e. unmark all that are not member from selection) |
|---|
| 55 | }; |
|---|
| 56 | |
|---|
| 57 | GB_ERROR create_species_selection(const SelectionAdmin& selection, const char *conf_name, int use_species_aside, SelectionCreation creation); |
|---|
| 58 | void extract_species_selection(GBDATA *gb_main, const char *selectionName, SelectionExtractType ext_type); |
|---|
| 59 | AW_window *create_species_selection_window(AW_root *root, const SelectionAdmin *selection); |
|---|
| 60 | |
|---|
| 61 | #else |
|---|
| 62 | #error selection_admin.h included twice |
|---|
| 63 | #endif // SELECTION_ADMIN_H |
|---|