d1c05b317f8654ff0466712bf4c65d044dac97c7
[tweakr] / libmaemo-tweaks-section / maemo-tweaks-section.h
1 /*
2  * vim:ts=4:sw=4:et:cindent:cino=(0
3  */ 
4
5 #ifndef __MAEMO_TWEAKS_SECTION_H__
6 #define __MAEMO_TWEAKS_SECTION_H__
7
8 #include <glib-object.h>
9
10 G_BEGIN_DECLS
11
12
13 #define MAEMO_TWEAKS_TYPE_SECTION \
14         (maemo_tweaks_section_get_type ())
15 #define MAEMO_TWEAKS_SECTION(o) \
16         (G_TYPE_CHECK_INSTANCE_CAST ((o), MAEMO_TWEAKS_TYPE_SECTION, \
17         MaemoTweaksSection))
18 #define MAEMO_TWEAKS_SECTION_CLASS(k) \
19         (G_TYPE_CHECK_CLASS_CAST((k), MAEMO_TWEAKS_TYPE_SECTION, \
20         MaemoTweaksSectionClass))
21 #define MAEMO_TWEAKS_IS_SECTION(o) \
22         (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAEMO_TWEAKS_TYPE_SECTION))
23 #define MAEMO_TWEAKS_IS_SECTION_CLASS(k) \
24         (G_TYPE_CHECK_CLASS_TYPE ((k), MAEMO_TWEAKS_TYPE_SECTION))
25 #define MAEMO_TWEAKS_SECTION_GET_CLASS(o) \
26         (G_TYPE_INSTANCE_GET_CLASS ((o), MAEMO_TWEAKS_TYPE_SECTION, \
27         MaemoTweaksSectionClass))
28
29
30 typedef struct _MaemoTweaksSection      MaemoTweaksSection;
31 typedef struct _MaemoTweaksSectionClass MaemoTweaksSectionClass;
32
33 struct _MaemoTweaksSection
34 {
35     GObject  parent_instance;
36
37     /* The widget that the section populates (usually a vbox */
38     GtkWidget *widget;
39 };
40
41 struct _MaemoTweaksSectionClass
42 {
43     GObjectClass  parent_class;
44
45     const gchar *name;
46
47     gboolean (*save) (MaemoTweaksSection *section,
48                       gboolean *requires_restart);
49 };
50
51
52 GType maemo_tweaks_section_get_type (void) G_GNUC_CONST;
53
54 MaemoTweaksSection * maemo_tweaks_section_new (GType type);
55
56 GtkWidget * maemo_tweaks_section_get_widget (MaemoTweaksSection *section);
57 gboolean maemo_tweaks_section_save (MaemoTweaksSection *section,
58                                     gboolean *requires_restart);
59
60 G_END_DECLS
61
62 #endif /* __MAEMO_TWEAKS_SECTION_H_ */
63