I#27 - [IMAPx] Ignore DavMail's CR/LF in BODYSTRUCTURE response
[evolution-data-server.git] / src / libedataserver / e-webdav-discover.h
blob860499c75ca6380743a273ecb08a442d67b38309
1 /*
2 * Copyright (C) 2015 Red Hat, Inc. (www.redhat.com)
4 * This library is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 * for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library. If not, see <http://www.gnu.org/licenses/>.
18 #if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
19 #error "Only <libedataserver/libedataserver.h> should be included directly."
20 #endif
22 #ifndef E_WEBDAV_DISCOVER_H
23 #define E_WEBDAV_DISCOVER_H
25 #include <glib.h>
27 #include <libedataserver/e-source.h>
29 G_BEGIN_DECLS
31 typedef enum {
32 E_WEBDAV_DISCOVER_SUPPORTS_NONE = 0,
33 E_WEBDAV_DISCOVER_SUPPORTS_CONTACTS = 1 << 0,
34 E_WEBDAV_DISCOVER_SUPPORTS_EVENTS = 1 << 1,
35 E_WEBDAV_DISCOVER_SUPPORTS_MEMOS = 1 << 2,
36 E_WEBDAV_DISCOVER_SUPPORTS_TASKS = 1 << 3
37 } EWebDAVDiscoverSupports;
39 typedef struct _EWebDAVDiscoveredSource {
40 gchar *href;
41 guint32 supports;
42 gchar *display_name;
43 gchar *description;
44 gchar *color;
45 } EWebDAVDiscoveredSource;
47 void e_webdav_discover_free_discovered_sources
48 (GSList *discovered_sources);
50 void e_webdav_discover_sources (ESource *source,
51 const gchar *url_use_path,
52 guint32 only_supports,
53 const ENamedParameters *credentials,
54 GCancellable *cancellable,
55 GAsyncReadyCallback callback,
56 gpointer user_data);
58 gboolean e_webdav_discover_sources_finish (ESource *source,
59 GAsyncResult *result,
60 gchar **out_certificate_pem,
61 GTlsCertificateFlags *out_certificate_errors,
62 GSList **out_discovered_sources,
63 GSList **out_calendar_user_addresses,
64 GError **error);
66 gboolean e_webdav_discover_sources_sync (ESource *source,
67 const gchar *url_use_path,
68 guint32 only_supports,
69 const ENamedParameters *credentials,
70 gchar **out_certificate_pem,
71 GTlsCertificateFlags *out_certificate_errors,
72 GSList **out_discovered_sources,
73 GSList **out_calendar_user_addresses,
74 GCancellable *cancellable,
75 GError **error);
77 /**
78 * EWebDAVDiscoverRefSourceFunc:
79 * @user_data: user data, as passed to e_webdav_discover_sources_full() or
80 * e_webdav_discover_sources_full_sync()
81 * @uid: an #ESource UID to return
83 * Returns: (transfer full) (nullable): an #ESource with UID @uid, or %NULL, if not found.
84 * Dereference the returned non-NULL #ESource with g_object_unref(), when no longer needed.
86 * Since: 3.30
87 **/
88 typedef ESource * (* EWebDAVDiscoverRefSourceFunc) (gpointer user_data,
89 const gchar *uid);
91 void e_webdav_discover_sources_full (ESource *source,
92 const gchar *url_use_path,
93 guint32 only_supports,
94 const ENamedParameters *credentials,
95 EWebDAVDiscoverRefSourceFunc ref_source_func,
96 gpointer ref_source_func_user_data,
97 GCancellable *cancellable,
98 GAsyncReadyCallback callback,
99 gpointer user_data);
101 gboolean e_webdav_discover_sources_full_sync (ESource *source,
102 const gchar *url_use_path,
103 guint32 only_supports,
104 const ENamedParameters *credentials,
105 EWebDAVDiscoverRefSourceFunc ref_source_func,
106 gpointer ref_source_func_user_data,
107 gchar **out_certificate_pem,
108 GTlsCertificateFlags *out_certificate_errors,
109 GSList **out_discovered_sources,
110 GSList **out_calendar_user_addresses,
111 GCancellable *cancellable,
112 GError **error);
114 G_END_DECLS
116 #endif /* E_WEBDAV_DISCOVER_H */