summaryrefslogtreecommitdiffstats
path: root/common/clientapi.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-10 10:47:12 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-10 10:47:12 +0100
commit0991561c9630fcb89b9666b8d57c2b7ea592fec6 (patch)
tree66e12af97c055a62fc15ef1946e3bb166d4c55bf /common/clientapi.h
parentc1c336a9064557bb987c30582bce84bab3f869bc (diff)
downloadsink-0991561c9630fcb89b9666b8d57c2b7ea592fec6.tar.gz
sink-0991561c9630fcb89b9666b8d57c2b7ea592fec6.zip
Moved Store to separate file
Diffstat (limited to 'common/clientapi.h')
-rw-r--r--common/clientapi.h64
1 files changed, 2 insertions, 62 deletions
diff --git a/common/clientapi.h b/common/clientapi.h
index 2b49826..a1d2469 100644
--- a/common/clientapi.h
+++ b/common/clientapi.h
@@ -26,6 +26,8 @@
26 26
27#include <Async/Async> 27#include <Async/Async>
28 28
29#include "store.h"
30
29#include "query.h" 31#include "query.h"
30#include "inspection.h" 32#include "inspection.h"
31#include "applicationdomaintype.h" 33#include "applicationdomaintype.h"
@@ -49,68 +51,6 @@ private:
49}; 51};
50 52
51 53
52/**
53 * Store interface used in the client API.
54 */
55namespace Store {
56
57QString SINK_EXPORT storageLocation();
58
59enum Roles {
60 DomainObjectRole = Qt::UserRole + 1, //Must be the same as in ModelResult
61 ChildrenFetchedRole,
62 DomainObjectBaseRole
63};
64
65/**
66 * Asynchronusly load a dataset with tree structure information
67 */
68template <class DomainType>
69QSharedPointer<QAbstractItemModel> SINK_EXPORT loadModel(Query query);
70
71/**
72 * Create a new entity.
73 */
74template <class DomainType>
75KAsync::Job<void> SINK_EXPORT create(const DomainType &domainObject);
76
77/**
78 * Modify an entity.
79 *
80 * This includes moving etc. since these are also simple settings on a property.
81 */
82template <class DomainType>
83KAsync::Job<void> SINK_EXPORT modify(const DomainType &domainObject);
84
85/**
86 * Remove an entity.
87 */
88template <class DomainType>
89KAsync::Job<void> SINK_EXPORT remove(const DomainType &domainObject);
90
91/**
92 * Synchronize data to local cache.
93 */
94KAsync::Job<void> SINK_EXPORT synchronize(const Sink::Query &query);
95
96/**
97 * Removes all resource data from disk.
98 *
99 * This will not touch the configuration. All commands that that arrived at the resource before this command will be dropped. All commands that arrived later will be executed.
100 */
101KAsync::Job<void> SINK_EXPORT removeDataFromDisk(const QByteArray &resourceIdentifier);
102
103template <class DomainType>
104KAsync::Job<DomainType> SINK_EXPORT fetchOne(const Sink::Query &query);
105
106template <class DomainType>
107KAsync::Job<QList<typename DomainType::Ptr> > SINK_EXPORT fetchAll(const Sink::Query &query);
108
109template <class DomainType>
110KAsync::Job<QList<typename DomainType::Ptr> > SINK_EXPORT fetch(const Sink::Query &query, int minimumAmount = 0);
111
112};
113
114namespace ResourceControl { 54namespace ResourceControl {
115 55
116template <class DomainType> 56template <class DomainType>