Cleanup the GSettingsBackend API
[platform/upstream/glib.git] / gio / gsettingsbackendinternal.h
1 /*
2  * Copyright © 2009, 2010 Codethink Limited
3  * Copyright © 2010 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the licence, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
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 void          (*GSettingsBackendChangedFunc)                    (GSettingsBackend    *backend,
30                                                                          GObject             *target,
31                                                                          const gchar         *key,
32                                                                          gpointer             origin_tag);
33 typedef void          (*GSettingsBackendPathChangedFunc)                (GSettingsBackend    *backend,
34                                                                          GObject             *target,
35                                                                          const gchar         *path,
36                                                                          gpointer             origin_tag);
37 typedef void          (*GSettingsBackendKeysChangedFunc)                (GSettingsBackend    *backend,
38                                                                          GObject             *target,
39                                                                          const gchar         *prefix,
40                                                                          const gchar * const *names,
41                                                                          gpointer             origin_tag);
42 typedef void          (*GSettingsBackendWritableChangedFunc)            (GSettingsBackend    *backend,
43                                                                          GObject             *target,
44                                                                          const gchar         *key);
45 typedef void          (*GSettingsBackendPathWritableChangedFunc)        (GSettingsBackend    *backend,
46                                                                          GObject             *target,
47                                                                          const gchar         *path);
48
49 G_GNUC_INTERNAL
50 void                    g_settings_backend_watch                        (GSettingsBackend                        *backend,
51                                                                          GObject                                 *target,
52                                                                          GMainContext                            *context,
53                                                                          GSettingsBackendChangedFunc              changed,
54                                                                          GSettingsBackendPathChangedFunc          path_changed,
55                                                                          GSettingsBackendKeysChangedFunc          keys_changed,
56                                                                          GSettingsBackendWritableChangedFunc      writable_changed,
57                                                                          GSettingsBackendPathWritableChangedFunc  path_writable_changed);
58 G_GNUC_INTERNAL
59 void                    g_settings_backend_unwatch                      (GSettingsBackend                     *backend,
60                                                                          GObject                              *target);
61
62 G_GNUC_INTERNAL
63 GTree *                 g_settings_backend_create_tree                  (void);
64 G_GNUC_INTERNAL
65 GVariant *              g_settings_backend_read                         (GSettingsBackend                     *backend,
66                                                                          const gchar                          *key,
67                                                                          const GVariantType                   *expected_type,
68                                                                          gboolean                              default_value);
69 G_GNUC_INTERNAL
70 gboolean                g_settings_backend_write                        (GSettingsBackend                     *backend,
71                                                                          const gchar                          *key,
72                                                                          GVariant                             *value,
73                                                                          gpointer                              origin_tag);
74 G_GNUC_INTERNAL
75 gboolean                g_settings_backend_write_tree                   (GSettingsBackend                     *backend,
76                                                                          GTree                                *tree,
77                                                                          gpointer                              origin_tag);
78 G_GNUC_INTERNAL
79 void                    g_settings_backend_reset                        (GSettingsBackend                     *backend,
80                                                                          const gchar                          *key,
81                                                                          gpointer                              origin_tag);
82
83 G_GNUC_INTERNAL
84 void                    g_settings_backend_reset_path                   (GSettingsBackend                     *backend,
85                                                                          const gchar                          *path,
86                                                                          gpointer                              origin_tag);
87
88 G_GNUC_INTERNAL
89 gboolean                g_settings_backend_get_writable                 (GSettingsBackend                     *backend,
90                                                                          const char                           *key);
91 G_GNUC_INTERNAL
92 void                    g_settings_backend_unsubscribe                  (GSettingsBackend                     *backend,
93                                                                          const char                           *name);
94 G_GNUC_INTERNAL
95 void                    g_settings_backend_subscribe                    (GSettingsBackend                     *backend,
96                                                                          const char                           *name);
97 G_GNUC_INTERNAL
98 GPermission *           g_settings_backend_get_permission               (GSettingsBackend                     *backend,
99                                                                          const gchar                          *path);
100 G_GNUC_INTERNAL
101 GMainContext *          g_settings_backend_get_active_context           (void);
102 G_GNUC_INTERNAL
103 GSettingsBackend *      g_settings_backend_get_default                  (void);
104 G_GNUC_INTERNAL
105 void                    g_settings_backend_sync_default                 (void);
106
107 #endif  /* __G_SETTINGS_BACKEND_INTERNAL_H__ */