Disable localized digits (Bug #644980)
[gcalctool.git] / src / unit.h
blob459a2d6fd92532325c76a3fd6fff71fbe73e94a4
1 #ifndef UNIT_H
2 #define UNIT_H
4 #include <glib-object.h>
5 #include "mp.h"
7 G_BEGIN_DECLS
9 #define UNIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), unit_get_type(), Unit))
11 typedef struct UnitPrivate UnitPrivate;
13 typedef struct
15 GObject parent_instance;
16 UnitPrivate *priv;
17 } Unit;
19 typedef struct
21 GObjectClass parent_class;
22 } UnitClass;
24 GType unit_get_type(void);
26 Unit *unit_new(const gchar *name,
27 const gchar *display_name,
28 const gchar *format,
29 const gchar *from_function,
30 const gchar *to_function,
31 const gchar *symbols);
33 const gchar *unit_get_name(Unit *unit);
35 const gchar *unit_get_display_name(Unit *unit);
37 gboolean unit_matches_symbol(Unit *unit, const gchar *symbol);
39 const GList *unit_get_symbols(Unit *unit);
41 gboolean unit_convert_from(Unit *unit, const MPNumber *x, MPNumber *z);
43 gboolean unit_convert_to(Unit *unit, const MPNumber *x, MPNumber *z);
45 gchar *unit_format(Unit *unit, MPNumber *x);
47 G_END_DECLS
49 #endif /* UNIT_H */