1 /*
2 * Copyright © 2009, 2010 Codethink Limited
3 * Copyright © 2010 Red Hat, Inc.
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 *
20 * Authors: Ryan Lortie <desrt@desrt.ca>
21 * Matthias Clasen <mclasen@redhat.com>
22 */
23
24 #ifndef __G_SETTINGS_BACKEND_INTERNAL_H__
25 #define __G_SETTINGS_BACKEND_INTERNAL_H__
26
27 #include "gsettingsbackend.h"
28
29 typedef struct
30 {
31 void (* changed) (GObject *target,
32 GSettingsBackend *backend,
33 const gchar *key,
34 gpointer origin_tag);
35 void (* path_changed) (GObject *target,
36 GSettingsBackend *backend,
37 const gchar *path,
38 gpointer origin_tag);
39 void (* keys_changed) (GObject *target,
40 GSettingsBackend *backend,
41 const gchar *prefix,
42 gpointer origin_tag,
43 const gchar * const *names);
44 void (* writable_changed) (GObject *target,
45 GSettingsBackend *backend,
46 const gchar *key);
47 void (* path_writable_changed) (GObject *target,
48 GSettingsBackend *backend,
49 const gchar *path);
50 } GSettingsListenerVTable;
51
52 void g_settings_backend_watch (GSettingsBackend *backend,
53 const GSettingsListenerVTable *vtable,
54 GObject *target,
55 GMainContext *context);
56 void g_settings_backend_unwatch (GSettingsBackend *backend,
57 GObject *target);
58
59 GTree * g_settings_backend_create_tree (void);
60
61 GVariant * g_settings_backend_read (GSettingsBackend *backend,
62 const gchar *key,
63 const GVariantType *expected_type,
64 gboolean default_value);
65 GVariant * g_settings_backend_read_user_value (GSettingsBackend *backend,
66 const gchar *key,
67 const GVariantType *expected_type);
68 gboolean g_settings_backend_write (GSettingsBackend *backend,
69 const gchar *key,
70 GVariant *value,
71 gpointer origin_tag);
72 gboolean g_settings_backend_write_tree (GSettingsBackend *backend,
73 GTree *tree,
74 gpointer origin_tag);
75 void g_settings_backend_reset (GSettingsBackend *backend,
76 const gchar *key,
77 gpointer origin_tag);
78 gboolean g_settings_backend_get_writable (GSettingsBackend *backend,
79 const char *key);
80 void g_settings_backend_unsubscribe (GSettingsBackend *backend,
81 const char *name);
82 void g_settings_backend_subscribe (GSettingsBackend *backend,
83 const char *name);
84 GPermission * g_settings_backend_get_permission (GSettingsBackend *backend,
85 const gchar *path);
86 void g_settings_backend_sync_default (void);
87
88 GType g_null_settings_backend_get_type (void);
89
90 GType g_memory_settings_backend_get_type (void);
91
92 GType g_keyfile_settings_backend_get_type (void);
93
94 #ifdef HAVE_COCOA
95 GType g_nextstep_settings_backend_get_type (void);
96 #endif
97
98 #ifdef G_OS_WIN32
99 GType g_registry_settings_backend_get_type (void);
100 #endif
101
102 #endif /* __G_SETTINGS_BACKEND_INTERNAL_H__ */