Add sections' names.
[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     const gchar *name;
40 };
41
42 struct _MaemoTweaksSectionClass
43 {
44     GObjectClass  parent_class;
45
46     const gchar *name;
47
48     gboolean (*save) (MaemoTweaksSection *section,
49                       gboolean *requires_restart);
50 };
51
52
53 GType maemo_tweaks_section_get_type (void) G_GNUC_CONST;
54
55 MaemoTweaksSection * maemo_tweaks_section_new (GType type);
56
57 GtkWidget * maemo_tweaks_section_get_widget (MaemoTweaksSection *section);
58 gboolean maemo_tweaks_section_save (MaemoTweaksSection *section,
59                                     gboolean *requires_restart);
60
61 G_END_DECLS
62
63 #endif /* __MAEMO_TWEAKS_SECTION_H_ */
64