summaryrefslogtreecommitdiff
path: root/doc/gconf/tmpl/gconf-value.sgml
blob: 4a60684f4625989cb5a95fddbac8a1df897d673f (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
<!-- ##### SECTION Title ##### -->
GConfValue, GConfEntry, GConfMetaInfo

<!-- ##### SECTION Short_Description ##### -->

A #GConfValue stores a dynamically-typed value. A #GConfEntry stores a
key-value pair.  A #GConfMetaInfo stores metainformation about a key.

<!-- ##### SECTION Long_Description ##### -->
<para>
#GConfValue stores one of the value types GConf understands; GConf
uses #GConfValue to pass values around because it doesn't know the
type of its values at compile time. 
</para>

<para>
A #GConfEntry pairs a relative key
name with a value, for example if the value "10" is stored at the key 
"/foo/bar/baz", the #GConfEntry will store "baz" and "10".
</para>

<para>
A #GConfMetaInfo object holds metainformation about a key, such as 
its last modification time and the name of the schema associated with
it. You should rarely if ever need to use #GConfMetaInfo.
(In fact you can't get the metainfo for a key using the current API.)
</para>

<!-- ##### SECTION See_Also ##### -->
<para>

</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### SECTION Image ##### -->


<!-- ##### ENUM GConfValueType ##### -->
<para>
Used to indicate the type of a #GConfValue.
</para>

@GCONF_VALUE_INVALID: Never the type of a #GConfValue obtained from GConf functions; used to indicate errors and the like.
@GCONF_VALUE_STRING: String value (#gchar*).
@GCONF_VALUE_INT: Integer value (#gint).
@GCONF_VALUE_FLOAT: Floating point value (#gdouble).
@GCONF_VALUE_BOOL: Boolean value (#gboolean).
@GCONF_VALUE_SCHEMA: Schema value (#GConfSchema).
@GCONF_VALUE_LIST: List of #GConfValue; #GConfValue elements must have
a primitive type (i.e. they may not be lists or pairs), and all elements
of a list must have the same type.
@GCONF_VALUE_PAIR: Pair of #GConfValue; the first field (car) and the second
field (cdr) may have different types. The two elements of a pair must be primitive
types, not lists or pairs.

<!-- ##### STRUCT GConfValue ##### -->
<para>
Represents a dynamically-typed value. The @type field tells you the
type of the value; the other fields should be accessed with the
accessor functions and macros.
</para>

<para>
<emphasis>A #GConfValue should always
be initialized before use. That is, you should not use a #GConfValue
unless you have called one of the functions beginning with
"gconf_value_set_".</emphasis>. For lists, initialization has two
steps: first you must set the list element type, then you must set the
list value.
</para>

@type: The #GConfValueType of this #GConfValue. The only field of
#GConfValue you should access directly.

<!-- ##### MACRO GCONF_VALUE_TYPE_VALID ##### -->
<para>

</para>

@x: 


<!-- ##### FUNCTION gconf_value_get_string ##### -->
<para>
Returns a <symbol>const gchar*</symbol> for a #GConfValue with type
%GCONF_VALUE_STRING. The returned string is <emphasis>not</emphasis> a
copy, don't try to free it. It is "owned" by the #GConfValue and will
be destroyed when the #GConfValue is destroyed.
</para>

<para>
If the #GConfValue is not initialized (i.e. no one has called
gconf_value_set_string()) then the string may be
<symbol>NULL</symbol>, but of course you should not try to use an
uninitialized #GConfValue.
</para>

@value: a #GConfValue.
@Returns: a const char*.


<!-- ##### FUNCTION gconf_value_get_int ##### -->
<para>
Returns a #gint for a #GConfValue with type %GCONF_VALUE_INT. 
</para>

@value: a #GConfValue.
@Returns: a #gint.


<!-- ##### FUNCTION gconf_value_get_float ##### -->
<para>
Returns a #gdouble for a #GConfValue with type %GCONF_VALUE_FLOAT.
</para>

@value: a #GConfValue.
@Returns: a #gdouble.


<!-- ##### FUNCTION gconf_value_get_list_type ##### -->
<para>
Returns the type of the list elements in a #GConfValue with type 
%GCONF_VALUE_LIST.
</para>

@value: a #GConfValue.
@Returns: the type of the list elements (a primitive type).


<!-- ##### FUNCTION gconf_value_get_list ##### -->
<para>

</para>

@value: 
@Returns: 


<!-- ##### FUNCTION gconf_value_get_car ##### -->
<para>
Returns the first member (car) of a #GConfValue with type
%GCONF_VALUE_PAIR. The car is another #GConfValue, with a primitive
type (bool, int, float, string, schema).
</para>

<para>
The returned value is not a copy; it is "owned" by the pair and will
be destroyed when the pair is destroyed.
</para>

@value: a #GConfValue.
@Returns: the first member of a pair, a primitive type.


<!-- ##### FUNCTION gconf_value_get_cdr ##### -->
<para>
Returns the second member (cdr) of a #GConfValue with type
%GCONF_VALUE_PAIR. The cdr is another #GConfValue, with a primitive
type (bool, int, float, string, schema).
</para>

<para>
The returned value is not a copy; it is "owned" by the pair and will
be destroyed when the pair is destroyed.
</para>

@value: a #GConfValue.
@Returns: the second member of a pair, a primitive type.


<!-- ##### FUNCTION gconf_value_get_bool ##### -->
<para>
Returns a #gboolean for a #GConfValue with type %GCONF_VALUE_BOOL. 
</para>

@value: a #GConfValue.
@Returns: a #gboolean value.


<!-- ##### FUNCTION gconf_value_get_schema ##### -->
<para>
Returns a #GConfSchema for a #GConfValue with type
%GCONF_VALUE_SCHEMA. If the #GConfValue is uninitialized, it 
may return <symbol>NULL</symbol>; but of course you should have
initialized the #GConfValue. The GConf library will not return values
with a <symbol>NULL</symbol> schema.
</para>

<para>
The returned value is not a copy; it is "owned" by the #GConfValue and will
be destroyed when the #GConfValue is destroyed.
</para>

@value: a #GConfValue.
@Returns: a #GConfSchema.


<!-- ##### FUNCTION gconf_value_new ##### -->
<para>
Creates a new #GConfValue with type @type. The type is immutable after
creation; values have a fixed type. You <emphasis>must</emphasis>
initialize the #GConfValue after creation; that is, you must set its 
value with one of the "setter" functions.
</para>

@type: type of the new #GConfValue.
@Returns: newly-allocated #GConfValue.


<!-- ##### FUNCTION gconf_value_new_from_string ##### -->
<para>
Creates a new #GConfValue with type @type and value set to the string passed.
Based on the value of @type, this function does the appropriate conversion of the
string passed to the @type, does error checks to ensure the value is valid, and
then calls the appropriate gconf_set function depending on the @type to set the value.
</para>

@type: type of the new #GConfValue.
@str: the return location for an allocated #GError, or <symbol>NULL</symbol> to ignore errors.
@err: the value to be set.
@Returns: the value to be set.


<!-- ##### FUNCTION gconf_value_copy ##### -->
<para>
Copies a #GConfValue. The copy is a deep copy, that is, any allocated
memory inside the #GConfValue will also be copied.
</para>

@src: a #GConfValue to copy.
@Returns: a newly-allocated #GConfValue identical to @src.


<!-- ##### FUNCTION gconf_value_free ##### -->
<para>
Deallocates a #GConfValue. Also deallocates any allocated memory
inside the #GConfValue (such as lists, pair members, strings, and schemas).
</para>

@value: a #GConfValue to destroy.


<!-- ##### FUNCTION gconf_value_set_int ##### -->
<para>
Sets the value of a #GConfValue with type %GCONF_VALUE_INT.
</para>

@value: a #GConfValue of type %GCONF_VALUE_INT.
@the_int: the integer.


<!-- ##### FUNCTION gconf_value_set_string ##### -->
<para>
Sets the value of a #GConfValue with type
%GCONF_VALUE_STRING. @the_str is copied.
</para>

@value: a #GConfValue of type %GCONF_VALUE_STRING.
@the_str: the string.


<!-- ##### FUNCTION gconf_value_set_float ##### -->
<para>
Sets the value of a #GConfValue with type
%GCONF_VALUE_FLOAT. 
</para>

@value: a #GConfValue of type %GCONF_VALUE_FLOAT.
@the_float: the floating point number.


<!-- ##### FUNCTION gconf_value_set_bool ##### -->
<para>
Sets the value of a #GConfValue with type
%GCONF_VALUE_BOOL. 
</para>

@value: a #GConfValue of type %GCONF_VALUE_BOOL.
@the_bool: a boolean value (<symbol>TRUE</symbol> or <symbol>FALSE</symbol>).


<!-- ##### FUNCTION gconf_value_set_schema ##### -->
<para>
Sets the value of a #GConfValue with type %GCONF_VALUE_SCHEMA. The
#GConfSchema is copied. Alternatively you can use
gconf_value_set_schema_nocopy().
</para>

@value: a #GConfValue with type %GCONF_VALUE_SCHEMA.
@sc: the #GConfSchema.


<!-- ##### FUNCTION gconf_value_set_schema_nocopy ##### -->
<para>
Sets the value of a #GConfValue with type
%GCONF_VALUE_SCHEMA. The #GConfSchema is <emphasis>not</emphasis>
copied; the #GConfValue takes ownership of it, and it should only be
accessed via the gconf_value_get_schema() macro. This function is provided 
as a more efficient version of gconf_value_set_schema().
</para>

@value: a #GConfValue with type %GCONF_VALUE_SCHEMA.
@sc: the #GConfSchema.


<!-- ##### FUNCTION gconf_value_set_car ##### -->
<para>
Sets the value of the first field (car) of a #GConfValue with type
%GCONF_VALUE_PAIR. The #GConfValue is copied. Alternatively, use
gconf_value_set_car_nocopy().
</para>

@value: a #GConfValue with type %GCONF_VALUE_PAIR.
@car: the #GConfValue to set as the car of the pair.


<!-- ##### FUNCTION gconf_value_set_car_nocopy ##### -->
<para>
Sets the value of the first field (car) of a #GConfValue with type
%GCONF_VALUE_PAIR. The #GConfValue is <emphasis>not</emphasis> copied;
the #GConfValue takes ownership of it. Alternatively, use
gconf_value_set_car().
</para>

@value: a #GConfValue with type %GCONF_VALUE_PAIR.
@car: the #GConfValue to set as the car of the pair.


<!-- ##### FUNCTION gconf_value_set_cdr ##### -->
<para>
Sets the value of the second field (cdr) of a #GConfValue with type
%GCONF_VALUE_PAIR. The #GConfValue is copied. Alternatively, use
gconf_value_set_cdr_nocopy().
</para>

@value: a #GConfValue with type %GCONF_VALUE_PAIR.
@cdr: the #GConfValue to set as the cdr of the pair.


<!-- ##### FUNCTION gconf_value_set_cdr_nocopy ##### -->
<para>
Sets the value of the second field (cdr) of a #GConfValue with type
%GCONF_VALUE_PAIR. The #GConfValue is <emphasis>not</emphasis> copied;
the #GConfValue takes ownership of it. Alternatively, use
gconf_value_set_cdr().
</para>

@value: a #GConfValue with type %GCONF_VALUE_PAIR.
@cdr: the #GConfValue to set as the cdr of the pair.


<!-- ##### FUNCTION gconf_value_set_list_type ##### -->
<para>
Sets the type of the elements in a #GConfValue of type
%GCONF_VALUE_LIST. All the elements in the list must have the same
type. You must set the list type before you can set the list value.
</para>

@value: a #GConfValue with type %GCONF_VALUE_LIST.
@type: the type of elements in this list.


<!-- ##### FUNCTION gconf_value_set_list_nocopy ##### -->
<para>
Sets the value of a #GConfValue with type %GCONF_VALUE_LIST.  The
@list argument should be a #GSList of #GConfValue. Each #GConfValue in
the list must have the same type, and this type must be specified in
advance with gconf_value_set_list_type(). This function does
<emphasis>not</emphasis> copy the list; the #GConfValue will take
ownership of the list and its contents, and they will be destroyed
when the #GConfValue is destroyed. Alternatively, use
gconf_value_set_list() to make a copy.
</para>

@value: a #GConfValue with type %GCONF_VALUE_LIST.
@list: the #GSList of #GConfValue to set as the list value.


<!-- ##### FUNCTION gconf_value_set_list ##### -->
<para>
Sets the value of a #GConfValue with type %GCONF_VALUE_LIST.  The
@list argument should be a #GSList of #GConfValue. Each #GConfValue in
the list must have the same type, and this type must be specified in
advance with gconf_value_set_list_type(). This function copies the
list; it will not modify the @list argument.
</para>

@value: a #GConfValue with type %GCONF_VALUE_LIST.
@list: the #GSList of #GConfValue to set as the list value.


<!-- ##### FUNCTION gconf_value_to_string ##### -->
<para>
Creates a human-readable string representation of a #GConfValue. This
is intended for debugging and the like; the string representation is
not suitable for reliable machine parsing (that is, you shouldn't use
this function to save a value to a file or anything like that). The
exact nature of the string representation may change in future
versions. The returned string is newly-allocated and must be freed
with g_free().
</para>

@value: a #GConfValue.
@Returns: a newly-allocated string representing the #GConfValue.


<!-- ##### STRUCT GConfMetaInfo ##### -->
<para>

</para>

@schema: 
@mod_user: 
@mod_time: 

<!-- ##### FUNCTION gconf_meta_info_new ##### -->
<para>
Creates a new #GConfMetaInfo structure and returns the newly allocated 
#GConfMetaInfo.
</para>

@void: 
@Returns: the newly allocated #GConfMetainfo.


<!-- ##### FUNCTION gconf_meta_info_free ##### -->
<para>
Frees the #GConfMetaInfo.
</para>

@gcmi: the #GConfMetaInfo to be freed.


<!-- ##### FUNCTION gconf_meta_info_get_schema ##### -->
<para>
Returns the schema field of the #GConfMetaInfo.
</para>

@gcmi: a #GConfMetaInfo.
@Returns: the schema field, a char* value.


<!-- ##### FUNCTION gconf_meta_info_get_mod_user ##### -->
<para>
Returns the user owning the daemon that made the last modification of the key.
</para>

@gcmi: a #GConfMetaInfo.
@Returns: mod_user, a char* value.


<!-- ##### FUNCTION gconf_meta_info_mod_time ##### -->
<para>
Returns the last modification time of the key.
</para>

@gcmi: a #GConfMetaInfo.
@Returns: the mod_time, a #GTime value.


<!-- ##### FUNCTION gconf_meta_info_set_schema ##### -->
<para>
Sets the schema_name field of the #GConfMetaInfo to the name passed.
</para>

@gcmi: a #GConfMetaInfo.
@schema_name: the name to be set for the schema, a gchar* value.


<!-- ##### FUNCTION gconf_meta_info_set_mod_user ##### -->
<para>
Sets the mod_user field of the #GConfMetaInfo to the user name passed.
</para>

@gcmi: a #GConfMetaInfo.
@mod_user: the value to be set, a char*.


<!-- ##### FUNCTION gconf_meta_info_set_mod_time ##### -->
<para>
Sets the mod_last field of the #GConfMetaInfo to the mod_time passed.
</para>

@gcmi: a #GConfMetaInfo.
@mod_time: a #GTime.


<!-- ##### STRUCT GConfEntry ##### -->
<para>
Stores an entry from a GConf "directory," including a key-value pair,
the name of the schema applicable to this entry, whether the value is
a default value, and whether GConf can write a new value at this
key. @key should be an absolute key, not a relative key.  (Note that
internally GConf breaks this rule sometimes; but in the public
interface, @key is always an absolute key.)  To access the key and
value, use gconf_entry_get_key() and gconf_entry_get_value().
</para>

<warning><para>Value can be <symbol>NULL</symbol>, indicating that the
value is not set.</para></warning>

@key: an absolute key name.
@value: the value.

<!-- ##### FUNCTION gconf_entry_get_key ##### -->
<para>
Accesses the @key field of a #GConfEntry. The returned key is not a
copy, and should not be freed or modified.
</para>

@entry: a #GConfEntry.
@Returns: the key , a char*.


<!-- ##### FUNCTION gconf_entry_get_value ##### -->
<para>
Accesses the @value field of a #GConfEntry. The returned value is not
a copy, and should not be freed or modified. If you have called
gconf_entry_steal_value(), the returned value will be
<symbol>NULL</symbol>.
</para>

@entry: a #GConfEntry.
@Returns: a #GConfValue.


<!-- ##### FUNCTION gconf_entry_get_schema_name ##### -->
<para>
Returns the schema_name field of the #GConfEntry. 
</para>

@entry: a #GConfEntry.
@Returns: the schema_name , a char* value.


<!-- ##### FUNCTION gconf_entry_get_is_default ##### -->
<para>
Returns the is_default field of the #GConfEntry , a gboolean value.
</para>

@entry: a #GConfEntry.
@Returns: a #gboolean value.


<!-- ##### FUNCTION gconf_entry_get_is_writable ##### -->
<para>
Returns the is_writable field of the #GConfEntry, a gboolean value.
</para>

@entry: a #GConfEntry.
@Returns: a #gboolean value.


<!-- ##### FUNCTION gconf_entry_new ##### -->
<para>
Creates a new #GConfEntry with key @key and value @val calling gconf_entry_new_nocopy ().
</para>

@key: the key name.
@val: the value.
@Returns: a new #GConfEntry.


<!-- ##### FUNCTION gconf_entry_new_nocopy ##### -->
<para>
Creates a new #GConfEntry with key @key and value @val. @key should be a full
path to the key, starting with '/'. Neither the key nor the value is copied;
both are freed when the #GConfEntry is freed. The string will be freed with
g_free() so should be allocated with a GLib function, not malloc().
</para>

@key: the key name.
@val: the value.
@Returns: a new #GConfEntry.


<!-- ##### FUNCTION gconf_entry_copy ##### -->
<para>
Copies the fields of an existing #GConfEntry and returns the new #GConfEntry.
</para>

@src: the #GConfEntry to be copied.
@Returns: the new #GConfEntry.


<!-- ##### FUNCTION gconf_entry_free ##### -->
<para>
Destroys a #GConfEntry, freeing the key, the value, and the entry itself.
</para>

@entry: a #GConfEntry to free.


<!-- ##### FUNCTION gconf_entry_ref ##### -->
<para>
Increases the refcount of a #GConfEntry by one.
</para>

@entry: a #GConfEntry.
@Returns: the referenced #GConfEntry.


<!-- ##### FUNCTION gconf_entry_unref ##### -->
<para>
Decreases the refcount of a #GConfEntry by one and  frees the
#GConfEntry when the refcount becomes zero.
</para>

@entry: a #GConfEntry.


<!-- ##### FUNCTION gconf_entry_steal_value ##### -->
<para>
Extracts the value from a #GConfEntry, leaving the @value field in
#GConfEntry set to <symbol>NULL</symbol>. Destroying the #GConfEntry
will <emphasis>not</emphasis> destroy the value; the caller of
gconf_entry_steal_value() assumes ownership of it.
</para>

@entry: a #GConfEntry.
@Returns: a #GConfValue that the caller must free.


<!-- ##### FUNCTION gconf_entry_set_value ##### -->
<para>
Sets the value field of the #GConfEntry to the #GConfValue passed.
</para>

@entry: a #GConfEntry.
@val: a #GConfValue.


<!-- ##### FUNCTION gconf_entry_set_value_nocopy ##### -->
<para>
Sets the value field to @val after freeing the already existing value.
</para>

@entry: a #GConfEntry.
@val: the #GConfValue to be set.


<!-- ##### FUNCTION gconf_entry_set_schema_name ##### -->
<para>
Sets the schema_name field of the #GConfEntry to the name passed after freeing
the already existing name.
</para>

@entry: a #GConfEntry.
@name: the name to be set for the schema, a gchar* value.


<!-- ##### FUNCTION gconf_entry_set_is_default ##### -->
<para>
Sets the is_default field of the #GConfEntry to the boolean value passed.
</para>

@entry: a #GConfEntry.
@is_default: the boolean value to be set.


<!-- ##### FUNCTION gconf_entry_set_is_writable ##### -->
<para>
Sets the is_writable field of the #GConfEntry to the boolean value passed.
</para>

@entry: a #GConfEntry.
@is_writable: a boolean value.