summaryrefslogtreecommitdiff
path: root/src/libedataserver/e-webdav-session.h
blob: a9f6f5b0a7e281f86770a7ec70005157a264fb79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Copyright (C) 2017 Red Hat, Inc. (www.redhat.com)
 *
 * This library is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library. If not, see <http://www.gnu.org/licenses/>.
 */

#if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
#error "Only <libedataserver/libedataserver.h> should be included directly."
#endif

#ifndef E_WEBDAV_SESSION_H
#define E_WEBDAV_SESSION_H

#include <glib.h>
#include <libxml/xpath.h>

#include <libedataserver/e-data-server-util.h>
#include <libedataserver/e-soup-session.h>
#include <libedataserver/e-source.h>
#include <libedataserver/e-xml-document.h>

/* Standard GObject macros */
#define E_TYPE_WEBDAV_SESSION \
	(e_webdav_session_get_type ())
#define E_WEBDAV_SESSION(obj) \
	(G_TYPE_CHECK_INSTANCE_CAST \
	((obj), E_TYPE_WEBDAV_SESSION, EWebDAVSession))
#define E_WEBDAV_SESSION_CLASS(cls) \
	(G_TYPE_CHECK_CLASS_CAST \
	((cls), E_TYPE_WEBDAV_SESSION, EWebDAVSessionClass))
#define E_IS_WEBDAV_SESSION(obj) \
	(G_TYPE_CHECK_INSTANCE_TYPE \
	((obj), E_TYPE_WEBDAV_SESSION))
#define E_IS_WEBDAV_SESSION_CLASS(cls) \
	(G_TYPE_CHECK_CLASS_TYPE \
	((cls), E_TYPE_WEBDAV_SESSION))
#define E_WEBDAV_SESSION_GET_CLASS(obj) \
	(G_TYPE_INSTANCE_GET_CLASS \
	((obj), E_TYPE_WEBDAV_SESSION, EWebDAVSessionClass))

G_BEGIN_DECLS

#define E_WEBDAV_CAPABILITY_CLASS_1			"1"
#define E_WEBDAV_CAPABILITY_CLASS_2			"2"
#define E_WEBDAV_CAPABILITY_CLASS_3			"3"
#define E_WEBDAV_CAPABILITY_ACCESS_CONTROL		"access-control"
#define E_WEBDAV_CAPABILITY_BIND			"bind"
#define E_WEBDAV_CAPABILITY_EXTENDED_MKCOL		"extended-mkcol"
#define E_WEBDAV_CAPABILITY_ADDRESSBOOK			"addressbook"
#define E_WEBDAV_CAPABILITY_CALENDAR_ACCESS		"calendar-access"
#define E_WEBDAV_CAPABILITY_CALENDAR_SCHEDULE		"calendar-schedule"
#define E_WEBDAV_CAPABILITY_CALENDAR_AUTO_SCHEDULE	"calendar-auto-schedule"
#define E_WEBDAV_CAPABILITY_CALENDAR_PROXY		"calendar-proxy"

#define E_WEBDAV_DEPTH_THIS			"0"
#define E_WEBDAV_DEPTH_THIS_AND_CHILDREN	"1"
#define E_WEBDAV_DEPTH_INFINITY			"infinity"

#define E_WEBDAV_CONTENT_TYPE_XML		"application/xml; charset=\"utf-8\""
#define E_WEBDAV_CONTENT_TYPE_CALENDAR		"text/calendar; charset=\"utf-8\""
#define E_WEBDAV_CONTENT_TYPE_VCARD		"text/vcard; charset=\"utf-8\""

#define E_WEBDAV_NS_DAV				"DAV:"
#define E_WEBDAV_NS_CALDAV			"urn:ietf:params:xml:ns:caldav"
#define E_WEBDAV_NS_CARDDAV			"urn:ietf:params:xml:ns:carddav"
#define E_WEBDAV_NS_CALENDARSERVER		"http://calendarserver.org/ns/"
#define E_WEBDAV_NS_ICAL			"http://apple.com/ns/ical/"

