~ubuntu-branches/ubuntu/oneiric/gconf/oneiric-proposed

« back to all changes in this revision

Viewing changes to gconf/gconf-changeset.h

  • Committer: Bazaar Package Importer
  • Author(s): Takuo KITAME
  • Date: 2002-03-17 01:51:39 UTC
  • Revision ID: james.westby@ubuntu.com-20020317015139-z4f8fdg1hoe049g0
Tags: upstream-1.0.9
ImportĀ upstreamĀ versionĀ 1.0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GConf
 
2
 * Copyright (C) 1999, 2000 Red Hat Inc.
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU Library General Public
 
6
 * License as published by the Free Software Foundation; either
 
7
 * version 2 of the License, or (at your option) any later version.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * Library General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Library General Public
 
15
 * License along with this library; if not, write to the
 
16
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
17
 * Boston, MA 02111-1307, USA.
 
18
 */
 
19
 
 
20
#ifndef GCONF_GCONF_CHANGESET_H
 
21
#define GCONF_GCONF_CHANGESET_H
 
22
 
 
23
#include <gconf/gconf.h>
 
24
 
 
25
#ifdef __cplusplus
 
26
extern "C" {
 
27
#endif /* __cplusplus */
 
28
 
 
29
/*
 
30
 * A GConfChangeSet is basically a hash from keys to "changes in value,"
 
31
 * where a change in a value is either a new value or "unset this value."
 
32
 *
 
33
 * You can use this to collect changes then "commit" them as a group to
 
34
 * the GConf database.
 
35
 */
 
36
 
 
37
typedef struct _GConfChangeSet GConfChangeSet;
 
38
 
 
39
typedef void (* GConfChangeSetForeachFunc) (GConfChangeSet* cs,
 
40
                                            const gchar* key,
 
41
                                            GConfValue* value,
 
42
                                            gpointer user_data);
 
43
 
 
44
gboolean        gconf_engine_commit_change_set   (GConfEngine* conf,
 
45
                                                  GConfChangeSet* cs,
 
46
                                                  /* remove all
 
47
                                                     successfully
 
48
                                                     committed changes
 
49
                                                     from the set */
 
50
                                                  gboolean remove_committed,
 
51
                                                  GError** err);
 
52
 
 
53
/* Create a change set that would revert the given change set
 
54
   for the given GConfEngine */
 
55
GConfChangeSet* gconf_engine_reverse_change_set  (GConfEngine* conf,
 
56
                                                  GConfChangeSet* cs,
 
57
                                                  GError** err);
 
58
 
 
59
/* Create a change set that would restore the current state of all the keys
 
60
   in the NULL-terminated array "keys" */
 
61
GConfChangeSet* gconf_engine_change_set_from_currentv (GConfEngine* conf,
 
62
                                                       const gchar** keys,
 
63
                                                       GError** err);
 
64
 
 
65
GConfChangeSet* gconf_engine_change_set_from_current (GConfEngine* conf,
 
66
                                                      GError** err,
 
67
                                                      const gchar* first_key,
 
68
                                                      ...);
 
69
 
 
70
 
 
71
GConfChangeSet* gconf_change_set_new      (void);
 
72
void            gconf_change_set_ref      (GConfChangeSet* cs);
 
73
 
 
74
void            gconf_change_set_unref    (GConfChangeSet* cs);
 
75
 
 
76
void            gconf_change_set_clear    (GConfChangeSet* cs);
 
77
 
 
78
guint           gconf_change_set_size     (GConfChangeSet* cs);
 
79
 
 
80
void            gconf_change_set_remove   (GConfChangeSet* cs,
 
81
                                           const gchar* key);
 
82
 
 
83
void            gconf_change_set_foreach  (GConfChangeSet* cs,
 
84
                                           GConfChangeSetForeachFunc func,
 
85
                                           gpointer user_data);
 
86
 
 
87
/* Returns TRUE if the change set contains the given key; if the key
 
88
   is in the set, either NULL (for unset) or a GConfValue is placed in
 
89
   *value_retloc; the value is not a copy and should not be
 
90
   freed. value_retloc can be NULL if you just want to check for a value,
 
91
   and don't care what it is. */
 
92
gboolean     gconf_change_set_check_value   (GConfChangeSet* cs, const gchar* key,
 
93
                                             GConfValue** value_retloc);
 
94
 
 
95
void         gconf_change_set_set         (GConfChangeSet* cs, const gchar* key,
 
96
                                           GConfValue* value);
 
97
 
 
98
void         gconf_change_set_set_nocopy  (GConfChangeSet* cs, const gchar* key,
 
99
                                           GConfValue* value);
 
100
 
 
101
void         gconf_change_set_unset      (GConfChangeSet* cs, const gchar* key);
 
102
 
 
103
void         gconf_change_set_set_float   (GConfChangeSet* cs, const gchar* key,
 
104
                                           gdouble val);
 
105
 
 
106
void         gconf_change_set_set_int     (GConfChangeSet* cs, const gchar* key,
 
107
                                           gint val);
 
108
 
 
109
void         gconf_change_set_set_string  (GConfChangeSet* cs, const gchar* key,
 
110
                                           const gchar* val);
 
111
 
 
112
void         gconf_change_set_set_bool    (GConfChangeSet* cs, const gchar* key,
 
113
                                           gboolean val);
 
114
 
 
115
void         gconf_change_set_set_schema  (GConfChangeSet* cs, const gchar* key,
 
116
                                           GConfSchema* val);
 
117
 
 
118
void         gconf_change_set_set_list    (GConfChangeSet* cs, const gchar* key,
 
119
                                           GConfValueType list_type,
 
120
                                           GSList* list);
 
121
 
 
122
void         gconf_change_set_set_pair    (GConfChangeSet* cs, const gchar* key,
 
123
                                           GConfValueType car_type, GConfValueType cdr_type,
 
124
                                           gconstpointer address_of_car,
 
125
                                           gconstpointer address_of_cdr);
 
126
 
 
127
 
 
128
/* For use by language bindings only */
 
129
void     gconf_change_set_set_user_data (GConfChangeSet *cs,
 
130
                                         gpointer        data,
 
131
                                         GDestroyNotify  dnotify);
 
132
gpointer gconf_change_set_get_user_data (GConfChangeSet *cs);
 
133
 
 
134
 
 
135
 
 
136
#ifdef __cplusplus
 
137
}
 
138
#endif /* __cplusplus */
 
139
 
 
140
#endif
 
141
 
 
142
 
 
143