window: Replace menu bar with app menu
[gcalctool.git] / src / unit-manager.h
blobdb1b4f2635196545d34ad6ebbe086cc7452ffe17
1 /*
2 * Copyright (C) 1987-2008 Sun Microsystems, Inc. All Rights Reserved.
3 * Copyright (C) 2008-2011 Robert Ancell.
4 *
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
9 * license.
12 #ifndef UNIT_MANAGER_H
13 #define UNIT_MANAGER_H
15 #include <glib-object.h>
16 #include "unit-category.h"
17 #include "mp.h"
19 G_BEGIN_DECLS
21 #define UNIT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), unit_manager_get_type(), UnitManager))
23 typedef struct UnitManagerPrivate UnitManagerPrivate;
25 typedef struct
27 GObject parent_instance;
28 UnitManagerPrivate *priv;
29 } UnitManager;
31 typedef struct
33 GObjectClass parent_class;
34 } UnitManagerClass;
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);
52 G_END_DECLS
54 #endif /* UNIT_MANAGER_H */