1 /*
2  * Nautilus-Actions
3  * A Nautilus extension which offers configurable context menu actions.
4  *
5  * Copyright (C) 2005 The GNOME Foundation
6  * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS)
7  * Copyright (C) 2009-2014 Pierre Wieser and others (see AUTHORS)
8  *
9  * Nautilus-Actions is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 of
12  * the License, or (at your option) any later version.
13  *
14  * Nautilus-Actions is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with Nautilus-Actions; see the file COPYING. If not, see
21  * <http://www.gnu.org/licenses/>.
22  *
23  * Authors:
24  *   Frederic Ruaudel <grumz@grumz.net>
25  *   Rodrigo Moya <rodrigo@gnome-db.org>
26  *   Pierre Wieser <pwieser@trychlos.org>
27  *   ... and many others (see AUTHORS)
28  */
29 
30 #ifndef __NAUTILUS_ACTIONS_API_NA_GCONF_UTILS_H__
31 #define __NAUTILUS_ACTIONS_API_NA_GCONF_UTILS_H__
32 
33 #ifdef HAVE_GCONF
34 /**
35  * SECTION: gconf-utils
36  * @title: GConf Misc
37  * @short_description: The GConf Library Utilities
38  * @include: runtime/na-gconf-utils.h
39  *
40  * Starting with Nautilus-Actions 3.1.0, GConf, whether it is used as a
41  * preference storage subsystem or as an I/O provider, is deprecated.
42  */
43 
44 #include <gconf/gconf-client.h>
45 
46 G_BEGIN_DECLS
47 
48 GSList  *na_gconf_utils_get_subdirs( GConfClient *gconf, const gchar *path );
49 void     na_gconf_utils_free_subdirs( GSList *subdirs );
50 
51 gboolean na_gconf_utils_has_entry  ( GSList *entries, const gchar *entry );
52 GSList  *na_gconf_utils_get_entries( GConfClient *gconf, const gchar *path );
53 gboolean na_gconf_utils_get_bool_from_entries       ( GSList *entries, const gchar *entry, gboolean *value );
54 gboolean na_gconf_utils_get_string_from_entries     ( GSList *entries, const gchar *entry, gchar **value );
55 gboolean na_gconf_utils_get_string_list_from_entries( GSList *entries, const gchar *entry, GSList **value );
56 void     na_gconf_utils_dump_entries                ( GSList *entries );
57 void     na_gconf_utils_free_entries                ( GSList *entries );
58 
59 gboolean na_gconf_utils_read_bool        ( GConfClient *gconf, const gchar *path, gboolean use_schema, gboolean default_value );
60 gint     na_gconf_utils_read_int         ( GConfClient *gconf, const gchar *path, gboolean use_schema, gint default_value );
61 gchar   *na_gconf_utils_read_string      ( GConfClient *gconf, const gchar *path, gboolean use_schema, const gchar *default_value );
62 GSList  *na_gconf_utils_read_string_list ( GConfClient *gconf, const gchar *path );
63 
64 /* Writing in GConf is deprecated since 3.1.0
65  */
66 #ifdef NA_ENABLE_DEPRECATED
67 gboolean na_gconf_utils_write_bool       ( GConfClient *gconf, const gchar *path, gboolean value, gchar **message );
68 gboolean na_gconf_utils_write_int        ( GConfClient *gconf, const gchar *path, gint value, gchar **message );
69 gboolean na_gconf_utils_write_string     ( GConfClient *gconf, const gchar *path, const gchar *value, gchar **message );
70 gboolean na_gconf_utils_write_string_list( GConfClient *gconf, const gchar *path, GSList *value, gchar **message );
71 gboolean na_gconf_utils_remove_entry     ( GConfClient *gconf, const gchar *path, gchar **message );
72 GSList  *na_gconf_utils_slist_from_string( const gchar *value );
73 gchar   *na_gconf_utils_slist_to_string  ( GSList *slist );
74 #endif /* NA_ENABLE_DEPRECATED */
75 
76 G_END_DECLS
77 
78 #endif /* HAVE_GCONF */
79 #endif /* __NAUTILUS_ACTIONS_API_NA_GCONF_UTILS_H__ */
80