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,
126 gboolean (*get_oauth2_access_token_sync)
128 GCancellable *cancellable,
129 gchar **out_access_token,
130 gint *out_expires_in,
132 void (*get_oauth2_access_token)
134 GCancellable *cancellable,
135 GAsyncReadyCallback callback,
137 gboolean (*get_oauth2_access_token_finish)
139 GAsyncResult *result,
140 gchar **out_access_token,
141 gint *out_expires_in,
144 /* Reserved slots. */
145 gpointer reserved[7];
148 GType e_source_get_type (void) G_GNUC_CONST;
149 ESource * e_source_new (GDBusObject *dbus_object,
150 GMainContext *main_context,
152 ESource * e_source_new_with_uid (const gchar *uid,
153 GMainContext *main_context,
155 guint e_source_hash (ESource *source);
156 gboolean e_source_equal (ESource *source1,
158 void e_source_changed (ESource *source);
159 const gchar * e_source_get_uid (ESource *source);
160 gchar * e_source_dup_uid (ESource *source);
161 const gchar * e_source_get_parent (ESource *source);
162 gchar * e_source_dup_parent (ESource *source);
163 void e_source_set_parent (ESource *source,
164 const gchar *parent);
165 gboolean e_source_get_enabled (ESource *source);
166 void e_source_set_enabled (ESource *source,
168 gboolean e_source_get_writable (ESource *source);
169 gboolean e_source_get_removable (ESource *source);
170 gboolean e_source_get_remote_creatable (ESource *source);
171 gboolean e_source_get_remote_deletable (ESource *source);
172 gpointer e_source_get_extension (ESource *source,
173 const gchar *extension_name);
174 gboolean e_source_has_extension (ESource *source,
175 const gchar *extension_name);
176 GDBusObject * e_source_ref_dbus_object (ESource *source);
177 GMainContext * e_source_ref_main_context (ESource *source);
178 const gchar * e_source_get_display_name (ESource *source);
179 gchar * e_source_dup_display_name (ESource *source);
180 void e_source_set_display_name (ESource *source,
181 const gchar *display_name);
182 gint e_source_compare_by_display_name
185 gchar * e_source_to_string (ESource *source,
187 gchar * e_source_parameter_to_key (const gchar *param_name);
188 gboolean e_source_remove_sync (ESource *source,
189 GCancellable *cancellable,
191 void e_source_remove (ESource *source,
192 GCancellable *cancellable,
193 GAsyncReadyCallback callback,
195 gboolean e_source_remove_finish (ESource *source,
196 GAsyncResult *result,
198 gboolean e_source_write_sync (ESource *source,
199 GCancellable *cancellable,
201 void e_source_write (ESource *source,
202 GCancellable *cancellable,
203 GAsyncReadyCallback callback,
205 gboolean e_source_write_finish (ESource *source,
206 GAsyncResult *result,
208 gboolean e_source_remote_create_sync (ESource *source,
209 ESource *scratch_source,
210 GCancellable *cancellable,
212 void e_source_remote_create (ESource *source,
213 ESource *scratch_source,
214 GCancellable *cancellable,
215 GAsyncReadyCallback callback,
217 gboolean e_source_remote_create_finish (ESource *source,
218 GAsyncResult *result,
220 gboolean e_source_remote_delete_sync (ESource *source,
221 GCancellable *cancellable,
223 void e_source_remote_delete (ESource *source,
224 GCancellable *cancellable,
225 GAsyncReadyCallback callback,
227 gboolean e_source_remote_delete_finish (ESource *source,
228 GAsyncResult *result,
230 gboolean e_source_get_oauth2_access_token_sync
232 GCancellable *cancellable,
233 gchar **out_access_token,
234 gint *out_expires_in,
236 void e_source_get_oauth2_access_token
238 GCancellable *cancellable,
239 GAsyncReadyCallback callback,
241 gboolean e_source_get_oauth2_access_token_finish
243 GAsyncResult *result,
244 gchar **out_access_token,
245 gint *out_expires_in,
250 #endif /* E_SOURCE_H */