typedef struct _EWebDAVSession EWebDAVSession;
typedef struct _EWebDAVSessionClass EWebDAVSessionClass;
typedef struct _EWebDAVSessionPrivate EWebDAVSessionPrivate;

typedef enum {
	E_WEBDAV_RESOURCE_KIND_UNKNOWN,
	E_WEBDAV_RESOURCE_KIND_ADDRESSBOOK,
	E_WEBDAV_RESOURCE_KIND_CALENDAR,
	E_WEBDAV_RESOURCE_KIND_PRINCIPAL,
	E_WEBDAV_RESOURCE_KIND_COLLECTION,
	E_WEBDAV_RESOURCE_KIND_RESOURCE,
	E_WEBDAV_RESOURCE_KIND_SUBSCRIBED_ICALENDAR,
	E_WEBDAV_RESOURCE_KIND_WEBDAV_NOTES
} EWebDAVResourceKind;

typedef enum {
	E_WEBDAV_RESOURCE_SUPPORTS_NONE		= 0,
	E_WEBDAV_RESOURCE_SUPPORTS_CONTACTS	= 1 << 0,
	E_WEBDAV_RESOURCE_SUPPORTS_EVENTS	= 1 << 1,
	E_WEBDAV_RESOURCE_SUPPORTS_MEMOS	= 1 << 2,
	E_WEBDAV_RESOURCE_SUPPORTS_TASKS	= 1 << 3,
	E_WEBDAV_RESOURCE_SUPPORTS_FREEBUSY	= 1 << 4,
	E_WEBDAV_RESOURCE_SUPPORTS_TIMEZONE	= 1 << 5,
	E_WEBDAV_RESOURCE_SUPPORTS_WEBDAV_NOTES	= 1 << 6,
	E_WEBDAV_RESOURCE_SUPPORTS_LAST		= E_WEBDAV_RESOURCE_SUPPORTS_WEBDAV_NOTES
} EWebDAVResourceSupports;

typedef struct _EWebDAVResource {
	EWebDAVResourceKind kind;
	guint32 supports;
	gchar *href;
	gchar *etag;
	gchar *display_name;
	gchar *content_type;
	gsize content_length;
	glong creation_date;
	glong last_modified;
	gchar *description;
	gchar *color;
} EWebDAVResource;

GType		e_webdav_resource_get_type		(void) G_GNUC_CONST;
EWebDAVResource *
		e_webdav_resource_new			(EWebDAVResourceKind kind,
							 guint32 supports,
							 const gchar *href,
							 const gchar *etag,
							 const gchar *display_name,
							 const gchar *content_type,
							 gsize content_length,
							 glong creation_date,
							 glong last_modified,
							 const gchar *description,
							 const gchar *color);
EWebDAVResource *
		e_webdav_resource_copy			(const EWebDAVResource *src);
void		e_webdav_resource_free			(gpointer ptr /* EWebDAVResource * */);

typedef enum {
	E_WEBDAV_LIST_ALL		= 0xFFFFFFFF,
	E_WEBDAV_LIST_NONE		= 0,
	E_WEBDAV_LIST_SUPPORTS		= 1 << 0,
	E_WEBDAV_LIST_ETAG		= 1 << 1,
	E_WEBDAV_LIST_DISPLAY_NAME	= 1 << 2,
	E_WEBDAV_LIST_CONTENT_TYPE	= 1 << 3,
	E_WEBDAV_LIST_CONTENT_LENGTH	= 1 << 4,
	E_WEBDAV_LIST_CREATION_DATE	= 1 << 5,
	E_WEBDAV_LIST_LAST_MODIFIED	= 1 << 6,
	E_WEBDAV_LIST_DESCRIPTION	= 1 << 7,
	E_WEBDAV_LIST_COLOR		= 1 << 8,
	E_WEBDAV_LIST_ONLY_CALENDAR	= 1 << 9,
	E_WEBDAV_LIST_ONLY_ADDRESSBOOK	= 1 << 10
} EWebDAVListFlags;

