~registry/gcalctool/trunk

« back to all changes in this revision

Viewing changes to src/unit-category.h

  • Committer: Robert Ancell
  • Date: 2012-10-14 03:31:40 UTC
  • Revision ID: git-v1:12ba2c81b0a81bb3ac776d1034a3c41b3173196a
Port to Vala

https://bugzilla.gnome.org/show_bug.cgi?id=640685

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
10
 
 */
11
 
 
12
 
#ifndef UNIT_CATEGORY_H
13
 
#define UNIT_CATEGORY_H
14
 
 
15
 
#include <glib-object.h>
16
 
#include "unit.h"
17
 
#include "mp.h"
18
 
 
19
 
G_BEGIN_DECLS
20
 
 
21
 
#define UNIT_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), unit_category_get_type(), UnitCategory))
22
 
 
23
 
typedef struct UnitCategoryPrivate UnitCategoryPrivate;
24
 
 
25
 
typedef struct
26
 
{
27
 
    GObject parent_instance;
28
 
    UnitCategoryPrivate *priv;
29
 
} UnitCategory;
30
 
 
31
 
typedef struct
32
 
{
33
 
    GObjectClass parent_class;
34
 
} UnitCategoryClass;
35
 
 
36
 
GType unit_category_get_type(void);
37
 
 
38
 
UnitCategory *unit_category_new(const gchar *name, const gchar *display_name);
39
 
 
40
 
const gchar *unit_category_get_name(UnitCategory *category);
41
 
 
42
 
const gchar *unit_category_get_display_name(UnitCategory *category);
43
 
 
44
 
Unit *unit_category_get_unit_by_name(UnitCategory *category, const gchar *name);
45
 
 
46
 
Unit *unit_category_get_unit_by_symbol(UnitCategory *category, const gchar *symbol);
47
 
 
48
 
void unit_category_add_unit(UnitCategory *category, Unit *unit);
49
 
 
50
 
const GList *unit_category_get_units(UnitCategory *category);
51
 
 
52
 
gboolean unit_category_convert(UnitCategory *category, const MPNumber *x, Unit *x_units, Unit *z_units, MPNumber *z);
53
 
 
54
 
G_END_DECLS
55
 
 
56
 
#endif /* UNIT_CATEGORY_H */