cleanup
[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, see <http://www.gnu.org/licenses/>.
17  *
18  * Authors: Ryan Lortie <desrt@desrt.ca>
19  *          Matthias Clasen <mclasen@redhat.com>
20  */
21
22 #ifndef __G_SETTINGS_BACKEND_INTERNAL_H__
23 #define __G_SETTINGS_BACKEND_INTERNAL_H__
24
25 #include "gsettingsbackend.h"
26
27 typedef struct
28 {
29   void (* changed)               (GObject             *target,
30                                   GSettingsBackend    *backend,
31                                   const gchar         *key,
32                                   gpointer             origin_tag);
33   void (* path_changed)          (GObject             *target,
34                                   GSettingsBackend    *backend,
35                                   const gchar         *path,
36                                   gpointer             origin_tag);
37   void (* keys_changed)          (GObject             *target,
38                                   GSettingsBackend    *backend,
39                                   const gchar         *prefix,
40                                   gpointer             origin_tag,
41                                   const gchar * const *names);
42   void (* writable_changed)      (GObject             *target,
43                                   GSettingsBackend    *backend,
44                                   const gchar         *key);
45   void (* path_writable_changed) (GObject             *target,
46                                   GSettingsBackend    *backend,
47                                   const gchar         *path);
48 } GSettingsListenerVTable;
49
50 void                    g_settings_backend_watch                        (GSettingsBackend               *backend,
51                                                                          const GSettingsListenerVTable  *vtable,
52                                                                          GObject                        *target,
53                                                                          GMainContext                   *context);
54 void                    g_settings_backend_unwatch                      (GSettingsBackend               *backend,
55                                                                          GObject                        *target);
56
57 GTree *                 g_settings_backend_create_tree                  (void);
58
59 GVariant *              g_settings_backend_read                         (GSettingsBackend               *backend,
60                                                                          const gchar                    *key,
61                                                                          const GVariantType             *expected_type,
62                                                                          gboolean                        default_value);
63 GVariant *              g_settings_backend_read_user_value              (GSettingsBackend               *backend,
64                                                                          const gchar                    *key,
65                                                                          const GVariantType             *expected_type);
66 gboolean                g_settings_backend_write                        (GSettingsBackend               *backend,
67                                                                          const gchar                    *key,
68                                                                          GVariant                       *value,
69                                                                          gpointer                        origin_tag);
70 gboolean                g_settings_backend_write_tree                   (GSettingsBackend               *backend,
71                                                                          GTree                          *tree,
72                                                                          gpointer                        origin_tag);
73 void                    g_settings_backend_reset                        (GSettingsBackend               *backend,
74                                                                          const gchar                    *key,
75                                                                          gpointer                        origin_tag);
76 gboolean                g_settings_backend_get_writable                 (GSettingsBackend               *backend,
77                                                                          const char                     *key);
78 void                    g_settings_backend_unsubscribe                  (GSettingsBackend               *backend,
79                                                                          const char                     *name);
80 void                    g_settings_backend_subscribe                    (GSettingsBackend               *backend,
81                                                                          const char                     *name);
82 GPermission *           g_settings_backend_get_permission               (GSettingsBackend               *backend,
83                                                                          const gchar                    *path);
84 void                    g_settings_backend_sync_default                 (void);
85
86 GType                   g_null_settings_backend_get_type                (void);
87
88 GType                   g_memory_settings_backend_get_type              (void);
89
90 #ifdef HAVE_COCOA
91 GType                   g_nextstep_settings_backend_get_type            (void);
92 #endif
93
94 #endif  /* __G_SETTINGS_BACKEND_INTERNAL_H__ */