diff options
author | Sandro Knauß <sknauss@kde.org> | 2017-01-16 18:40:10 +0100 |
---|---|---|
committer | Sandro Knauß <sknauss@kde.org> | 2017-01-30 10:59:30 +0100 |
commit | a8075ac935cec172972b7bea375db2c70eb4bec8 (patch) | |
tree | fae9ec8f8bd5fe225bb80e0801a63c3aa8594c5b /examples/davresource/davresource.h | |
parent | 2486b417dbfb4daf0741f7b870e3d276fac87729 (diff) | |
download | sink-a8075ac935cec172972b7bea375db2c70eb4bec8.tar.gz sink-a8075ac935cec172972b7bea375db2c70eb4bec8.zip |
starting with davresource
Diffstat (limited to 'examples/davresource/davresource.h')
-rw-r--r-- | examples/davresource/davresource.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/examples/davresource/davresource.h b/examples/davresource/davresource.h new file mode 100644 index 0000000..3b228c2 --- /dev/null +++ b/examples/davresource/davresource.h | |||
@@ -0,0 +1,68 @@ | |||
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 <KDAV/DavUrl> | ||
25 | #include <Async/Async> | ||
26 | |||
27 | #include <flatbuffers/flatbuffers.h> | ||
28 | |||
29 | class ContactAdaptorFactory; | ||
30 | class AddressbookAdaptorFactory; | ||
31 | |||
32 | /** | ||
33 | * A DAV 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 DavResource : public Sink::GenericResource | ||
44 | { | ||
45 | public: | ||
46 | DavResource(const Sink::ResourceContext &resourceContext); | ||
47 | |||
48 | private: | ||
49 | QStringList listAvailableFolders(); | ||
50 | |||
51 | KDAV::DavUrl mResourceUrl; | ||
52 | }; | ||
53 | |||
54 | class DavResourceFactory : public Sink::ResourceFactory | ||
55 | { | ||
56 | Q_OBJECT | ||
57 | Q_PLUGIN_METADATA(IID "sink.davresource") | ||
58 | Q_INTERFACES(Sink::ResourceFactory) | ||
59 | |||
60 | public: | ||
61 | DavResourceFactory(QObject *parent = 0); | ||
62 | |||
63 | Sink::Resource *createResource(const Sink::ResourceContext &context) Q_DECL_OVERRIDE; | ||
64 | void registerFacades(const QByteArray &resourceName, Sink::FacadeFactory &factory) Q_DECL_OVERRIDE; | ||
65 | void registerAdaptorFactories(const QByteArray &resourceName, Sink::AdaptorFactoryRegistry ®istry) Q_DECL_OVERRIDE; | ||
66 | void removeDataFromDisk(const QByteArray &instanceIdentifier) Q_DECL_OVERRIDE; | ||
67 | }; | ||
68 | |||