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_MANAGER_H
13 #define UNIT_MANAGER_H
15 #include <glib-object.h>
16 #include "unit-category.h"
21 #define UNIT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), unit_manager_get_type(), UnitManager))
23 typedef struct UnitManagerPrivate UnitManagerPrivate
;
27 GObject parent_instance
;
28 UnitManagerPrivate
*priv
;
33 GObjectClass parent_class
;
36 GType
unit_manager_get_type(void);
38 UnitManager
*unit_manager_get_default(void);
40 UnitCategory
*unit_manager_add_category(UnitManager
*manager
, const gchar
*name
, const gchar
*display_name
);
42 const GList
*unit_manager_get_categories(UnitManager
*manager
);
44 UnitCategory
*unit_manager_get_category(UnitManager
*manager
, const gchar
*category
);
46 Unit
*unit_manager_get_unit_by_name(UnitManager
*manager
, const gchar
*name
);
48 Unit
*unit_manager_get_unit_by_symbol(UnitManager
*manager
, const gchar
*symbol
);
50 gboolean
unit_manager_convert_by_symbol(UnitManager
*manager
, const MPNumber
*x
, const char *x_symbol
, const char *z_symbol
, MPNumber
*z
);
54 #endif /* UNIT_MANAGER_H */