/**
 * EWebDAVPropstatTraverseFunc:
 * @webdav: an #EWebDAVSession
 * @prop_node: an #xmlNode
 * @request_uri: a #SoupURI, containing the request URI, maybe redirected by the server
 * @href: (nullable): a full URI to which the property belongs, or %NULL, when not found
 * @status_code: an HTTP status code for this property
 * @user_data: user data, as passed to e_webdav_session_propfind_sync()
 *
 * A callback function for e_webdav_session_propfind_sync(),
 * e_webdav_session_report_sync() and other XML response with DAV:propstat
 * elements traversal functions.
 *
 * The @prop_node points to the actual property (prop) node and it can be examined
 * with e_xml_find_child(), e_xml_find_children_nodes() and other provided XML helper functions.
 *
 * Returns: %TRUE to continue traversal of the returned response, %FALSE otherwise.
 *
 * Since: 3.26
 **/
typedef gboolean (* EWebDAVPropstatTraverseFunc)	(EWebDAVSession *webdav,
							 xmlNode *prop_node,
							 const SoupURI *request_uri,
							 const gchar *href,
							 guint status_code,
							 gpointer user_data);

typedef enum {
	E_WEBDAV_PROPERTY_SET,
	E_WEBDAV_PROPERTY_REMOVE
} EWebDAVPropertyChangeKind;

typedef struct _EWebDAVPropertyChange {
	EWebDAVPropertyChangeKind kind;
	gchar *ns_uri;
	gchar *name;
	gchar *value;
} EWebDAVPropertyChange;

GType		e_webdav_property_change_get_type	(void) G_GNUC_CONST;
EWebDAVPropertyChange *
		e_webdav_property_change_new_set	(const gchar *ns_uri,
							 const gchar *name,
							 const gchar *value);
EWebDAVPropertyChange *
		e_webdav_property_change_new_remove	(const gchar *ns_uri,
							 const gchar *name);
EWebDAVPropertyChange *
		e_webdav_property_change_copy		(const EWebDAVPropertyChange *src);
void		e_webdav_property_change_free		(gpointer ptr); /* EWebDAVPropertyChange * */

typedef enum {
	E_WEBDAV_LOCK_EXCLUSIVE,
	E_WEBDAV_LOCK_SHARED
} EWebDAVLockScope;

#define E_WEBDAV_COLLATION_ASCII_NUMERIC_SUFFIX "ascii-numeric"
#define E_WEBDAV_COLLATION_ASCII_NUMERIC "i;" E_WEBDAV_COLLATION_ASCII_NUMERIC_SUFFIX

#define E_WEBDAV_COLLATION_ASCII_CASEMAP_SUFFIX "ascii-casemap"
#define E_WEBDAV_COLLATION_ASCII_CASEMAP "i;" E_WEBDAV_COLLATION_ASCII_CASEMAP_SUFFIX

#define E_WEBDAV_COLLATION_OCTET_SUFFIX "octet"
#define E_WEBDAV_COLLATION_OCTET "i;" E_WEBDAV_COLLATION_OCTET_SUFFIX

#define E_WEBDAV_COLLATION_UNICODE_CASEMAP_SUFFIX "unicode-casemap"
#define E_WEBDAV_COLLATION_UNICODE_CASEMAP "i;" E_WEBDAV_COLLATION_UNICODE_CASEMAP_SUFFIX

typedef enum {
	E_WEBDAV_PRIVILEGE_KIND_UNKNOWN = 0,
	E_WEBDAV_PRIVILEGE_KIND_ABSTRACT,
	E_WEBDAV_PRIVILEGE_KIND_AGGREGATE,
	E_WEBDAV_PRIVILEGE_KIND_COMMON
} EWebDAVPrivilegeKind;

