source: tags/arb_5.0/AWT/awt_input_mask.hxx

Last change on this file was 6031, checked in by westram, 15 years ago
  • separated internal and external input-mask-interface
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1//  ==================================================================== //
2//                                                                       //
3//    File      : AWT_input_mask.h                                       //
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 _CPP_STRING
19#include <string>
20#endif
21#ifndef AWT_HXX
22#include <awt.hxx>
23#endif
24
25
26typedef enum {
27    AWT_IT_UNKNOWN,
28    AWT_IT_SPECIES,
29    AWT_IT_ORGANISM,
30    AWT_IT_GENE,
31    AWT_IT_EXPERIMENT,
32
33    AWT_IT_TYPES
34} awt_item_type;
35
36//  -------------------------------------
37//      class awt_item_type_selector
38//  -------------------------------------
39// awt_item_type_selector is an interface for specific item-types
40//
41// derive from awt_item_type_selector to get the functionality for
42// other item types.
43//
44// (implemented for Species in nt_item_type_species_selector (see NTREE/NT_extern.cxx) )
45//
46
47class awt_item_type_selector {
48private:
49    awt_item_type my_type;
50public:
51    awt_item_type_selector(awt_item_type for_type) : my_type(for_type) {}
52    virtual ~awt_item_type_selector() {}
53
54    awt_item_type get_item_type() const { return my_type; }
55
56    // add/remove callbacks to awars (i.e. to AWAR_SPECIES_NAME)
57    virtual void add_awar_callbacks(AW_root *root, void (*f)(AW_root*, AW_CL), AW_CL cl_mask) const = 0;
58    virtual void remove_awar_callbacks(AW_root *root, void (*f)(AW_root*, AW_CL), AW_CL cl_mask) const = 0;
59
60    // returns the current item
61    virtual GBDATA *current(AW_root *root) const = 0;
62
63    // returns the keypath for items
64    virtual const char *getKeyPath() const = 0;
65
66    // returns the name of an awar containing the name of the current item
67    virtual const char *get_self_awar() const = 0;
68
69    // returns the maximum length of the name of the current item
70    virtual size_t get_self_awar_content_length() const = 0;
71};
72
73
74
75awt_item_type AWT_getItemType(const std::string& itemtype_name);
76void          AWT_create_mask_submenu(AW_window_menu_modes *awm, awt_item_type wanted_item_type, void (*open_window_cb)(AW_window* aww, AW_CL cl_id, AW_CL));
77void          AWT_destroy_input_masks();
78
79#else
80#error AWT_input_mask.hxx included twice
81#endif // AWT_INPUT_MASK_HXX
82
Note: See TracBrowser for help on using the repository browser.