| 1 | // ==================================================================== // |
|---|
| 2 | // // |
|---|
| 3 | // File : awt_input_mask.hxx // |
|---|
| 4 | // Purpose : General input masks // |
|---|
| 5 | // // |
|---|
| 6 | // // |
|---|
| 7 | // Coded by Ralf Westram (coder@reallysoft.de) in August 2001 // |
|---|
| 8 | // Copyright Department of Microbiology (Technical University Munich) // |
|---|
| 9 | // // |
|---|
| 10 | // Visit our web site at: http://www.arb-home.de/ // |
|---|
| 11 | // // |
|---|
| 12 | // // |
|---|
| 13 | // ==================================================================== // |
|---|
| 14 | |
|---|
| 15 | #ifndef AWT_INPUT_MASK_HXX |
|---|
| 16 | #define AWT_INPUT_MASK_HXX |
|---|
| 17 | |
|---|
| 18 | #ifndef _GLIBCXX_STRING |
|---|
| 19 | #include <string> |
|---|
| 20 | #endif |
|---|
| 21 | #ifndef AW_BASE_HXX |
|---|
| 22 | #include <aw_base.hxx> |
|---|
| 23 | #endif |
|---|
| 24 | #ifndef CB_H |
|---|
| 25 | #include <cb.h> |
|---|
| 26 | #endif |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | enum awt_item_type { |
|---|
| 30 | AWT_IT_UNKNOWN, |
|---|
| 31 | AWT_IT_SPECIES, |
|---|
| 32 | AWT_IT_ORGANISM, |
|---|
| 33 | AWT_IT_GENE, |
|---|
| 34 | AWT_IT_EXPERIMENT, |
|---|
| 35 | |
|---|
| 36 | AWT_IT_TYPES |
|---|
| 37 | }; |
|---|
| 38 | |
|---|
| 39 | // ------------------------------------- |
|---|
| 40 | // class awt_item_type_selector |
|---|
| 41 | // ------------------------------------- |
|---|
| 42 | // awt_item_type_selector is an interface for specific item-types |
|---|
| 43 | // |
|---|
| 44 | // derive from awt_item_type_selector to get the functionality for |
|---|
| 45 | // other item types. |
|---|
| 46 | // |
|---|
| 47 | // (implemented for Species in nt_item_type_species_selector (see NTREE/NT_extern.cxx) ) |
|---|
| 48 | // |
|---|
| 49 | |
|---|
| 50 | class awt_item_type_selector { |
|---|
| 51 | private: |
|---|
| 52 | awt_item_type my_type; |
|---|
| 53 | public: |
|---|
| 54 | awt_item_type_selector(awt_item_type for_type) : my_type(for_type) {} |
|---|
| 55 | virtual ~awt_item_type_selector() {} |
|---|
| 56 | |
|---|
| 57 | awt_item_type get_item_type() const { return my_type; } |
|---|
| 58 | |
|---|
| 59 | // add/remove callbacks to awars (i.e. to AWAR_SPECIES_NAME) |
|---|
| 60 | void add_awar_callbacks(AW_root *root, const RootCallback& cb) const; |
|---|
| 61 | void remove_awar_callbacks(AW_root *root, const RootCallback& cb) const; |
|---|
| 62 | |
|---|
| 63 | // returns the current item |
|---|
| 64 | virtual GBDATA *current(AW_root *root, GBDATA *gb_main) const = 0; |
|---|
| 65 | |
|---|
| 66 | // returns the keypath for items |
|---|
| 67 | virtual const char *getKeyPath() const = 0; |
|---|
| 68 | |
|---|
| 69 | // returns the name of an awar containing the name of the current item |
|---|
| 70 | virtual const char *get_self_awar() const = 0; |
|---|
| 71 | |
|---|
| 72 | // returns the maximum length of the name of the current item |
|---|
| 73 | virtual size_t get_self_awar_content_length() const = 0; |
|---|
| 74 | }; |
|---|
| 75 | |
|---|
| 76 | typedef void (*AWT_OpenMaskWindowCallback)(AW_window* aww, int id, GBDATA *gb_main); |
|---|
| 77 | |
|---|
| 78 | awt_item_type AWT_getItemType(const std::string& itemtype_name); |
|---|
| 79 | void AWT_create_mask_submenu(class AW_window_menu_modes *awm, awt_item_type wanted_item_type, AWT_OpenMaskWindowCallback open_mask_window_cb, GBDATA *gb_main); |
|---|
| 80 | void AWT_destroy_input_masks(); |
|---|
| 81 | |
|---|
| 82 | #else |
|---|
| 83 | #error AWT_input_mask.hxx included twice |
|---|
| 84 | #endif // AWT_INPUT_MASK_HXX |
|---|
| 85 | |
|---|