~ubuntu-branches/ubuntu/quantal/gconf/quantal

« back to all changes in this revision

Viewing changes to gconf/GConfX.idl

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette
  • Date: 2007-11-01 18:47:26 UTC
  • mto: (7.1.1 lenny) (1.2.1) (76.1.1 oneiric-proposed)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20071101184726-e3e4cxfcp41tz6ui
Tags: upstream-2.20.1
ImportĀ upstreamĀ versionĀ 2.20.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
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 
 
4
// like it. So there.
 
5
 
 
6
enum ConfigBasicValueType { BInvalidVal, BIntVal, BStringVal, BFloatVal, BBoolVal, BSchemaVal };
 
7
 
 
8
enum ConfigValueType { InvalidVal, IntVal, StringVal, FloatVal, BoolVal, SchemaVal, ListVal, PairVal };
 
9
 
 
10
struct ConfigSchema {
 
11
  ConfigValueType value_type;
 
12
  ConfigValueType value_list_type;
 
13
  ConfigValueType value_car_type;
 
14
  ConfigValueType value_cdr_type;
 
15
  string locale;
 
16
  string short_desc;
 
17
  string long_desc;
 
18
  string owner;
 
19
  // Work around lack of recursive data types
 
20
  string encoded_default_value;
 
21
};
 
22
 
 
23
union ConfigBasicValue switch (ConfigBasicValueType) {
 
24
 case BInvalidVal:
 
25
   long dummy;
 
26
 case BIntVal: 
 
27
   long int_value;
 
28
 case BStringVal:
 
29
   string string_value;
 
30
 case BFloatVal:
 
31
   float float_value;
 
32
 case BBoolVal:
 
33
   boolean bool_value;
 
34
   // hope this doesn't slow down transmission of smaller types 
 
35
 case BSchemaVal:
 
36
   ConfigSchema schema_value;
 
37
};
 
38
 
 
39
typedef sequence<ConfigBasicValue> BasicValueList;
 
40
 
 
41
struct ConfigList {
 
42
  BasicValueList seq;
 
43
  ConfigBasicValueType list_type;
 
44
};
 
45
 
 
46
union ConfigValue switch (ConfigValueType) {
 
47
 case InvalidVal:
 
48
   long dummy;
 
49
 case IntVal:
 
50
   long int_value;
 
51
 case StringVal:
 
52
   string string_value;
 
53
 case FloatVal:
 
54
   float float_value;
 
55
 case BoolVal:
 
56
   boolean bool_value;
 
57
 case SchemaVal:
 
58
   ConfigSchema schema_value;
 
59
 case ListVal:
 
60
   ConfigList list_value;
 
61
 case PairVal:
 
62
   BasicValueList pair_value;
 
63
};
 
64
 
 
65
struct ConfigStringProperty
 
66
{
 
67
  string key;
 
68
  string value;
 
69
};
 
70
 
 
71
interface ConfigDatabase;
 
72
 
 
73
interface ConfigListener {
 
74
  typedef sequence<string> KeyList;
 
75
  
 
76
  oneway void notify (in ConfigDatabase database,
 
77
                      in unsigned long cnxn,
 
78
                      in string key,
 
79
                      in ConfigValue value,
 
80
                      in boolean is_default,
 
81
                      in boolean is_writable);
 
82
 
 
83
  oneway void ping ();
 
84
 
 
85
  /// This should conceivably not be oneway.
 
86
  /// I'm worried about the server blocking waiting for
 
87
  /// busy clients.
 
88
 
 
89
  oneway void update_listener (in ConfigDatabase database,
 
90
                               in string db_address,
 
91
                               in unsigned long old_cnxn,
 
92
                               in string where,
 
93
                               in unsigned long new_cnxn);
 
94
  
 
95
  oneway void invalidate_cached_values (in ConfigDatabase database,
 
96
                                        in KeyList keys);
 
97
  
 
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 ();
 
101
};
 
102
 
 
103
// Sync this with GConfErrNo in gconf.h, when it makes sense
 
104
// (e.g. G_CONF_NO_SERVER doesn't make sense here)
 
105
 
 
106
enum ConfigErrorType {
 
107
  ConfigFailed, ConfigNoPermission,
 
108
  ConfigBadAddress, ConfigBadKey,
 
109
  ConfigParseError, ConfigCorrupt,
 
110
  ConfigTypeMismatch, ConfigIsDir, ConfigIsKey,
 
111
  ConfigOverridden, ConfigLockFailed,
 
112
  ConfigNoWritableDatabase, ConfigInShutdown
 
113
};
 
114
 
 
115
exception ConfigException {
 
116
  ConfigErrorType err_no;
 
117
  string message;
 
118
};
 
