2
// Really, this whole interface should be used only via the GConf
3
// client library. I reserve the right to change it whenever I feel
6
enum ConfigBasicValueType { BInvalidVal, BIntVal, BStringVal, BFloatVal, BBoolVal, BSchemaVal };
8
enum ConfigValueType { InvalidVal, IntVal, StringVal, FloatVal, BoolVal, SchemaVal, ListVal, PairVal };
11
ConfigValueType value_type;
12
ConfigValueType value_list_type;
13
ConfigValueType value_car_type;
14
ConfigValueType value_cdr_type;
19
// Work around lack of recursive data types
20
string encoded_default_value;
23
union ConfigBasicValue switch (ConfigBasicValueType) {
34
// hope this doesn't slow down transmission of smaller types
36
ConfigSchema schema_value;
39
typedef sequence<ConfigBasicValue> BasicValueList;
43
ConfigBasicValueType list_type;
46
union ConfigValue switch (ConfigValueType) {
58
ConfigSchema schema_value;
60
ConfigList list_value;
62
BasicValueList pair_value;
65
struct ConfigStringProperty
71
interface ConfigDatabase;
73
interface ConfigListener {
74
typedef sequence<string> KeyList;
76
oneway void notify (in ConfigDatabase database,
77
in unsigned long cnxn,
80
in boolean is_default,
81
in boolean is_writable);
85
/// This should conceivably not be oneway.
86
/// I'm worried about the server blocking waiting for
89
oneway void update_listener (in ConfigDatabase database,
91
in unsigned long old_cnxn,
93
in unsigned long new_cnxn);
95
oneway void invalidate_cached_values (in ConfigDatabase database,
98
// Called when a new daemon starts up, and we need to drop caches
99
// in case the new daemon has a different default database
100
oneway void drop_all_caches ();
103
// Sync this with GConfErrNo in gconf.h, when it makes sense
104
// (e.g. G_CONF_NO_SERVER doesn't make sense here)
106
enum ConfigErrorType {
107
ConfigFailed, ConfigNoPermission,
108
ConfigBadAddress, ConfigBadKey,
109
ConfigParseError, ConfigCorrupt,
110
ConfigTypeMismatch, ConfigIsDir, ConfigIsKey,
111
ConfigOverridden, ConfigLockFailed,
112
ConfigNoWritableDatabase, ConfigInShutdown
115
exception ConfigException {
116
ConfigErrorType err_no;
120
interface ConfigDatabase {
121
typedef sequence<string> KeyList;
122
typedef sequence<ConfigValue> ValueList;
123
typedef sequence<boolean> IsDefaultList;
124
typedef sequence<boolean> IsWritableList;
126
// "where" is the portion of the namespace to listen to
127
// Returns a connection ID for removal
128
unsigned long add_listener(in string where,
129
in ConfigListener who);
131
void remove_listener(in unsigned long cnxn);
133
ConfigValue lookup(in string key)
134
raises (ConfigException);
136
// separate from lookup for efficiency
137
ConfigValue lookup_with_locale(in string key,
139
in boolean use_schema_default,
140
out boolean value_is_default,
141
out boolean value_is_writable)
142
raises (ConfigException);
144
// syntactic sugar, semi-hack: should maybe use a get_metainfo()
145
// function (which we should have anyway)
146
ConfigValue lookup_default_value(in string key,
148
raises (ConfigException);
150
// Grab lots of values at once
151
void batch_lookup (in KeyList keys,
153
out ValueList values,
154
out IsDefaultList is_defaults,
155
out IsWritableList is_writables)
156
raises (ConfigException);
158
void set(in string key, in ConfigValue value)
159
raises (ConfigException);
161
void unset(in string key)
162
raises (ConfigException);
164
void unset_with_locale(in string key, in string locale)
165
raises (ConfigException);
167
// Setting to InvalidVal does an unset
168
void batch_change(in string locale, // only used for unsets
171
raises (ConfigException);
173
boolean dir_exists(in string dir)
174
raises (ConfigException);
176
void remove_dir(in string dir)
177
raises (ConfigException);
179
void all_entries(in string dir,
182
out ValueList values,
183
out IsDefaultList is_defaults,
184
out IsWritableList is_writables)
185
raises (ConfigException);
187
void all_dirs(in string dir,
189
raises (ConfigException);
191
// if first arg is a key, second arg should be a key pointing
193
// if first arg is a dir, second arg should be a key pointing
194
// to a dir full of schemas.
195
void set_schema(in string key,
196
in string schema_key)
197
raises (ConfigException);
200
raises (ConfigException);
204
void synchronous_sync()
205
raises (ConfigException);
208
interface ConfigDatabase2 : ConfigDatabase {
210
typedef sequence<string> SchemaNameList;
212
// Fixed version of lookup_with_locale that gets
213
// all the relevant information
214
ConfigValue lookup_with_schema_name (in string key,
216
in boolean use_schema_default,
217
out string schema_name,
218
out boolean value_is_default,
219
out boolean value_is_writable)
220
raises (ConfigException);
222
void all_entries_with_schema_name (in string dir,
225
out ValueList values,
226
out SchemaNameList schema_names,
227
out IsDefaultList is_defaults,
228
out IsWritableList is_writables)
229
raises (ConfigException);
232
interface ConfigDatabase3 : ConfigDatabase2 {
234
typedef sequence<ConfigStringProperty> PropList;
235
typedef long UnsetFlags;
236
const UnsetFlags UNSET_INCLUDING_SCHEMA_NAMES = 1;
238
unsigned long add_listener_with_properties (in string where,
239
in ConfigListener who,
240
in PropList properties)
241
raises (ConfigException); /* plain add_listener doesn't have this, sadly */
243
void recursive_unset (in string key,
245
raises (ConfigException);
248
interface ConfigServer {
250
ConfigDatabase get_default_database ();
252
// Use a specific address instead of the default database;
253
// invalid_context returned on failure.
254
ConfigDatabase get_database (in string address)
255
raises (ConfigException);
257
void add_client (in ConfigListener client);
258
void remove_client (in ConfigListener client);
265
interface ConfigServer2 : ConfigServer {
266
typedef sequence<string> AddressList;
268
ConfigDatabase get_database_for_addresses (in AddressList addresses);