2
* Copyright (C) 1987-2008 Sun Microsystems, Inc. All Rights Reserved.
3
* Copyright (C) 2008-2011 Robert Ancell.
5
* This program is free software: you can redistribute it and/or modify it under
6
* the terms of the GNU General Public License as published by the Free Software
7
* Foundation, either version 2 of the License, or (at your option) any later
8
* version. See http://www.gnu.org/copyleft/gpl.html the full text of the
12
#ifndef UNIT_CATEGORY_H
13
#define UNIT_CATEGORY_H
15
#include <glib-object.h>
21
#define UNIT_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), unit_category_get_type(), UnitCategory))
23
typedef struct UnitCategoryPrivate UnitCategoryPrivate;
27
GObject parent_instance;
28
UnitCategoryPrivate *priv;
33
GObjectClass parent_class;
36
GType unit_category_get_type(void);
38
UnitCategory *unit_category_new(const gchar *name, const gchar *display_name);
40
const gchar *unit_category_get_name(UnitCategory *category);
42
const gchar *unit_category_get_display_name(UnitCategory *category);
44
Unit *unit_category_get_unit_by_name(UnitCategory *category, const gchar *name);
46
Unit *unit_category_get_unit_by_symbol(UnitCategory *category, const gchar *symbol);
48
void unit_category_add_unit(UnitCategory *category, Unit *unit);
50
const GList *unit_category_get_units(UnitCategory *category);
52
gboolean unit_category_convert(UnitCategory *category, const MPNumber *x, Unit *x_units, Unit *z_units, MPNumber *z);
56
#endif /* UNIT_CATEGORY_H */