119
 
 
120
interface ConfigDatabase {
 
121
  typedef sequence<string> KeyList;
 
122
  typedef sequence<ConfigValue> ValueList;
 
123
  typedef sequence<boolean> IsDefaultList;
 
124
  typedef sequence<boolean> IsWritableList;
 
125
  
 
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);  
 
130
 
 
131
  void remove_listener(in unsigned long cnxn);
 
132
  
 
133
  ConfigValue lookup(in string key)
 
134
    raises (ConfigException);
 
135
 
 
136
  // separate from lookup for efficiency
 
137
  ConfigValue lookup_with_locale(in string key,
 
138
                                 in string locale,
 
139
                                 in boolean use_schema_default,
 
140
                                 out boolean value_is_default,
 
141
                                 out boolean value_is_writable)
 
142
    raises (ConfigException);
 
143
 
 
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,
 
147
                                   in string locale)
 
148
    raises (ConfigException);
 
149
 
 
150
  // Grab lots of values at once
 
151
  void batch_lookup (in KeyList keys,
 
152
                     in string locale,
 
153
                     out ValueList values,
 
154
                     out IsDefaultList is_defaults,
 
155
                     out IsWritableList is_writables)
 
156
    raises (ConfigException);
 
157
  
 
158
  void set(in string key, in ConfigValue value)
 
159
    raises (ConfigException);
 
160
  
 
161
  void unset(in string key)
 
162
    raises (ConfigException);
 
163
 
 
164
  void unset_with_locale(in string key, in string locale)
 
165
    raises (ConfigException);
 
166
 
 
167
  // Setting to InvalidVal does an unset
 
168
  void batch_change(in string locale, // only used for unsets 
 
169
                    in KeyList keys,
 
170
                    in ValueList values)
 
171
    raises (ConfigException);
 
172
  
 
173
  boolean dir_exists(in string dir)
 
174
    raises (ConfigException);
 
175
 
 
176
  void remove_dir(in string dir)
 
177
    raises (ConfigException);
 
178
 
 
179
  void all_entries(in string dir,
 
180
                   in string locale,
 
181
                   out KeyList keys,
 
182
                   out ValueList values,
 
183
                   out IsDefaultList is_defaults,
 
184
                   out IsWritableList is_writables)
 
185
    raises (ConfigException);
 
186
 
 
187
  void all_dirs(in string dir,
 
188
                out KeyList subdirs)
 
189
    raises (ConfigException);
 
190
  
 
191
  // if first arg is a key, second arg should be a key pointing
 
192
  //  to a schema. 
 
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);
 
198
 
 
199
  void sync()
 
200
    raises (ConfigException);
 
201
 
 
202
  void clear_cache();
 
203
  
 
204
  void synchronous_sync()
 
205
    raises (ConfigException);
 
206
};
 
207
 
 
208
interface ConfigDatabase2 : ConfigDatabase {
 
209
 
 
210
  typedef sequence<string> SchemaNameList;
 
211
  
 
212
  // Fixed version of lookup_with_locale that gets
 
213
  // all the relevant information
 
214
  ConfigValue lookup_with_schema_name (in string key,
 
215
                                       in string locale,
 
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);
 
221
  
 
222
  void all_entries_with_schema_name (in string dir,
 
223
                                     in string locale,
 
224
                                     out KeyList keys,
 
225
                                     out ValueList values,
 
226
                                     out SchemaNameList schema_names,
 
227
                                     out IsDefaultList is_defaults,
 
228
                                     out IsWritableList is_writables)
 
229
    raises (ConfigException);  
 
230
};
 
231
 
 
232
interface ConfigDatabase3 : ConfigDatabase2 {
 
233
 
 
234
  typedef sequence<ConfigStringProperty> PropList;
 
235
  typedef long UnsetFlags;
 
236
  const UnsetFlags UNSET_INCLUDING_SCHEMA_NAMES = 1;
 
237
  
 
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 */
 
242
  
 
243
  void recursive_unset (in string key,
 
244
                        in UnsetFlags flags)
 
245
    raises (ConfigException);
 
246
};
 
247
 
 
248
interface ConfigServer {
 
249
 
 
250
  ConfigDatabase get_default_database ();
 
251
 
 
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);
 
256
 
 
257
  void add_client (in ConfigListener client);
 
258
  void remove_client (in ConfigListener client);
 
259
  
 
260
  long ping();
 
261
 
 
262
  void shutdown();
 
263
};
 
264
 
 
265
interface ConfigServer2 : ConfigServer {
 
266
  typedef sequence<string> AddressList;
 
267
 
 
268
  ConfigDatabase get_database_for_addresses (in AddressList addresses);
 
269
};