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