diff options
Diffstat (limited to 'examples/carddavresource/carddavresource.h')
-rw-r--r-- | examples/carddavresource/carddavresource.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/examples/carddavresource/carddavresource.h b/examples/carddavresource/carddavresource.h new file mode 100644 index 0000000..3c0f707 --- /dev/null +++ b/examples/carddavresource/carddavresource.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2015 Christian Mollekopf <chrigi_1@fastmail.fm> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
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 | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
18 | */ | ||
19 | |||
20 | #pragma once | ||
21 | |||
22 | #include "common/genericresource.h" | ||
23 | |||
24 | #include <KDAV2/DavUrl> | ||
25 | #include <KAsync/Async> | ||
26 | |||
27 | #include <flatbuffers/flatbuffers.h> | ||
28 | |||
29 | class ContactAdaptorFactory; | ||
30 | class AddressbookAdaptorFactory; | ||
31 | |||
32 | /** | ||
33 | * A CardDAV resource. | ||
34 | * | ||
35 | * Implementation details: | ||
36 | * The remoteid's have the following formats: | ||
37 | * files: full file path | ||
38 | * directories: full directory path | ||
39 | * | ||
40 | * The resource moves all messages from new to cur during sync and thus expectes all messages that are in the store to always reside in cur. | ||
41 | * The tmp directory is never directly used | ||
42 | */ | ||
43 | class CardDavResource : public Sink::GenericResource | ||
44 | { | ||
45 | public: | ||
46 | CardDavResource(const Sink::ResourceContext &resourceContext); | ||
47 | }; | ||
48 | |||
49 | class CardDavResourceFactory : public Sink::ResourceFactory | ||
50 | { | ||
51 | Q_OBJECT | ||
52 | Q_PLUGIN_METADATA(IID "sink.carddav") | ||
53 | Q_INTERFACES(Sink::ResourceFactory) | ||
54 | |||
55 | public: | ||
56 | CardDavResourceFactory(QObject *parent = 0); | ||
57 | |||
58 | Sink::Resource *createResource(const Sink::ResourceContext &context) Q_DECL_OVERRIDE; | ||
59 | void registerFacades(const QByteArray &resourceName, Sink::FacadeFactory &factory) Q_DECL_OVERRIDE; | ||
60 | void registerAdaptorFactories(const QByteArray &resourceName, Sink::AdaptorFactoryRegistry ®istry) Q_DECL_OVERRIDE; | ||
61 | void removeDataFromDisk(const QByteArray &instanceIdentifier) Q_DECL_OVERRIDE; | ||
62 | }; | ||
63 | |||