ARB
SEC_toggle.hxx
Go to the documentation of this file.
1 // ================================================================= //
2 // //
3 // File : SEC_toggle.hxx //
4 // Purpose : Support for multiple structure //
5 // //
6 // Coded by Ralf Westram (coder@reallysoft.de) in September 2007 //
7 // Institute of Microbiology (Technical University Munich) //
8 // http://www.arb-home.de/ //
9 // //
10 // ================================================================= //
11 
12 #ifndef SEC_TOGGLE_HXX
13 #define SEC_TOGGLE_HXX
14 
15 #ifndef ARBDB_H
16 #include <arbdb.h>
17 #endif
18 
19 class SEC_graphic;
20 
22  GBDATA *gb_structures; // contains all structures
23  GBDATA *gb_current; // contains current structure
24  SEC_graphic *gfx; // needed to trigger refresh
25  GB_ERROR st_error;
26  int Count;
27 
28  int current();
29  GB_ERROR set_current(int idx) __ATTR__USERESULT;
30 
31  GBDATA *find(int num);
32  GBDATA *create(const char *name); // create new structure (storing current)
33 
34  GB_ERROR store(GBDATA *gb_struct);
35  GB_ERROR restore(GBDATA *gb_struct);
36 
37  GB_ERROR setName(GBDATA *gb_struct, const char *new_name);
38 
39 public:
40  SEC_structure_toggler(GBDATA *gb_main, const char *ali_name, SEC_graphic *Gfx); // might set error
41 
42  GB_ERROR get_error() const { return st_error; }
43 
44  GB_ERROR next();
45  GB_ERROR copyTo(const char *name);
46  GB_ERROR remove();
47 
48  const char *name();
49  GB_ERROR setName(const char *new_name);
50 
51  int getCount() const { return Count; }
52 };
53 
54 
55 #else
56 #error SEC_toggle.hxx included twice
57 #endif // SEC_TOGGLE_HXX
SEC_structure_toggler(GBDATA *gb_main, const char *ali_name, SEC_graphic *Gfx)
Definition: SEC_toggle.cxx:114
const char * GB_ERROR
Definition: arb_core.h:25
int getCount() const
Definition: SEC_toggle.hxx:51
GB_ERROR get_error() const
Definition: SEC_toggle.hxx:42
GB_ERROR copyTo(const char *name)
Definition: SEC_toggle.cxx:173
#define __ATTR__USERESULT
Definition: attributes.h:58
const char * name()
Definition: SEC_toggle.cxx:213
GBDATA * gb_main
Definition: adname.cxx:32