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."
23 #ifndef E_SOURCE_REGISTRY_H
24 #define E_SOURCE_REGISTRY_H
26 #include <libedataserver/e-source.h>
27 #include <libedataserver/e-source-authenticator.h>
29 /* Standard GObject macros */
30 #define E_TYPE_SOURCE_REGISTRY \
31 (e_source_registry_get_type ())
32 #define E_SOURCE_REGISTRY(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST \
34 ((obj), E_TYPE_SOURCE_REGISTRY, ESourceRegistry))
35 #define E_SOURCE_REGISTRY_CLASS(cls) \
36 (G_TYPE_CHECK_CLASS_CAST \
37 ((cls), E_TYPE_SOURCE_REGISTRY, ESourceRegistryClass))
38 #define E_IS_SOURCE_REGISTRY(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE \
40 ((obj), E_TYPE_SOURCE_REGISTRY))
41 #define E_IS_SOURCE_REGISTRY_CLASS(cls) \
42 (G_TYPE_CHECK_CLASS_TYPE \
43 ((cls), E_TYPE_SOURCE_REGISTRY))
44 #define E_SOURCE_REGISTRY_GET_CLASS(obj) \
45 (G_TYPE_INSTANCE_GET_CLASS \
46 ((obj), E_TYPE_SOURCE_REGISTRY, ESourceRegistryClass))
50 typedef struct _ESourceRegistry ESourceRegistry;
51 typedef struct _ESourceRegistryClass ESourceRegistryClass;
52 typedef struct _ESourceRegistryPrivate ESourceRegistryPrivate;
57 * Contains only private data that should be read and manipulated using the
62 struct _ESourceRegistry {
64 ESourceRegistryPrivate *priv;
67 struct _ESourceRegistryClass {
68 GObjectClass parent_class;
71 void (*source_added) (ESourceRegistry *registry,
73 void (*source_changed) (ESourceRegistry *registry,
75 void (*source_removed) (ESourceRegistry *registry,
77 void (*source_enabled) (ESourceRegistry *registry,
79 void (*source_disabled) (ESourceRegistry *registry,
83 GType e_source_registry_get_type (void) G_GNUC_CONST;
85 e_source_registry_new_sync (GCancellable *cancellable,
87 void e_source_registry_new (GCancellable *cancellable,
88 GAsyncReadyCallback callback,
91 e_source_registry_new_finish (GAsyncResult *result,
93 gboolean e_source_registry_authenticate_sync
94 (ESourceRegistry *registry,
96 ESourceAuthenticator *auth,
97 GCancellable *cancellable,
99 void e_source_registry_authenticate (ESourceRegistry *registry,
101 ESourceAuthenticator *auth,
102 GCancellable *cancellable,
103 GAsyncReadyCallback callback,
105 gboolean e_source_registry_authenticate_finish
106 (ESourceRegistry *registry,
107 GAsyncResult *result,
109 gboolean e_source_registry_commit_source_sync
110 (ESourceRegistry *registry,
112 GCancellable *cancellable,
114 void e_source_registry_commit_source (ESourceRegistry *registry,
116 GCancellable *cancellable,
117 GAsyncReadyCallback callback,
119 gboolean e_source_registry_commit_source_finish
120 (ESourceRegistry *registry,
121 GAsyncResult *result,
123 gboolean e_source_registry_create_sources_sync
124 (ESourceRegistry *registry,
125 GList *list_of_sources,
126 GCancellable *cancellable,
128 void e_source_registry_create_sources
129 (ESourceRegistry *registry,
130 GList *list_of_sources,
131 GCancellable *cancellable,
132 GAsyncReadyCallback callback,
134 gboolean e_source_registry_create_sources_finish
135 (ESourceRegistry *registry,
136 GAsyncResult *result,
138 ESource * e_source_registry_ref_source (ESourceRegistry *registry,
140 GList * e_source_registry_list_sources (ESourceRegistry *registry,
141 const gchar *extension_name);
142 ESource * e_source_registry_find_extension
143 (ESourceRegistry *registry,
145 const gchar *extension_name);
146 GNode * e_source_registry_build_display_tree
147 (ESourceRegistry *registry,
148 const gchar *extension_name);
149 void e_source_registry_free_display_tree
150 (GNode *display_tree);
151 void e_source_registry_debug_dump (ESourceRegistry *registry,
152 const gchar *extension_name);
154 /* The following is a front-end for the "org.gnome.Evolution.DefaultSources"
155 * GSettings schema, except that it gets and sets ESource objects instead of
156 * ESource UID strings. */
158 ESource * e_source_registry_ref_builtin_address_book
159 (ESourceRegistry *registry);
160 ESource * e_source_registry_ref_default_address_book
161 (ESourceRegistry *registry);
162 void e_source_registry_set_default_address_book
163 (ESourceRegistry *registry,
164 ESource *default_source);
165 ESource * e_source_registry_ref_builtin_calendar
166 (ESourceRegistry *registry);
167 ESource * e_source_registry_ref_default_calendar
168 (ESourceRegistry *registry);
169 void e_source_registry_set_default_calendar
170 (ESourceRegistry *registry,
171 ESource *default_source);
172 ESource * e_source_registry_ref_builtin_mail_account
173 (ESourceRegistry *registry);
174 ESource * e_source_registry_ref_default_mail_account
175 (ESourceRegistry *registry);
176 void e_source_registry_set_default_mail_account
177 (ESourceRegistry *registry,
178 ESource *default_source);
179 ESource * e_source_registry_ref_default_mail_identity
180 (ESourceRegistry *registry);
181 void e_source_registry_set_default_mail_identity
182 (ESourceRegistry *registry,
183 ESource *default_source);
184 ESource * e_source_registry_ref_builtin_memo_list
185 (ESourceRegistry *registry);
186 ESource * e_source_registry_ref_default_memo_list
187 (ESourceRegistry *registry);
188 void e_source_registry_set_default_memo_list
189 (ESourceRegistry *registry,
190 ESource *default_source);
191 ESource * e_source_registry_ref_builtin_task_list
192 (ESourceRegistry *registry);
193 ESource * e_source_registry_ref_default_task_list
194 (ESourceRegistry *registry);
195 void e_source_registry_set_default_task_list
196 (ESourceRegistry *registry,
197 ESource *default_source);
198 ESource * e_source_registry_ref_default_for_extension_name
199 (ESourceRegistry *registry,
200 const gchar *extension_name);
201 void e_source_registry_set_default_for_extension_name
202 (ESourceRegistry *registry,
203 const gchar *extension_name,
204 ESource *default_source);
208 #endif /* E_SOURCE_REGISTRY_H */