Add missing file
[gcalctool.git] / src / unit-category.h
bloba97d4efbc9b9ea67c530d465483b928c9fedc2e3
1 #ifndef UNIT_CATEGORY_H
2 #define UNIT_CATEGORY_H
4 #include <glib-object.h>
5 #include "unit.h"
6 #include "mp.h"
8 G_BEGIN_DECLS
10 #define UNIT_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), unit_category_get_type(), UnitCategory))
12 typedef struct UnitCategoryPrivate UnitCategoryPrivate;
14 typedef struct
16 GObject parent_instance;
17 UnitCategoryPrivate *priv;
18 } UnitCategory;
20 typedef struct
22 GObjectClass parent_class;
23 } UnitCategoryClass;
25 GType unit_category_get_type(void);
27 UnitCategory *unit_category_new(const gchar *name, const gchar *display_name);
29 const gchar *unit_category_get_name(UnitCategory *category);
31 const gchar *unit_category_get_display_name(UnitCategory *category);
33 Unit *unit_category_get_unit_by_name(UnitCategory *category, const gchar *name);
35 Unit *unit_category_get_unit_by_symbol(UnitCategory *category, const gchar *symbol);
37 void unit_category_add_unit(UnitCategory *category, Unit *unit);
39 const GList *unit_category_get_units(UnitCategory *category);
41 gboolean unit_category_convert(UnitCategory *category, const MPNumber *x, Unit *x_units, Unit *z_units, MPNumber *z);
43 G_END_DECLS
45 #endif /* UNIT_CATEGORY_H */