typedef enum {
	E_WEBDAV_PRIVILEGE_HINT_UNKNOWN = 0,
	E_WEBDAV_PRIVILEGE_HINT_READ,
	E_WEBDAV_PRIVILEGE_HINT_WRITE,
	E_WEBDAV_PRIVILEGE_HINT_WRITE_PROPERTIES,
	E_WEBDAV_PRIVILEGE_HINT_WRITE_CONTENT,
	E_WEBDAV_PRIVILEGE_HINT_UNLOCK,
	E_WEBDAV_PRIVILEGE_HINT_READ_ACL,
	E_WEBDAV_PRIVILEGE_HINT_WRITE_ACL,
	E_WEBDAV_PRIVILEGE_HINT_READ_CURRENT_USER_PRIVILEGE_SET,
	E_WEBDAV_PRIVILEGE_HINT_BIND,
	E_WEBDAV_PRIVILEGE_HINT_UNBIND,
	E_WEBDAV_PRIVILEGE_HINT_ALL,
	E_WEBDAV_PRIVILEGE_HINT_CALDAV_READ_FREE_BUSY
} EWebDAVPrivilegeHint;

typedef struct _EWebDAVPrivilege {
	gchar *ns_uri;
	gchar *name;
	gchar *description;
	EWebDAVPrivilegeKind kind;
	EWebDAVPrivilegeHint hint;
} EWebDAVPrivilege;

GType		e_webdav_privilege_get_type		(void) G_GNUC_CONST;
EWebDAVPrivilege *
		e_webdav_privilege_new			(const gchar *ns_uri,
							 const gchar *name,
							 const gchar *description,
							 EWebDAVPrivilegeKind kind,
							 EWebDAVPrivilegeHint hint);
EWebDAVPrivilege *
		e_webdav_privilege_copy			(const EWebDAVPrivilege *src);
void		e_webdav_privilege_free			(gpointer ptr); /* EWebDAVPrivilege * */

typedef enum {
	E_WEBDAV_ACE_PRINCIPAL_UNKNOWN = 0,
	E_WEBDAV_ACE_PRINCIPAL_HREF,
	E_WEBDAV_ACE_PRINCIPAL_ALL,
	E_WEBDAV_ACE_PRINCIPAL_AUTHENTICATED,
	E_WEBDAV_ACE_PRINCIPAL_UNAUTHENTICATED,
	E_WEBDAV_ACE_PRINCIPAL_PROPERTY,
	E_WEBDAV_ACE_PRINCIPAL_SELF,
	E_WEBDAV_ACE_PRINCIPAL_OWNER /* special-case, 'property' with only 'DAV:owner' child */
} EWebDAVACEPrincipalKind;

typedef enum {
	E_WEBDAV_ACE_FLAG_UNKNOWN	= 0,
	E_WEBDAV_ACE_FLAG_GRANT		= 1 << 0,
	E_WEBDAV_ACE_FLAG_DENY		= 1 << 1,
	E_WEBDAV_ACE_FLAG_INVERT	= 1 << 2,
	E_WEBDAV_ACE_FLAG_PROTECTED	= 1 << 3,
	E_WEBDAV_ACE_FLAG_INHERITED	= 1 << 4
} EWebDAVACEFlag;

typedef struct _EWebDAVAccessControlEntry {
	EWebDAVACEPrincipalKind principal_kind;
	gchar *principal_href; /* valid only if principal_kind is E_WEBDAV_ACE_PRINCIPAL_HREF */
	guint32 flags; /* bit-or of EWebDAVACEFlag */
	gchar *inherited_href; /* valid only if flags contain E_WEBDAV_ACE_INHERITED */
	GSList *privileges; /* EWebDAVPrivilege * */
} EWebDAVAccessControlEntry;

GType		e_webdav_access_control_entry_get_type	(void) G_GNUC_CONST;
EWebDAVAccessControlEntry *
		e_webdav_access_control_entry_new	(EWebDAVACEPrincipalKind principal_kind,
							 const gchar *principal_href,
							 guint32 flags, /* bit-or of EWebDAVACEFlag */
							 const gchar *inherited_href);
EWebDAVAccessControlEntry *
		e_webdav_access_control_entry_copy	(const EWebDAVAccessControlEntry *src);
