1 /* foo-person.h
2 *
3 * Copyright (C) 2009 Christian Hergert <chris@dronelabs.com>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
18 * 02110-1301 USA
19 */
20
21 #ifndef __FOO_PERSON_H__
22 #define __FOO_PERSON_H__
23
24 #include <glib-object.h>
25
26 G_BEGIN_DECLS
27
28 #define FOO_TYPE_PERSON (foo_person_get_type())
29 #define FOO_PERSON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_PERSON, FooPerson))
30 #define FOO_PERSON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE_PERSON, FooPersonClass))
31 #define FOO_IS_PERSON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_TYPE_PERSON))
32 #define FOO_IS_PERSON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOO_TYPE_PERSON))
33 #define FOO_PERSON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOO_TYPE_PERSON, FooPersonClass))
34
35 typedef struct _FooPerson FooPerson;
36 typedef struct _FooPersonClass FooPersonClass;
37 typedef struct _FooPersonPrivate FooPersonPrivate;
38
39 struct _FooPerson
40 {
41 GObject parent;
42
43 /*< private >*/
44 FooPersonPrivate *priv;
45 };
46
47 struct _FooPersonClass
48 {
49 GObjectClass parent_class;
50
51 void (*changed) (FooPerson *person);
52 };
53
54 GType foo_person_get_type (void);
55 FooPerson* foo_person_new (void);
56 FooPerson* foo_person_copy (FooPerson *person );
57
58 G_CONST_RETURN gchar* foo_person_get_name (FooPerson *person);
59 void foo_person_set_name (FooPerson *person, const gchar* name);
60 guint foo_person_get_age (FooPerson *person);
61 void foo_person_set_age (FooPerson *person, guint age);
62 gchar foo_person_get_gender (FooPerson *person);
63 void foo_person_set_gender (FooPerson *person, gchar gender);
64
65 G_END_DECLS
66
67 #endif /* __FOO_PERSON_H__ */