2 * Copyright © 2010 Codethink Limited
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the licence, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 * Author: Ryan Lortie <desrt@desrt.ca>
20 #ifndef __dconf_writer_h__
21 #define __dconf_writer_h__
25 #include <gobject/gobject.h>
27 #include "../common/dconf-changeset.h"
28 #include "dconf-generated.h"
30 #define DCONF_TYPE_WRITER (dconf_writer_get_type ())
31 #define DCONF_WRITER(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
32 DCONF_TYPE_WRITER, DConfWriter))
33 #define DCONF_WRITER_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
34 DCONF_TYPE_WRITER, DConfWriterClass))
35 #define DCONF_IS_WRITER(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
37 #define DCONF_IS_WRITER_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
39 #define DCONF_WRITER_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
40 DCONF_TYPE_WRITER, DConfWriterClass))
42 typedef struct _DConfWriterPrivate DConfWriterPrivate
;
43 typedef struct _DConfWriterClass DConfWriterClass
;
44 typedef struct _DConfWriter DConfWriter
;
46 struct _DConfWriterClass
48 DConfDBusWriterSkeletonClass parent_instance
;
51 void (* list
) (GHashTable
*set
);
53 /* instance methods */
54 gboolean (* begin
) (DConfWriter
*writer
,
56 void (* change
) (DConfWriter
*writer
,
57 DConfChangeset
*changeset
,
59 gboolean (* commit
) (DConfWriter
*writer
,
61 void (* end
) (DConfWriter
*writer
);
66 DConfDBusWriterSkeleton parent_instance
;
67 DConfWriterPrivate
*priv
;
70 G_DEFINE_AUTOPTR_CLEANUP_FUNC (DConfWriter
, g_object_unref
)
72 GType
dconf_writer_get_type (void);
74 void dconf_writer_set_basepath (DConfWriter
*writer
,
76 DConfChangeset
* dconf_writer_diff (DConfWriter
*writer
,
77 DConfChangeset
*changeset
);
78 const gchar
* dconf_writer_get_name (DConfWriter
*writer
);
80 void dconf_writer_list (GType type
,
82 GDBusInterfaceSkeleton
*dconf_writer_new (GType type
,
85 #define DCONF_TYPE_SHM_WRITER (dconf_shm_writer_get_type ())
86 GType
dconf_shm_writer_get_type (void);
87 #define DCONF_TYPE_KEYFILE_WRITER (dconf_keyfile_writer_get_type ())
88 GType
dconf_keyfile_writer_get_type (void);
90 #endif /* __dconf_writer_h__ */