hook gvariant vectors up to kdbus
[platform/upstream/glib.git] / gio / gsettingsbackend.h
index aa46223..fbec206 100644 (file)
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  *
  * Authors: Ryan Lortie <desrt@desrt.ca>
  *          Matthias Clasen <mclasen@redhat.com>
@@ -28,7 +26,9 @@
 #error "You must define G_SETTINGS_ENABLE_BACKEND before including <gio/gsettingsbackend.h>."
 #endif
 
-#include <glib-object.h>
+#define __GIO_GIO_H_INSIDE__
+#include <gio/giotypes.h>
+#undef __GIO_GIO_H_INSIDE__
 
 G_BEGIN_DECLS
 
@@ -58,44 +58,44 @@ G_BEGIN_DECLS
  **/
 typedef struct _GSettingsBackendPrivate                     GSettingsBackendPrivate;
 typedef struct _GSettingsBackendClass                       GSettingsBackendClass;
-typedef struct _GSettingsBackend                            GSettingsBackend;
-
 
 struct _GSettingsBackendClass
 {
   GObjectClass parent_class;
 
-  gboolean    (*supports_context) (const gchar        *context);
-
-  GVariant *  (*read)             (GSettingsBackend   *backend,
-                                   const gchar        *key,
-                                   const GVariantType *expected_type,
-                                   gboolean            default_value);
-  gchar **    (*list)             (GSettingsBackend   *backend,
-                                   const gchar        *path,
-                                   gsize              *length);
-  gboolean    (*write)            (GSettingsBackend   *backend,
-                                   const gchar        *key,
-                                   GVariant           *value,
-                                   gpointer            origin_tag);
-  gboolean    (*write_keys)       (GSettingsBackend   *backend,
-                                   GTree              *tree,
-                                   gpointer            origin_tag);
-  void        (*reset)            (GSettingsBackend   *backend,
-                                   const gchar        *key,
-                                   gpointer            origin_tag);
-  void        (*reset_path)       (GSettingsBackend   *backend,
-                                   const gchar        *path,
-                                   gpointer            origin_tag);
-  gboolean    (*get_writable)     (GSettingsBackend   *backend,
-                                   const gchar        *key);
-  void        (*subscribe)        (GSettingsBackend   *backend,
-                                   const gchar        *name);
-  void        (*unsubscribe)      (GSettingsBackend   *backend,
-                                   const gchar        *name);
-  void        (*sync)             (GSettingsBackend   *backend);
-
-  gpointer padding[8];
+  GVariant *    (*read)             (GSettingsBackend    *backend,
+                                     const gchar         *key,
+                                     const GVariantType  *expected_type,
+                                     gboolean             default_value);
+
+  gboolean      (*get_writable)     (GSettingsBackend    *backend,
+                                     const gchar         *key);
+
+  gboolean      (*write)            (GSettingsBackend    *backend,
+                                     const gchar         *key,
+                                     GVariant            *value,
+                                     gpointer             origin_tag);
+  gboolean      (*write_tree)       (GSettingsBackend    *backend,
+                                     GTree               *tree,
+                                     gpointer             origin_tag);
+  void          (*reset)            (GSettingsBackend    *backend,
+                                     const gchar         *key,
+                                     gpointer             origin_tag);
+
+  void          (*subscribe)        (GSettingsBackend    *backend,
+                                     const gchar         *name);
+  void          (*unsubscribe)      (GSettingsBackend    *backend,
+                                     const gchar         *name);
+  void          (*sync)             (GSettingsBackend    *backend);
+
+  GPermission * (*get_permission)   (GSettingsBackend    *backend,
+                                     const gchar         *path);
+
+  GVariant *    (*read_user_value)  (GSettingsBackend    *backend,
+                                     const gchar         *key,
+                                     const GVariantType  *expected_type);
+
+  gpointer padding[23];
 };
 
 struct _GSettingsBackend
@@ -106,36 +106,53 @@ struct _GSettingsBackend
   GSettingsBackendPrivate *priv;
 };
 
-GType                           g_settings_backend_get_type             (void);
-
-void                            g_settings_backend_setup                (const gchar         *context,
-                                                                         GSettingsBackend    *backend);
-void                            g_settings_backend_setup_keyfile        (const gchar         *context,
-                                                                         const gchar         *filename);
+GLIB_AVAILABLE_IN_ALL
+GType                   g_settings_backend_get_type                     (void);
 
-void                            g_settings_backend_changed              (GSettingsBackend    *backend,
+GLIB_AVAILABLE_IN_ALL
+void                    g_settings_backend_changed                      (GSettingsBackend    *backend,
                                                                          const gchar         *key,
                                                                          gpointer             origin_tag);
-void                            g_settings_backend_path_changed         (GSettingsBackend    *backend,
+GLIB_AVAILABLE_IN_ALL
+void                    g_settings_backend_path_changed                 (GSettingsBackend    *backend,
                                                                          const gchar         *path,
                                                                          gpointer             origin_tag);
-void                            g_settings_backend_flatten_tree         (GTree               *tree,
+GLIB_AVAILABLE_IN_ALL
+void                    g_settings_backend_flatten_tree                 (GTree               *tree,
                                                                          gchar              **path,
                                                                          const gchar       ***keys,
                                                                          GVariant          ***values);
-void                            g_settings_backend_keys_changed         (GSettingsBackend    *backend,
+GLIB_AVAILABLE_IN_ALL
+void                    g_settings_backend_keys_changed                 (GSettingsBackend    *backend,
                                                                          const gchar         *path,
                                                                          gchar const * const *items,
                                                                          gpointer             origin_tag);
 
-void                            g_settings_backend_path_writable_changed(GSettingsBackend    *backend,
+GLIB_AVAILABLE_IN_ALL
+void                    g_settings_backend_path_writable_changed        (GSettingsBackend    *backend,
                                                                          const gchar         *path);
-void                            g_settings_backend_writable_changed     (GSettingsBackend    *backend,
+GLIB_AVAILABLE_IN_ALL
+void                    g_settings_backend_writable_changed             (GSettingsBackend    *backend,
                                                                          const gchar         *key);
-void                            g_settings_backend_changed_tree         (GSettingsBackend    *backend,
+GLIB_AVAILABLE_IN_ALL
+void                    g_settings_backend_changed_tree                 (GSettingsBackend    *backend,
                                                                          GTree               *tree,
                                                                          gpointer             origin_tag);
 
+GLIB_AVAILABLE_IN_ALL
+GSettingsBackend *      g_settings_backend_get_default                  (void);
+
+GLIB_AVAILABLE_IN_ALL
+GSettingsBackend *      g_keyfile_settings_backend_new                  (const gchar         *filename,
+                                                                         const gchar         *root_path,
+                                                                         const gchar         *root_group);
+
+GLIB_AVAILABLE_IN_ALL
+GSettingsBackend *      g_null_settings_backend_new                     (void);
+
+GLIB_AVAILABLE_IN_ALL
+GSettingsBackend *      g_memory_settings_backend_new                   (void);
+
 G_END_DECLS
 
 #endif /* __G_SETTINGS_BACKEND_H__ */