File indexing completed on 2025-01-18 09:59:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef __G_SETTINGS_H__
0023 #define __G_SETTINGS_H__
0024
0025 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0026 #error "Only <gio/gio.h> can be included directly."
0027 #endif
0028
0029 #include <gio/gsettingsschema.h>
0030 #include <gio/giotypes.h>
0031
0032 G_BEGIN_DECLS
0033
0034 #define G_TYPE_SETTINGS (g_settings_get_type ())
0035 #define G_SETTINGS(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
0036 G_TYPE_SETTINGS, GSettings))
0037 #define G_SETTINGS_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
0038 G_TYPE_SETTINGS, GSettingsClass))
0039 #define G_IS_SETTINGS(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_SETTINGS))
0040 #define G_IS_SETTINGS_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_SETTINGS))
0041 #define G_SETTINGS_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
0042 G_TYPE_SETTINGS, GSettingsClass))
0043
0044 typedef struct _GSettingsPrivate GSettingsPrivate;
0045 typedef struct _GSettingsClass GSettingsClass;
0046
0047 struct _GSettingsClass
0048 {
0049 GObjectClass parent_class;
0050
0051
0052 void (*writable_changed) (GSettings *settings,
0053 const gchar *key);
0054 void (*changed) (GSettings *settings,
0055 const gchar *key);
0056 gboolean (*writable_change_event) (GSettings *settings,
0057 GQuark key);
0058 gboolean (*change_event) (GSettings *settings,
0059 const GQuark *keys,
0060 gint n_keys);
0061
0062 gpointer padding[20];
0063 };
0064
0065 struct _GSettings
0066 {
0067 GObject parent_instance;
0068 GSettingsPrivate *priv;
0069 };
0070
0071
0072 GIO_AVAILABLE_IN_ALL
0073 GType g_settings_get_type (void);
0074
0075 GIO_DEPRECATED_IN_2_40_FOR(g_settings_schema_source_list_schemas)
0076 const gchar * const * g_settings_list_schemas (void);
0077 GIO_DEPRECATED_IN_2_40_FOR(g_settings_schema_source_list_schemas)
0078 const gchar * const * g_settings_list_relocatable_schemas (void);
0079 GIO_AVAILABLE_IN_ALL
0080 GSettings * g_settings_new (const gchar *schema_id);
0081 GIO_AVAILABLE_IN_ALL
0082 GSettings * g_settings_new_with_path (const gchar *schema_id,
0083 const gchar *path);
0084 GIO_AVAILABLE_IN_ALL
0085 GSettings * g_settings_new_with_backend (const gchar *schema_id,
0086 GSettingsBackend *backend);
0087 GIO_AVAILABLE_IN_ALL
0088 GSettings * g_settings_new_with_backend_and_path (const gchar *schema_id,
0089 GSettingsBackend *backend,
0090 const gchar *path);
0091 GIO_AVAILABLE_IN_2_32
0092 GSettings * g_settings_new_full (GSettingsSchema *schema,
0093 GSettingsBackend *backend,
0094 const gchar *path);
0095 GIO_AVAILABLE_IN_ALL
0096 gchar ** g_settings_list_children (GSettings *settings);
0097 GIO_DEPRECATED_IN_2_46_FOR(g_settings_schema_list_keys)
0098 gchar ** g_settings_list_keys (GSettings *settings);
0099 GIO_DEPRECATED_IN_2_40_FOR(g_settings_schema_key_get_range)
0100 GVariant * g_settings_get_range (GSettings *settings,
0101 const gchar *key);
0102 GIO_DEPRECATED_IN_2_40_FOR(g_settings_schema_key_range_check)
0103 gboolean g_settings_range_check (GSettings *settings,
0104 const gchar *key,
0105 GVariant *value);
0106
0107 GIO_AVAILABLE_IN_ALL
0108 gboolean g_settings_set_value (GSettings *settings,
0109 const gchar *key,
0110 GVariant *value);
0111 GIO_AVAILABLE_IN_ALL
0112 GVariant * g_settings_get_value (GSettings *settings,
0113 const gchar *key);
0114
0115 GIO_AVAILABLE_IN_2_40
0116 GVariant * g_settings_get_user_value (GSettings *settings,
0117 const gchar *key);
0118 GIO_AVAILABLE_IN_2_40
0119 GVariant * g_settings_get_default_value (GSettings *settings,
0120 const gchar *key);
0121
0122 GIO_AVAILABLE_IN_ALL
0123 gboolean g_settings_set (GSettings *settings,
0124 const gchar *key,
0125 const gchar *format,
0126 ...);
0127 GIO_AVAILABLE_IN_ALL
0128 void g_settings_get (GSettings *settings,
0129 const gchar *key,
0130 const gchar *format,
0131 ...);
0132 GIO_AVAILABLE_IN_ALL
0133 void g_settings_reset (GSettings *settings,
0134 const gchar *key);
0135
0136 GIO_AVAILABLE_IN_ALL
0137 gint g_settings_get_int (GSettings *settings,
0138 const gchar *key);
0139 GIO_AVAILABLE_IN_ALL
0140 gboolean g_settings_set_int (GSettings *settings,
0141 const gchar *key,
0142 gint value);
0143 GIO_AVAILABLE_IN_2_50
0144 gint64 g_settings_get_int64 (GSettings *settings,
0145 const gchar *key);
0146 GIO_AVAILABLE_IN_2_50
0147 gboolean g_settings_set_int64 (GSettings *settings,
0148 const gchar *key,
0149 gint64 value);
0150 GIO_AVAILABLE_IN_2_32
0151 guint g_settings_get_uint (GSettings *settings,
0152 const gchar *key);
0153 GIO_AVAILABLE_IN_2_32
0154 gboolean g_settings_set_uint (GSettings *settings,
0155 const gchar *key,
0156 guint value);
0157 GIO_AVAILABLE_IN_2_50
0158 guint64 g_settings_get_uint64 (GSettings *settings,
0159 const gchar *key);
0160 GIO_AVAILABLE_IN_2_50
0161 gboolean g_settings_set_uint64 (GSettings *settings,
0162 const gchar *key,
0163 guint64 value);
0164 GIO_AVAILABLE_IN_ALL
0165 gchar * g_settings_get_string (GSettings *settings,
0166 const gchar *key);
0167 GIO_AVAILABLE_IN_ALL
0168 gboolean g_settings_set_string (GSettings *settings,
0169 const gchar *key,
0170 const gchar *value);
0171 GIO_AVAILABLE_IN_ALL
0172 gboolean g_settings_get_boolean (GSettings *settings,
0173 const gchar *key);
0174 GIO_AVAILABLE_IN_ALL
0175 gboolean g_settings_set_boolean (GSettings *settings,
0176 const gchar *key,
0177 gboolean value);
0178 GIO_AVAILABLE_IN_ALL
0179 gdouble g_settings_get_double (GSettings *settings,
0180 const gchar *key);
0181 GIO_AVAILABLE_IN_ALL
0182 gboolean g_settings_set_double (GSettings *settings,
0183 const gchar *key,
0184 gdouble value);
0185 GIO_AVAILABLE_IN_ALL
0186 gchar ** g_settings_get_strv (GSettings *settings,
0187 const gchar *key);
0188 GIO_AVAILABLE_IN_ALL
0189 gboolean g_settings_set_strv (GSettings *settings,
0190 const gchar *key,
0191 const gchar *const *value);
0192 GIO_AVAILABLE_IN_ALL
0193 gint g_settings_get_enum (GSettings *settings,
0194 const gchar *key);
0195 GIO_AVAILABLE_IN_ALL
0196 gboolean g_settings_set_enum (GSettings *settings,
0197 const gchar *key,
0198 gint value);
0199 GIO_AVAILABLE_IN_ALL
0200 guint g_settings_get_flags (GSettings *settings,
0201 const gchar *key);
0202 GIO_AVAILABLE_IN_ALL
0203 gboolean g_settings_set_flags (GSettings *settings,
0204 const gchar *key,
0205 guint value);
0206 GIO_AVAILABLE_IN_ALL
0207 GSettings * g_settings_get_child (GSettings *settings,
0208 const gchar *name);
0209
0210 GIO_AVAILABLE_IN_ALL
0211 gboolean g_settings_is_writable (GSettings *settings,
0212 const gchar *name);
0213
0214 GIO_AVAILABLE_IN_ALL
0215 void g_settings_delay (GSettings *settings);
0216 GIO_AVAILABLE_IN_ALL
0217 void g_settings_apply (GSettings *settings);
0218 GIO_AVAILABLE_IN_ALL
0219 void g_settings_revert (GSettings *settings);
0220 GIO_AVAILABLE_IN_ALL
0221 gboolean g_settings_get_has_unapplied (GSettings *settings);
0222 GIO_AVAILABLE_IN_ALL
0223 void g_settings_sync (void);
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237 typedef GVariant * (*GSettingsBindSetMapping) (const GValue *value,
0238 const GVariantType *expected_type,
0239 gpointer user_data);
0240
0241
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252
0253 typedef gboolean (*GSettingsBindGetMapping) (GValue *value,
0254 GVariant *variant,
0255 gpointer user_data);
0256
0257
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277 typedef gboolean (*GSettingsGetMapping) (GVariant *value,
0278 gpointer *result,
0279 gpointer user_data);
0280
0281
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299 typedef enum
0300 {
0301 G_SETTINGS_BIND_DEFAULT,
0302 G_SETTINGS_BIND_GET = (1<<0),
0303 G_SETTINGS_BIND_SET = (1<<1),
0304 G_SETTINGS_BIND_NO_SENSITIVITY = (1<<2),
0305 G_SETTINGS_BIND_GET_NO_CHANGES = (1<<3),
0306 G_SETTINGS_BIND_INVERT_BOOLEAN = (1<<4)
0307 } GSettingsBindFlags;
0308
0309 GIO_AVAILABLE_IN_ALL
0310 void g_settings_bind (GSettings *settings,
0311 const gchar *key,
0312 gpointer object,
0313 const gchar *property,
0314 GSettingsBindFlags flags);
0315 GIO_AVAILABLE_IN_ALL
0316 void g_settings_bind_with_mapping (GSettings *settings,
0317 const gchar *key,
0318 gpointer object,
0319 const gchar *property,
0320 GSettingsBindFlags flags,
0321 GSettingsBindGetMapping get_mapping,
0322 GSettingsBindSetMapping set_mapping,
0323 gpointer user_data,
0324 GDestroyNotify destroy);
0325 GIO_AVAILABLE_IN_2_82
0326 void g_settings_bind_with_mapping_closures (GSettings *settings,
0327 const char *key,
0328 GObject *object,
0329 const char *property,
0330 GSettingsBindFlags flags,
0331 GClosure *get_mapping,
0332 GClosure *set_mapping);
0333 GIO_AVAILABLE_IN_ALL
0334 void g_settings_bind_writable (GSettings *settings,
0335 const gchar *key,
0336 gpointer object,
0337 const gchar *property,
0338 gboolean inverted);
0339 GIO_AVAILABLE_IN_ALL
0340 void g_settings_unbind (gpointer object,
0341 const gchar *property);
0342
0343 GIO_AVAILABLE_IN_2_32
0344 GAction * g_settings_create_action (GSettings *settings,
0345 const gchar *key);
0346
0347 GIO_AVAILABLE_IN_ALL
0348 gpointer g_settings_get_mapped (GSettings *settings,
0349 const gchar *key,
0350 GSettingsGetMapping mapping,
0351 gpointer user_data);
0352
0353 G_END_DECLS
0354
0355 #endif