diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-19 14:11:02 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-19 14:11:02 +0200 |
commit | f89e43b3603976bc0e6eb885b3b9a43a6caff1c2 (patch) | |
tree | 2ce617aa7a0f6b82b274f8fc9c0e74be5706ea31 /examples/dummyresource/facade.h | |
parent | 9ce338c195bdc123633c3018a91908df26848da6 (diff) | |
download | sink-f89e43b3603976bc0e6eb885b3b9a43a6caff1c2.tar.gz sink-f89e43b3603976bc0e6eb885b3b9a43a6caff1c2.zip |
Moved client and dummyresource to examples/
Diffstat (limited to 'examples/dummyresource/facade.h')
-rw-r--r-- | examples/dummyresource/facade.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/examples/dummyresource/facade.h b/examples/dummyresource/facade.h new file mode 100644 index 0000000..91ae351 --- /dev/null +++ b/examples/dummyresource/facade.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014 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/facade.h" | ||
23 | |||
24 | #include "common/clientapi.h" | ||
25 | #include "common/storage.h" | ||
26 | #include "resourcefactory.h" | ||
27 | #include "entity_generated.h" | ||
28 | #include "event_generated.h" | ||
29 | #include "dummycalendar_generated.h" | ||
30 | #include "common/domainadaptor.h" | ||
31 | |||
32 | class DummyResourceFacade : public Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::Event> | ||
33 | { | ||
34 | public: | ||
35 | DummyResourceFacade(); | ||
36 | virtual ~DummyResourceFacade(); | ||
37 | Async::Job<void> create(const Akonadi2::ApplicationDomain::Event &domainObject) Q_DECL_OVERRIDE; | ||
38 | Async::Job<void> modify(const Akonadi2::ApplicationDomain::Event &domainObject) Q_DECL_OVERRIDE; | ||
39 | Async::Job<void> remove(const Akonadi2::ApplicationDomain::Event &domainObject) Q_DECL_OVERRIDE; | ||
40 | Async::Job<qint64> load(const Akonadi2::Query &query, const std::function<void(const Akonadi2::ApplicationDomain::Event::Ptr &)> &resultCallback) Q_DECL_OVERRIDE; | ||
41 | |||
42 | private: | ||
43 | void readValue(QSharedPointer<Akonadi2::Storage> storage, const QByteArray &key, const std::function<void(const Akonadi2::ApplicationDomain::Event::Ptr &)> &resultCallback, std::function<bool(const std::string &key, DummyCalendar::DummyEvent const *buffer, Akonadi2::ApplicationDomain::Buffer::Event const *local)>); | ||
44 | QSharedPointer<DomainTypeAdaptorFactory<Akonadi2::ApplicationDomain::Event, Akonadi2::ApplicationDomain::Buffer::Event, DummyCalendar::DummyEvent, Akonadi2::ApplicationDomain::Buffer::EventBuilder, DummyCalendar::DummyEventBuilder> > mFactory; | ||
45 | }; | ||