void		e_webdav_access_control_entry_free	(gpointer ptr); /* EWebDAVAccessControlEntry * */
void		e_webdav_access_control_entry_append_privilege
							(EWebDAVAccessControlEntry *ace,
							 EWebDAVPrivilege *privilege);
GSList *	e_webdav_access_control_entry_get_privileges
							(EWebDAVAccessControlEntry *ace); /* EWebDAVPrivilege * */

typedef enum {
	E_WEBDAV_ACL_RESTRICTION_NONE			= 0,
	E_WEBDAV_ACL_RESTRICTION_GRANT_ONLY		= 1 << 0,
	E_WEBDAV_ACL_RESTRICTION_NO_INVERT		= 1 << 1,
	E_WEBDAV_ACL_RESTRICTION_DENY_BEFORE_GRANT	= 1 << 2,
	E_WEBDAV_ACL_RESTRICTION_REQUIRED_PRINCIPAL	= 1 << 3
} EWebDAVACLRestrictions;

/**
 * EWebDAVSession:
 *
 * Contains only private data that should be read and manipulated using the
 * functions below.
 *
 * Since: 3.26
 **/
struct _EWebDAVSession {
	/*< private >*/
	ESoupSession parent;
	EWebDAVSessionPrivate *priv;
};

struct _EWebDAVSessionClass {
	ESoupSessionClass parent_class;

	/* Padding for future expansion */
	gpointer reserved[10];
};

GType		e_webdav_session_get_type		(void) G_GNUC_CONST;

EWebDAVSession *e_webdav_session_new			(ESource *source);
const gchar *	e_webdav_session_get_last_dav_error_code(EWebDAVSession *webdav);
gboolean	e_webdav_session_get_last_dav_error_is_permission
							(EWebDAVSession *webdav);
SoupRequestHTTP *
		e_webdav_session_new_request		(EWebDAVSession *webdav,
							 const gchar *method,
							 const gchar *uri,
							 GError **error);
gboolean	e_webdav_session_replace_with_detailed_error
							(EWebDAVSession *webdav,
							 SoupRequestHTTP *request,
							 const GByteArray *response_data,
							 gboolean ignore_multistatus,
							 const gchar *prefix,
							 GError **inout_error);
gchar *		e_webdav_session_ensure_full_uri	(EWebDAVSession *webdav,
							 const SoupURI *request_uri,
							 const gchar *href);
