add a way to create a GAction from GSettings
[platform/upstream/glib.git] / gio / gsettings.h
index 8db2f75..5c18842 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef __G_SETTINGS_H__
 #define __G_SETTINGS_H__
 
+#include <gio/gsettingsschema.h>
 #include <gio/giotypes.h>
 
 G_BEGIN_DECLS
@@ -72,12 +73,15 @@ GType                   g_settings_get_type                             (void);
 
 const gchar * const *   g_settings_list_schemas                         (void);
 const gchar * const *   g_settings_list_relocatable_schemas             (void);
-GSettings *             g_settings_new                                  (const gchar        *schema);
-GSettings *             g_settings_new_with_path                        (const gchar        *schema,
+GSettings *             g_settings_new                                  (const gchar        *schema_id);
+GSettings *             g_settings_new_with_path                        (const gchar        *schema_id,
                                                                          const gchar        *path);
-GSettings *             g_settings_new_with_backend                     (const gchar        *schema,
+GSettings *             g_settings_new_with_backend                     (const gchar        *schema_id,
                                                                          GSettingsBackend   *backend);
-GSettings *             g_settings_new_with_backend_and_path            (const gchar        *schema,
+GSettings *             g_settings_new_with_backend_and_path            (const gchar        *schema_id,
+                                                                         GSettingsBackend   *backend,
+                                                                         const gchar        *path);
+GSettings *             g_settings_new_full                             (GSettingsSchema    *schema,
                                                                          GSettingsBackend   *backend,
                                                                          const gchar        *path);
 gchar **                g_settings_list_children                        (GSettings          *settings);
@@ -162,11 +166,12 @@ void                    g_settings_sync                                 (void);
  * @value: a #GValue containing the property value to map
  * @expected_type: the #GVariantType to create
  * @user_data: user data that was specified when the binding was created
- * @returns: a new #GVariant holding the data from @value,
- *     or %NULL in case of an error
  *
  * The type for the function that is used to convert an object property
  * value to a #GVariant for storing it in #GSettings.
+ *
+ * Returns: a new #GVariant holding the data from @value,
+ *     or %NULL in case of an error
  */
 typedef GVariant *    (*GSettingsBindSetMapping)                        (const GValue       *value,
                                                                          const GVariantType *expected_type,
@@ -177,11 +182,12 @@ typedef GVariant *    (*GSettingsBindSetMapping)                        (const G
  * @value: return location for the property value
  * @variant: the #GVariant
  * @user_data: user data that was specified when the binding was created
- * @returns: %TRUE if the conversion succeeded, %FALSE in case of an error
  *
  * The type for the function that is used to convert from #GSettings to
  * an object property. The @value is already initialized to hold values
  * of the appropriate type.
+ *
+ * Returns: %TRUE if the conversion succeeded, %FALSE in case of an error
  */
 typedef gboolean      (*GSettingsBindGetMapping)                        (GValue             *value,
                                                                          GVariant           *variant,
@@ -193,7 +199,6 @@ typedef gboolean      (*GSettingsBindGetMapping)                        (GValue
  * @result: (out): the result of the mapping
  * @user_data: (closure): the user data that was passed to
  * g_settings_get_mapped()
- * @returns: %TRUE if the conversion succeeded, %FALSE in case of an error
  *
  * The type of the function that is used to convert from a value stored
  * in a #GSettings to a value that is useful to the application.
@@ -205,6 +210,8 @@ typedef gboolean      (*GSettingsBindGetMapping)                        (GValue
  * If @value is %NULL then it means that the mapping function is being
  * given a "last chance" to successfully return a valid value.  %TRUE
  * must be returned in this case.
+ *
+ * Returns: %TRUE if the conversion succeeded, %FALSE in case of an error
  **/
 typedef gboolean      (*GSettingsGetMapping)                            (GVariant           *value,
                                                                          gpointer           *result,
@@ -260,6 +267,9 @@ void                    g_settings_bind_writable                        (GSettin
 void                    g_settings_unbind                               (gpointer                 object,
                                                                          const gchar             *property);
 
+GAction *               g_settings_create_action                        (GSettings               *settings,
+                                                                         const gchar             *key);
+
 gpointer                g_settings_get_mapped                           (GSettings               *settings,
                                                                          const gchar             *key,
                                                                          GSettingsGetMapping      mapping,