summaryrefslogtreecommitdiff
path: root/capplets/common/gconf-property-editor.h
blob: 8a39e02cb88a4ec62def6daf764137cd1ddc4dfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/* -*- mode: c; style: linux -*- */

/* gconf-property-editor.h
 * Copyright (C) 2001 Ximian, Inc.
 *
 * Written by Bradford Hovinen <hovinen@ximian.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */

#ifndef __GCONF_PROPERTY_EDITOR_H
#define __GCONF_PROPERTY_EDITOR_H

#include <gnome.h>
#include <gconf/gconf-client.h>
#include <gconf/gconf-changeset.h>

G_BEGIN_DECLS

#define GCONF_PROPERTY_EDITOR(obj)          G_TYPE_CHECK_INSTANCE_CAST (obj, gconf_property_editor_get_type (), GConfPropertyEditor)
#define GCONF_PROPERTY_EDITOR_CLASS(klass)  G_TYPE_CHECK_CLASS_CAST (klass, gconf_property_editor_get_type (), GConfPropertyEditorClass)
#define IS_GCONF_PROPERTY_EDITOR(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, gconf_property_editor_get_type ())

typedef struct _GConfPropertyEditor GConfPropertyEditor;
typedef struct _GConfPropertyEditorClass GConfPropertyEditorClass;
typedef struct _GConfPropertyEditorPrivate GConfPropertyEditorPrivate;

typedef GConfValue *(*GConfPEditorValueConvFn) (GConfPropertyEditor *peditor, const GConfValue *);
typedef int	    (*GConfPEditorGetValueFn)  (GConfPropertyEditor *peditor, gpointer data);

struct _GConfPropertyEditor 
{
	GObject parent;

	GConfPropertyEditorPrivate *p;
};

struct _GConfPropertyEditorClass 
{
	GObjectClass g_object_class;

	void (*value_changed) (GConfPropertyEditor *peditor, gchar *key, GConfValue *value);
};

GType gconf_property_editor_get_type    (void);

const gchar *gconf_property_editor_get_key        (GConfPropertyEditor  *peditor);
GObject     *gconf_property_editor_get_ui_control (GConfPropertyEditor  *peditor);

GObject *gconf_peditor_new_boolean      (GConfChangeSet          *changeset,
					 gchar                   *key,
					 GtkWidget               *checkbox,
					 gchar                   *first_property_name,
					 ...);

GObject *gconf_peditor_new_enum_toggle  (GConfChangeSet 	 *changeset,
					 gchar			 *key,
					 GtkWidget		 *checkbox,
					 GType			 enum_type,
					 GConfPEditorGetValueFn  val_true_fn,
					 guint			 val_false,
					 gboolean	 	 use_nick,
					 gpointer		 data,
					 gchar 			 *first_property_name,
					 ...);

GObject *gconf_peditor_new_integer      (GConfChangeSet          *changeset,
					 gchar                   *key,
					 GtkWidget               *entry,
					 gchar                   *first_property_name,
					 ...);
GObject *gconf_peditor_new_string       (GConfChangeSet          *changeset,
					 gchar                   *key,
					 GtkWidget               *entry,
					 gchar                   *first_property_name,
					 ...);
GObject *gconf_peditor_new_filename     (GConfChangeSet          *changeset,
					 gchar                   *key,
					 GtkWidget               *file_entry,
					 gchar                   *first_property_name,
					 ...);
GObject *gconf_peditor_new_color        (GConfChangeSet          *changeset,
					 gchar                   *key,
					 GtkWidget               *color_entry,
					 gchar                   *first_property_name,
					 ...);

GObject *gconf_peditor_new_select_menu	(GConfChangeSet *changeset,
					 gchar 	        *key,
					 GtkWidget      *option_menu,
					 gchar          *first_property_name,
					 ...);


GObject *gconf_peditor_new_select_menu_with_enum	(GConfChangeSet *changeset,
							 gchar 	        *key,
							 GtkWidget      *option_menu,
							 GType          enum_type,
							 gboolean  	use_nick,
							 gchar          *first_property_name,
							 ...);

GObject *gconf_peditor_new_select_radio (GConfChangeSet          *changeset,
					 gchar                   *key,
					 GSList                  *radio_group,
					 gchar                   *first_property_name,
					 ...);

GObject *gconf_peditor_new_select_radio_with_enum	 (GConfChangeSet *changeset,
							  gchar		 *key,
							  GSList 	 *radio_group,
							  GType 	 enum_type,
							  gboolean	 use_nick,
							  gchar          *first_property_name,
							  ...);

GObject *gconf_peditor_new_numeric_range (GConfChangeSet          *changeset,
					  gchar                   *key,
					  GtkWidget               *range,
					  gchar                   *first_property_name,
					  ...);

GObject *gconf_peditor_new_font          (GConfChangeSet          *changeset,
					  gchar                   *key,
					  GtkWidget               *font_button,
					  gchar                   *first_property_name,
					  ...);

GObject *gconf_peditor_new_image	 (GConfChangeSet	  *changeset,
					  gchar			  *key,
					  GtkWidget		  *button,
					  gchar			  *first_property,
					  ...);

void gconf_peditor_widget_set_guard     (GConfPropertyEditor     *peditor,
					 GtkWidget               *widget);

/* some convenience callbacks to map int <-> float */
GConfValue *gconf_value_int_to_float    (GConfPropertyEditor *ignored, GConfValue const *value);
GConfValue *gconf_value_float_to_int    (GConfPropertyEditor *ignored, GConfValue const *value);

G_END_DECLS

#endif /* __GCONF_PROPERTY_EDITOR_H */