Introduce G_PARAM_DEPRECATED and G_ENABLE_DIAGNOSTIC
[platform/upstream/glib.git] / gio / gsettings.h
index 5a70b5d..f98ecc6 100644 (file)
  * Author: Ryan Lortie <desrt@desrt.ca>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_SETTINGS_H__
 #define __G_SETTINGS_H__
 
-#include <glib-object.h>
+#include <gio/giotypes.h>
 
 G_BEGIN_DECLS
 
@@ -38,7 +42,6 @@ G_BEGIN_DECLS
 
 typedef struct _GSettingsPrivate                            GSettingsPrivate;
 typedef struct _GSettingsClass                              GSettingsClass;
-typedef struct _GSettings                                   GSettings;
 
 struct _GSettingsClass
 {
@@ -70,11 +73,10 @@ GType                   g_settings_get_type                             (void);
 GSettings *             g_settings_new                                  (const gchar        *schema);
 GSettings *             g_settings_new_with_path                        (const gchar        *schema,
                                                                          const gchar        *path);
-gboolean                g_settings_supports_context                     (const gchar        *context);
-GSettings *             g_settings_new_with_context                     (const gchar        *schema,
-                                                                         const gchar        *context);
-GSettings *             g_settings_new_with_context_and_path            (const gchar        *schema,
-                                                                         const gchar        *context,
+GSettings *             g_settings_new_with_backend                     (const gchar        *schema,
+                                                                         GSettingsBackend   *backend);
+GSettings *             g_settings_new_with_backend_and_path            (const gchar        *schema,
+                                                                         GSettingsBackend   *backend,
                                                                          const gchar        *path);
 
 gboolean                g_settings_set_value                            (GSettings          *settings,
@@ -113,13 +115,15 @@ gboolean                g_settings_set_double                           (GSettin
                                                                          const gchar        *key,
                                                                          gdouble             value);
 gchar **                g_settings_get_strv                             (GSettings          *settings,
-                                                                         const gchar        *key,
-                                                                         gsize              *length);
+                                                                         const gchar        *key);
 gboolean                g_settings_set_strv                             (GSettings          *settings,
                                                                          const gchar        *key,
-                                                                         const gchar *const *value,
-                                                                         gssize              length);
-
+                                                                         const gchar *const *value);
+gint                    g_settings_get_enum                             (GSettings          *settings,
+                                                                         const gchar        *key);
+gboolean                g_settings_set_enum                             (GSettings          *settings,
+                                                                         const gchar        *key,
+                                                                         gint                value);
 GSettings *             g_settings_get_child                            (GSettings          *settings,
                                                                          const gchar        *name);
 
@@ -130,6 +134,7 @@ void                    g_settings_delay                                (GSettin
 void                    g_settings_apply                                (GSettings          *settings);
 void                    g_settings_revert                               (GSettings          *settings);
 gboolean                g_settings_get_has_unapplied                    (GSettings          *settings);
+void                    g_settings_sync                                 (void);
 
 /**
  * GSettingsBindSetMapping:
@@ -164,9 +169,13 @@ typedef gboolean      (*GSettingsBindGetMapping)                        (GValue
 /**
  * GSettingsBindFlags:
  * @G_SETTINGS_BIND_DEFAULT: Equivalent to <literal>G_SETTINGS_BIND_GET|G_SETTINGS_BIND_SET</literal>
- * @G_SETTINGS_BIND_GET: Update the #GObject property when the #GSettings key changes
- * @G_SETTINGS_BIND_SET: Update the #GSettings key when the #GObject property changes
- * @G_SETTINGS_BIND_NO_SENSITIVITY: Do not try to bind a "sensitivity" property to #GSettings writability
+ * @G_SETTINGS_BIND_GET: Update the #GObject property when the setting changes.
+ *     It is an error to use this flag if the property is not writable.
+ * @G_SETTINGS_BIND_SET: Update the setting when the #GObject property changes.
+ *     It is an error to use this flag if the property is not readable.
+ * @G_SETTINGS_BIND_NO_SENSITIVITY: Do not try to bind a "sensitivity" property to the writability of the setting
+ * @G_SETTINGS_BIND_GET_NO_CHANGES: When set in addition to #G_SETTINGS_BIND_GET, set the #GObject property
+ *     value initially from the setting, but do not listen for changes of the setting
  *
  * Flags used when creating a binding. These flags determine in which
  * direction the binding works. The default is to synchronize in both
@@ -195,6 +204,11 @@ void                    g_settings_bind_with_mapping                    (GSettin
                                                                          GSettingsBindSetMapping  set_mapping,
                                                                          gpointer                 user_data,
                                                                          GDestroyNotify           destroy);
+void                    g_settings_bind_writable                        (GSettings               *settings,
+                                                                         const gchar             *key,
+                                                                         gpointer                 object,
+                                                                         const gchar             *property,
+                                                                         gboolean                 inverted);
 void                    g_settings_unbind                               (gpointer                 object,
                                                                          const gchar             *property);