From 761328989492db9bd603c2d7f1134d20e485d2f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Nicole?= Date: Tue, 27 Mar 2018 18:26:11 +0200 Subject: Add CalDAV support Summary: Notes: - Add a `webdavcommon` folder for WebDAV generic resource code - Move `davresource` to `carddaveresource` and make it use the WebDAV code - For now it tests the CalDAV resource directly on KolabNow (to be changed) - Only synchronization, not adding / changing / removing WebDAV collections or items (to be implemented) - Only events are currently supported (todo, freebusy, etc. are to be implemented but should be straightforward) Fixes T8224 Reviewers: cmollekopf Tags: #sink Maniphest Tasks: T8224 Differential Revision: https://phabricator.kde.org/D11741 --- common/domain/applicationdomaintype.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'common/domain/applicationdomaintype.h') diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index d05e981..e05acaa 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h @@ -389,22 +389,24 @@ struct SINK_EXPORT Contact : public Entity { SINK_REFERENCE_PROPERTY(Addressbook, Addressbook, addressbook); }; +struct SINK_EXPORT Calendar : public Entity { + SINK_ENTITY(Calendar, calendar); + SINK_PROPERTY(QString, Name, name); +}; + struct SINK_EXPORT Event : public Entity { SINK_ENTITY(Event, event); SINK_PROPERTY(QString, Uid, uid); SINK_PROPERTY(QString, Summary, summary); SINK_PROPERTY(QString, Description, description); - SINK_PROPERTY(QByteArray, Attachment, attachment); + SINK_PROPERTY(QDateTime, StartTime, startTime); + SINK_REFERENCE_PROPERTY(Calendar, Calendar, calendar); }; struct SINK_EXPORT Todo : public Entity { SINK_ENTITY(Todo, todo); }; -struct SINK_EXPORT Calendar : public Entity { - SINK_ENTITY(Calendar, calendar); -}; - struct SINK_EXPORT Folder : public Entity { SINK_ENTITY(Folder, folder); SINK_REFERENCE_PROPERTY(Folder, Parent, parent); @@ -477,6 +479,10 @@ struct SINK_EXPORT CardDavResource { static SinkResource create(const QByteArray &account); }; +struct SINK_EXPORT CalDavResource { + static SinkResource create(const QByteArray &account); +}; + namespace ResourceCapabilities { namespace Mail { static constexpr const char *mail = "mail"; @@ -493,6 +499,11 @@ namespace Contact { static constexpr const char *addressbook = "addressbook"; static constexpr const char *storage = "contact.storage"; }; +namespace Event { + static constexpr const char *event = "event"; + static constexpr const char *calendar = "calendar"; + static constexpr const char *storage = "event.storage"; +}; }; namespace SpecialPurpose { @@ -522,7 +533,7 @@ bool SINK_EXPORT isGlobalType(const QByteArray &type); /** * Type implementation. - * + * * Needs to be implemented for every application domain type. * Contains all non-resource specific, but type-specific code. */ @@ -545,6 +556,7 @@ class SINK_EXPORT TypeImplementation; REGISTER_TYPE(Sink::ApplicationDomain::Contact) \ REGISTER_TYPE(Sink::ApplicationDomain::Addressbook) \ REGISTER_TYPE(Sink::ApplicationDomain::Event) \ + REGISTER_TYPE(Sink::ApplicationDomain::Calendar) \ REGISTER_TYPE(Sink::ApplicationDomain::Mail) \ REGISTER_TYPE(Sink::ApplicationDomain::Folder) \ REGISTER_TYPE(Sink::ApplicationDomain::SinkResource) \ -- cgit v1.2.3