summaryrefslogtreecommitdiff
path: root/common/dconf-changeset.h
blob: 8eaea8c4086d9897509eb9ee2f09cce4b0696e17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * Copyright © 2010 Codethink Limited
 *
 * 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
 * version 2 of the licence, or (at your option) any later version.
 *
 * 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
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
 *
 * Author: Ryan Lortie <desrt@desrt.ca>
 */

#ifndef __dconf_changeset_h__
#define __dconf_changeset_h__

#include <glib.h>

G_BEGIN_DECLS

typedef struct _DConfChangeset                              DConfChangeset;

typedef gboolean     (* DConfChangesetPredicate)                        (const gchar              *path,
                                                                         GVariant                 *value,
                                                                         gpointer                  user_data);

DConfChangeset *        dconf_changeset_new                             (void);
DConfChangeset *        dconf_changeset_new_database                    (DConfChangeset           *copy_of);

DConfChangeset *        dconf_changeset_new_write                       (const gchar              *path,
                                                                         GVariant                 *value);

DConfChangeset *        dconf_changeset_ref                             (DConfChangeset           *changeset);
void                    dconf_changeset_unref                           (DConfChangeset           *changeset);

gboolean                dconf_changeset_is_empty                        (DConfChangeset           *changeset);

void                    dconf_changeset_set                             (DConfChangeset           *changeset,
                                                                         const gchar              *path,
                                                                         GVariant                 *value);

gboolean                dconf_changeset_get                             (DConfChangeset           *changeset,
                                                                         const gchar              *key,
                                                                         GVariant                **value);

gboolean                dconf_changeset_is_similar_to                   (DConfChangeset           *changeset,
                                                                         DConfChangeset           *other);

gboolean                dconf_changeset_all                             (DConfChangeset           *changeset,
                                                                         DConfChangesetPredicate   predicate,
                                                                         gpointer                  user_data);

guint                   dconf_changeset_describe                        (DConfChangeset           *changeset,
                                                                         const gchar             **prefix,
                                                                         const gchar * const     **paths,
                                                                         GVariant * const        **values);

GVariant *              dconf_changeset_serialise                       (DConfChangeset           *changeset);
DConfChangeset *        dconf_changeset_deserialise                     (GVariant                 *serialised);

void                    dconf_changeset_change                          (DConfChangeset           *changeset,
                                                                         DConfChangeset           *changes);

DConfChangeset *        dconf_changeset_filter_changes                  (DConfChangeset           *from,
                                                                         DConfChangeset           *changes);

DConfChangeset *        dconf_changeset_diff                            (DConfChangeset           *from,
                                                                         DConfChangeset           *to);

void                    dconf_changeset_seal                            (DConfChangeset           *changeset);

G_DEFINE_AUTOPTR_CLEANUP_FUNC(DConfChangeset, dconf_changeset_unref)

G_END_DECLS

#endif /* __dconf_changeset_h__ */