gboolean	e_webdav_session_options_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 GHashTable **out_capabilities,
							 GHashTable **out_allows,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_post_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *data,
							 gsize data_length,
							 gchar **out_content_type,
							 GByteArray **out_content,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_post_with_content_type_sync
							(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *data,
							 gsize data_length,
							 const gchar *in_content_type,
							 gchar **out_content_type,
							 GByteArray **out_content,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_propfind_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *depth,
							 const EXmlDocument *xml,
							 EWebDAVPropstatTraverseFunc func,
							 gpointer func_user_data,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_proppatch_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const EXmlDocument *xml,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_report_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *depth,
							 const EXmlDocument *xml,
							 EWebDAVPropstatTraverseFunc func,
							 gpointer func_user_data,
							 gchar **out_content_type,
							 GByteArray **out_content,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_mkcol_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_mkcol_addressbook_sync	(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *display_name,
							 const gchar *description,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_mkcalendar_sync	(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *display_name,
							 const gchar *description,
							 const gchar *color,
							 guint32 supports, /* bit-or of EWebDAVResourceSupports */
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_get_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 gchar **out_href,
							 gchar **out_etag,
							 GOutputStream *out_stream,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_get_data_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 gchar **out_href,
							 gchar **out_etag,
							 gchar **out_bytes,
							 gsize *out_length,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_put_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *etag,
							 const gchar *content_type,
							 GInputStream *stream,
							 gchar **out_href,
							 gchar **out_etag,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_put_data_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *etag,
							 const gchar *content_type,
							 const gchar *bytes,
							 gsize length,
							 gchar **out_href,
							 gchar **out_etag,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_delete_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *depth,
							 const gchar *etag,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_copy_sync		(EWebDAVSession *webdav,
							 const gchar *source_uri,
							 const gchar *destination_uri,
							 const gchar *depth,
							 gboolean can_overwrite,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_move_sync		(EWebDAVSession *webdav,
							 const gchar *source_uri,
							 const gchar *destination_uri,
							 gboolean can_overwrite,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_lock_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *depth,
							 gint32 lock_timeout,
							 const EXmlDocument *xml,
							 gchar **out_lock_token,
							 xmlDoc **out_xml_response,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_refresh_lock_sync	(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *lock_token,
							 gint32 lock_timeout,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_unlock_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *lock_token,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_traverse_multistatus_response
							(EWebDAVSession *webdav,
							 const SoupMessage *message,
							 const GByteArray *xml_data,
							 EWebDAVPropstatTraverseFunc func,
							 gpointer func_user_data,
							 GError **error);
gboolean	e_webdav_session_traverse_mkcol_response
							(EWebDAVSession *webdav,
							 const SoupMessage *message,
							 const GByteArray *xml_data,
							 EWebDAVPropstatTraverseFunc func,
							 gpointer func_user_data,
							 GError **error);
gboolean	e_webdav_session_traverse_mkcalendar_response
							(EWebDAVSession *webdav,
							 const SoupMessage *message,
							 const GByteArray *xml_data,
							 EWebDAVPropstatTraverseFunc func,
							 gpointer func_user_data,
							 GError **error);
gboolean	e_webdav_session_getctag_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 gchar **out_ctag,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_list_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const gchar *depth,
							 guint32 flags, /* bit-or of EWebDAVListFlags */
							 GSList **out_resources, /* EWebDAVResource * */
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_update_properties_sync	(EWebDAVSession *webdav,
							 const gchar *uri,
							 const GSList *changes, /* EWebDAVPropertyChange * */
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_lock_resource_sync	(EWebDAVSession *webdav,
							 const gchar *uri,
							 EWebDAVLockScope lock_scope,
							 gint32 lock_timeout,
							 const gchar *owner,
							 gchar **out_lock_token,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_acl_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const EXmlDocument *xml,
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_get_supported_privilege_set_sync
							(EWebDAVSession *webdav,
							 const gchar *uri,
							 GNode **out_privileges, /* EWebDAVPrivilege * */
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_get_current_user_privilege_set_sync
							(EWebDAVSession *webdav,
							 const gchar *uri,
							 GSList **out_privileges, /* EWebDAVPrivilege * */
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_get_acl_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 GSList **out_entries, /* EWebDAVAccessControlEntry * */
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_get_acl_restrictions_sync
							(EWebDAVSession *webdav,
							 const gchar *uri,
							 guint32 *out_restrictions, /* bit-or of EWebDAVACLRestrictions */
							 EWebDAVACEPrincipalKind *out_principal_kind,
							 GSList **out_principal_hrefs, /* gchar * */
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_get_principal_collection_set_sync
							(EWebDAVSession *webdav,
							 const gchar *uri,
							 GSList **out_principal_hrefs, /* gchar * */
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_set_acl_sync		(EWebDAVSession *webdav,
							 const gchar *uri,
							 const GSList *entries, /* EWebDAVAccessControlEntry * */
							 GCancellable *cancellable,
							 GError **error);
gboolean	e_webdav_session_principal_property_search_sync
							(EWebDAVSession *webdav,
							 const gchar *uri,
							 gboolean apply_to_principal_collection_set,
							 const gchar *match_ns_uri,
							 const gchar *match_property,
							 const gchar *match_value,
							 GSList **out_principals, /* EWebDAVResource * */
							 GCancellable *cancellable,
							 GError **error);
gchar *		e_webdav_session_util_maybe_dequote	(gchar *text);
void		e_webdav_session_util_free_privileges	(GNode *privileges); /* EWebDAVPrivilege * */
gboolean	e_webdav_session_util_item_href_equal	(const gchar *href1,
							 const gchar *href2);

G_END_DECLS

#endif /* E_WEBDAV_SESSION_H */