Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gsettingsbackend.h
Go to the documentation of this file.
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_H__
25#define __G_SETTINGS_BACKEND_H__
26
27#if !defined (G_SETTINGS_ENABLE_BACKEND) && !defined (GIO_COMPILATION)
28#error "You must define G_SETTINGS_ENABLE_BACKEND before including <gio/gsettingsbackend.h>."
29#endif
30
31#define __GIO_GIO_H_INSIDE__
32#include <gio/giotypes.h>
33#undef __GIO_GIO_H_INSIDE__
34
36
37#define G_TYPE_SETTINGS_BACKEND (g_settings_backend_get_type ())
38#define G_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
39 G_TYPE_SETTINGS_BACKEND, GSettingsBackend))
40#define G_SETTINGS_BACKEND_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
41 G_TYPE_SETTINGS_BACKEND, GSettingsBackendClass))
42#define G_IS_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
43 G_TYPE_SETTINGS_BACKEND))
44#define G_IS_SETTINGS_BACKEND_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
45 G_TYPE_SETTINGS_BACKEND))
46#define G_SETTINGS_BACKEND_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
47 G_TYPE_SETTINGS_BACKEND, GSettingsBackendClass))
48
49/**
50 * G_SETTINGS_BACKEND_EXTENSION_POINT_NAME:
51 *
52 * Extension point for #GSettingsBackend functionality.
53 **/
54#define G_SETTINGS_BACKEND_EXTENSION_POINT_NAME "gsettings-backend"
55
56typedef struct _GSettingsBackendPrivate GSettingsBackendPrivate;
58
59/**
60 * GSettingsBackendClass:
61 * @read: virtual method to read a key's value
62 * @get_writable: virtual method to get if a key is writable
63 * @write: virtual method to change key's value
64 * @write_tree: virtual method to change a tree of keys
65 * @reset: virtual method to reset state
66 * @subscribe: virtual method to subscribe to key changes
67 * @unsubscribe: virtual method to unsubscribe to key changes
68 * @sync: virtual method to sync state
69 * @get_permission: virtual method to get permission of a key
70 * @read_user_value: virtual method to read user's key value
71 *
72 * Class structure for #GSettingsBackend.
73 */
75{
77
78 GVariant * (*read) (GSettingsBackend *backend,
79 const gchar *key,
80 const GVariantType *expected_type,
81 gboolean default_value);
82
84 const gchar *key);
85
87 const gchar *key,
89 gpointer origin_tag);
91 GTree *tree,
92 gpointer origin_tag);
93 void (*reset) (GSettingsBackend *backend,
94 const gchar *key,
95 gpointer origin_tag);
96
97 void (*subscribe) (GSettingsBackend *backend,
98 const gchar *name);
99 void (*unsubscribe) (GSettingsBackend *backend,
100 const gchar *name);
101 void (*sync) (GSettingsBackend *backend);
102
103 GPermission * (*get_permission) (GSettingsBackend *backend,
104 const gchar *path);
105
106 GVariant * (*read_user_value) (GSettingsBackend *backend,
107 const gchar *key,
108 const GVariantType *expected_type);
109
110 /*< private >*/
112};
113
121
124
127 const gchar *key,
128 gpointer origin_tag);
131 const gchar *path,
132 gpointer origin_tag);
135 gchar **path,
136 const gchar ***keys,
137 GVariant ***values);
140 const gchar *path,
141 gchar const * const *items,
142 gpointer origin_tag);
143
146 const gchar *path);
149 const gchar *key);
152 GTree *tree,
153 gpointer origin_tag);
154
157
160 const gchar *root_path,
161 const gchar *root_group);
162
165
168
170
171#endif /* __G_SETTINGS_BACKEND_H__ */
#define GIO_AVAILABLE_IN_ALL
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
GIO_AVAILABLE_IN_ALL void g_settings_backend_path_changed(GSettingsBackend *backend, const gchar *path, gpointer origin_tag)
GIO_AVAILABLE_IN_ALL void g_settings_backend_keys_changed(GSettingsBackend *backend, const gchar *path, gchar const *const *items, gpointer origin_tag)
GIO_AVAILABLE_IN_ALL void g_settings_backend_writable_changed(GSettingsBackend *backend, const gchar *key)
struct _GSettingsBackendPrivate GSettingsBackendPrivate
GIO_AVAILABLE_IN_ALL void g_settings_backend_changed_tree(GSettingsBackend *backend, GTree *tree, gpointer origin_tag)
GIO_AVAILABLE_IN_ALL GSettingsBackend * g_keyfile_settings_backend_new(const gchar *filename, const gchar *root_path, const gchar *root_group)
GIO_AVAILABLE_IN_ALL GSettingsBackend * g_settings_backend_get_default(void)
GIO_AVAILABLE_IN_ALL GType g_settings_backend_get_type(void)
GIO_AVAILABLE_IN_ALL GSettingsBackend * g_null_settings_backend_new(void)
GIO_AVAILABLE_IN_ALL void g_settings_backend_path_writable_changed(GSettingsBackend *backend, const gchar *path)
GIO_AVAILABLE_IN_ALL void g_settings_backend_changed(GSettingsBackend *backend, const gchar *key, gpointer origin_tag)
GIO_AVAILABLE_IN_ALL GSettingsBackend * g_memory_settings_backend_new(void)
GIO_AVAILABLE_IN_ALL void g_settings_backend_flatten_tree(GTree *tree, gchar **path, const gchar ***keys, GVariant ***values)
typedefG_BEGIN_DECLS struct _GTree GTree
Definition gtree.h:40
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
G_BEGIN_DECLS typedef char gchar
Definition gtypes.h:52
void * gpointer
Definition gtypes.h:109
typedefG_BEGIN_DECLS struct _GVariant GVariant
Definition gvariant.h:36
typedefG_BEGIN_DECLS struct _GVariantType GVariantType
const char * name
Definition lsqlite3.c:2154
int value
Definition lsqlite3.c:2155
void(* subscribe)(GSettingsBackend *backend, const gchar *name)
void(* reset)(GSettingsBackend *backend, const gchar *key, gpointer origin_tag)
void(* sync)(GSettingsBackend *backend)
gboolean(* write)(GSettingsBackend *backend, const gchar *key, GVariant *value, gpointer origin_tag)
gboolean(* write_tree)(GSettingsBackend *backend, GTree *tree, gpointer origin_tag)
void(* unsubscribe)(GSettingsBackend *backend, const gchar *name)
gboolean(* get_writable)(GSettingsBackend *backend, const gchar *key)
GSettingsBackendPrivate * priv