gsettingsbackendinternal.h 6.17 KB
Newer Older
1 2 3 4 5 6 7
/*
 * Copyright © 2009, 2010 Codethink Limited
 * Copyright © 2010 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
8
 * version 2.1 of the License, or (at your option) any later version.
9 10 11 12 13 14 15
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * 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 19 20 21 22 23 24 25 26
 *
 * Authors: Ryan Lortie <desrt@desrt.ca>
 *          Matthias Clasen <mclasen@redhat.com>
 */

#ifndef __G_SETTINGS_BACKEND_INTERNAL_H__
#define __G_SETTINGS_BACKEND_INTERNAL_H__

#include "gsettingsbackend.h"

27 28 29 30 31 32 33 34 35 36 37 38 39
typedef struct
{
  void (* changed)               (GObject             *target,
                                  GSettingsBackend    *backend,
                                  const gchar         *key,
                                  gpointer             origin_tag);
  void (* path_changed)          (GObject             *target,
                                  GSettingsBackend    *backend,
                                  const gchar         *path,
                                  gpointer             origin_tag);
  void (* keys_changed)          (GObject             *target,
                                  GSettingsBackend    *backend,
                                  const gchar         *prefix,
40 41
                                  gpointer             origin_tag,
                                  const gchar * const *names);
42 43 44 45 46 47 48
  void (* writable_changed)      (GObject             *target,
                                  GSettingsBackend    *backend,
                                  const gchar         *key);
  void (* path_writable_changed) (GObject             *target,
                                  GSettingsBackend    *backend,
                                  const gchar         *path);
} GSettingsListenerVTable;
49

50 51 52 53 54 55
void                    g_settings_backend_watch                        (GSettingsBackend               *backend,
                                                                         const GSettingsListenerVTable  *vtable,
                                                                         GObject                        *target,
                                                                         GMainContext                   *context);
void                    g_settings_backend_unwatch                      (GSettingsBackend               *backend,
                                                                         GObject                        *target);
56

57
GTree *                 g_settings_backend_create_tree                  (void);
58 59 60 61 62

GVariant *              g_settings_backend_read                         (GSettingsBackend               *backend,
                                                                         const gchar                    *key,
                                                                         const GVariantType             *expected_type,
                                                                         gboolean                        default_value);
63 64 65
GVariant *              g_settings_backend_read_user_value              (GSettingsBackend               *backend,
                                                                         const gchar                    *key,
                                                                         const GVariantType             *expected_type);
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
gboolean                g_settings_backend_write                        (GSettingsBackend               *backend,
                                                                         const gchar                    *key,
                                                                         GVariant                       *value,
                                                                         gpointer                        origin_tag);
gboolean                g_settings_backend_write_tree                   (GSettingsBackend               *backend,
                                                                         GTree                          *tree,
                                                                         gpointer                        origin_tag);
void                    g_settings_backend_reset                        (GSettingsBackend               *backend,
                                                                         const gchar                    *key,
                                                                         gpointer                        origin_tag);
gboolean                g_settings_backend_get_writable                 (GSettingsBackend               *backend,
                                                                         const char                     *key);
void                    g_settings_backend_unsubscribe                  (GSettingsBackend               *backend,
                                                                         const char                     *name);
void                    g_settings_backend_subscribe                    (GSettingsBackend               *backend,
                                                                         const char                     *name);
GPermission *           g_settings_backend_get_permission               (GSettingsBackend               *backend,
                                                                         const gchar                    *path);
84
void                    g_settings_backend_sync_default                 (void);
85

86 87 88 89
GType                   g_null_settings_backend_get_type                (void);

GType                   g_memory_settings_backend_get_type              (void);

90 91
GType                   g_keyfile_settings_backend_get_type             (void);

92
#ifdef HAVE_COCOA
93 94 95
GType                   g_nextstep_settings_backend_get_type            (void);
#endif

96
#endif  /* __G_SETTINGS_BACKEND_INTERNAL_H__ */