4 * This program 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 License, or (at your option) version 3.
9 * This program 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 the program; if not, see <http://www.gnu.org/licenses/>
19 #if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
20 #error "Only <libedataserver/libedataserver.h> should be included directly."
28 /* Standard GObject macros */
29 #define E_TYPE_SOURCE \
30 (e_source_get_type ())
31 #define E_SOURCE(obj) \
32 (G_TYPE_CHECK_INSTANCE_CAST \
33 ((obj), E_TYPE_SOURCE, ESource))
34 #define E_SOURCE_CLASS(cls) \
35 (G_TYPE_CHECK_CLASS_CAST \
36 ((cls), E_TYPE_SOURCE, ESourceClass))
37 #define E_IS_SOURCE(obj) \
38 (G_TYPE_CHECK_INSTANCE_TYPE \
39 ((obj), E_TYPE_SOURCE))
40 #define E_IS_SOURCE_CLASS(cls) \
41 (G_TYPE_CHECK_CLASS_TYPE \
42 ((cls), E_TYPE_SOURCE))
43 #define E_SOURCE_GET_CLASS(obj) \
44 (G_TYPE_INSTANCE_GET_CLASS \
45 ((obj), E_TYPE_SOURCE, ESourceClass))
48 * E_SOURCE_PARAM_SETTING:
50 * Extends #GParamFlags to indicate the #GObject property is associated
51 * with a key file value. Use this flag when installing #GObject properties
52 * in #ESourceExtension subclasses.
56 #define E_SOURCE_PARAM_SETTING (1 << G_PARAM_USER_SHIFT)
60 typedef struct _ESource ESource;
61 typedef struct _ESourceClass ESourceClass;
62 typedef struct _ESourcePrivate ESourcePrivate;
67 * Contains only private data that should be read and manipulated using the
77 struct _ESourceClass {
78 GObjectClass parent_class;
81 void (*changed) (ESource *source);
84 gboolean (*remove_sync) (ESource *source,
85 GCancellable *cancellable,
87 void (*remove) (ESource *source,
88 GCancellable *cancellable,
89 GAsyncReadyCallback callback,
91 gboolean (*remove_finish) (ESource *source,
94 gboolean (*write_sync) (ESource *source,
95 GCancellable *cancellable,
97 void (*write) (ESource *source,
98 GCancellable *cancellable,
99 GAsyncReadyCallback callback,
101 gboolean (*write_finish) (ESource *source,
102 GAsyncResult *result,
104 gboolean (*remote_create_sync) (ESource *source,
105 ESource *scratch_source,
106 GCancellable *cancellable,
108 void (*remote_create) (ESource *source,
109 ESource *scratch_source,
110 GCancellable *cancellable,
111 GAsyncReadyCallback callback,
113 gboolean (*remote_create_finish) (ESource *source,
114 GAsyncResult *result,
116 gboolean (*remote_delete_sync) (ESource *source,
117 GCancellable *cancellable,
119 void (*remote_delete) (ESource *source,
120 GCancellable *cancellable,
121 GAsyncReadyCallback callback,
123 gboolean (*remote_delete_finish) (ESource *source,
124 GAsyncResult *result,
127 /* Reserved slots. */
128 gpointer reserved[10];
131 GType e_source_get_type (void) G_GNUC_CONST;
132 ESource * e_source_new (GDBusObject *dbus_object,
133 GMainContext *main_context,
135 ESource * e_source_new_with_uid (const gchar *uid,
136 GMainContext *main_context,
138 guint e_source_hash (ESource *source);
139 gboolean e_source_equal (ESource *source1,
141 void e_source_changed (ESource *source);
142 const gchar * e_source_get_uid (ESource *source);
143 gchar * e_source_dup_uid (ESource *source);
144 const gchar * e_source_get_parent (ESource *source);
145 gchar * e_source_dup_parent (ESource *source);
146 void e_source_set_parent (ESource *source,
147 const gchar *parent);
148 gboolean e_source_get_enabled (ESource *source);
149 void e_source_set_enabled (ESource *source,
151 gboolean e_source_get_writable (ESource *source);
152 gboolean e_source_get_removable (ESource *source);
153 gboolean e_source_get_remote_creatable (ESource *source);
154 gboolean e_source_get_remote_deletable (ESource *source);
155 gpointer e_source_get_extension (ESource *source,
156 const gchar *extension_name);
157 gboolean e_source_has_extension (ESource *source,
158 const gchar *extension_name);
159 GDBusObject * e_source_ref_dbus_object (ESource *source);
160 GMainContext * e_source_ref_main_context (ESource *source);
161 const gchar * e_source_get_display_name (ESource *source);
162 gchar * e_source_dup_display_name (ESource *source);
163 void e_source_set_display_name (ESource *source,
164 const gchar *display_name);
165 gint e_source_compare_by_display_name
168 gchar * e_source_to_string (ESource *source,
170 gchar * e_source_parameter_to_key (const gchar *param_name);
171 gboolean e_source_remove_sync (ESource *source,
172 GCancellable *cancellable,
174 void e_source_remove (ESource *source,
175 GCancellable *cancellable,
176 GAsyncReadyCallback callback,
178 gboolean e_source_remove_finish (ESource *source,
179 GAsyncResult *result,
181 gboolean e_source_write_sync (ESource *source,
182 GCancellable *cancellable,
184 void e_source_write (ESource *source,
185 GCancellable *cancellable,
186 GAsyncReadyCallback callback,
188 gboolean e_source_write_finish (ESource *source,
189 GAsyncResult *result,
191 gboolean e_source_remote_create_sync (ESource *source,
192 ESource *scratch_source,
193 GCancellable *cancellable,
195 void e_source_remote_create (ESource *source,
196 ESource *scratch_source,
197 GCancellable *cancellable,
198 GAsyncReadyCallback callback,
200 gboolean e_source_remote_create_finish (ESource *source,
201 GAsyncResult *result,
203 gboolean e_source_remote_delete_sync (ESource *source,
204 GCancellable *cancellable,
206 void e_source_remote_delete (ESource *source,
207 GCancellable *cancellable,
208 GAsyncReadyCallback callback,
210 gboolean e_source_remote_delete_finish (ESource *source,
211 GAsyncResult *result,
216 #endif /* E_SOURCE_H */