1 /* Fo 2 * fo-enum.h: Enum datatype 3 * 4 * Copyright (C) 2001-2004 Sun Microsystems 5 * Copyright (C) 2007-2010 Menteith Consulting Ltd 6 * 7 * See COPYING for the status of this software. 8 */ 9 10 #ifndef __FO_ENUM_H__ 11 #define __FO_ENUM_H__ 12 13 #include <libfo/fo-utils.h> 14 #include <libfo/datatype/fo-datatype.h> 15 #include <libfo/datatype/fo-enum-factory.h> 16 17 G_BEGIN_DECLS 18 19 #define FO_TYPE_ENUM (fo_enum_get_type ()) 20 #define FO_ENUM(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), FO_TYPE_ENUM, FoEnum)) 21 #define FO_ENUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FO_TYPE_ENUM, FoEnumClass)) 22 #define FO_IS_ENUM(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), FO_TYPE_ENUM)) 23 #define FO_IS_ENUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FO_TYPE_ENUM)) 24 #define FO_ENUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FO_TYPE_ENUM, FoEnumClass)) 25 26 27 /** 28 * FoEnum: 29 * 30 * Instance of the 'enum' datatype. 31 **/ 32 typedef struct _FoEnum FoEnum; 33 34 /** 35 * FoEnumClass: 36 * 37 * Class structure for the 'enum' datatype. 38 **/ 39 typedef struct _FoEnumClass FoEnumClass; 40 41 GType fo_enum_get_type (void) G_GNUC_CONST; 42 43 GEnumClass * fo_enum_get_enum_class (FoDatatype *fo_enum); 44 FoEnumEnum fo_enum_get_value (FoDatatype *fo_enum); 45 const gchar* fo_enum_get_nick (FoDatatype *fo_enum); 46 47 G_END_DECLS 48 49 #endif /* !__FO_ENUM_H__ */ 50